Warn unused trait imports

This commit is contained in:
Seo Sanghyeon 2016-04-19 22:43:10 +09:00
parent 7ad1900e1c
commit 24d86137f5
13 changed files with 169 additions and 25 deletions

View file

@ -15,6 +15,7 @@
#![feature(rustc_attrs)]
#![allow(dead_code)]
#![allow(unused_imports)]
fn main() { }

View file

@ -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 {}