diff options
| author | Seo Sanghyeon <sanxiyn@gmail.com> | 2016-04-19 22:43:10 +0900 |
|---|---|---|
| committer | Seo Sanghyeon <sanxiyn@gmail.com> | 2016-05-03 18:51:19 +0900 |
| commit | 24d86137f5d04bfade044e96bbb429db4b248c1d (patch) | |
| tree | 3e61936eb5dfa3e07d3409d670507799a01805de /src/test | |
| parent | 7ad1900e1cdb2bd9dbf9560c8c50c5912578723c (diff) | |
| download | rust-24d86137f5d04bfade044e96bbb429db4b248c1d.tar.gz rust-24d86137f5d04bfade044e96bbb429db4b248c1d.zip | |
Warn unused trait imports
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/lint-unused-imports.rs | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs b/src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs index 1afecd80ff5..5e4f43af669 100644 --- a/src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs +++ b/src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs @@ -15,6 +15,7 @@ #![feature(rustc_attrs)] #![allow(dead_code)] +#![allow(unused_imports)] fn main() { } diff --git a/src/test/compile-fail/lint-unused-imports.rs b/src/test/compile-fail/lint-unused-imports.rs index 3c1f4b04306..40322f5a5b5 100644 --- a/src/test/compile-fail/lint-unused-imports.rs +++ b/src/test/compile-fail/lint-unused-imports.rs @@ -24,6 +24,8 @@ use test::A; //~ ERROR unused import // Be sure that if we just bring some methods into scope that they're also // counted as being used. use test::B; +// But only when actually used: do not get confused by the method with the same name. +use test::B2; //~ ERROR unused import // Make sure this import is warned about when at least one of its imported names // is unused @@ -37,6 +39,7 @@ mod test2 { mod test { pub trait A { fn a(&self) {} } pub trait B { fn b(&self) {} } + pub trait B2 { fn b(&self) {} } pub struct C; impl A for C {} impl B for C {} |
