From a504ef488a719ef2dd7daecc1ad092b3bc454c32 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 1 Apr 2016 21:25:20 +0530 Subject: [PATCH] Add regression test for #825 --- tests/issue-825.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/issue-825.rs diff --git a/tests/issue-825.rs b/tests/issue-825.rs new file mode 100644 index 000000000..f5c0725f8 --- /dev/null +++ b/tests/issue-825.rs @@ -0,0 +1,25 @@ +#![feature(plugin)] +#![plugin(clippy)] + +#![allow(warnings)] + +// this should compile in a reasonable amount of time +fn rust_type_id(name: String) { + if "bool" == &name[..] || + "uint" == &name[..] || + "u8" == &name[..] || + "u16" == &name[..] || + "u32" == &name[..] || + "f32" == &name[..] || + "f64" == &name[..] || + "i8" == &name[..] || + "i16" == &name[..] || + "i32" == &name[..] || + "i64" == &name[..] || + "Self" == &name[..] || + "str" == &name[..] { + unreachable!(); + } +} + +fn main() {} \ No newline at end of file