@@ -31,8 +31,8 @@ use rustc_front::hir;
3131use rustc_front:: hir:: { ViewPathGlob , ViewPathList , ViewPathSimple } ;
3232use rustc_front:: visit:: { self , Visitor } ;
3333
34- struct UnusedImportCheckVisitor < ' a , ' b : ' a , ' tcx : ' b > {
35- resolver : & ' a mut Resolver < ' b , ' tcx >
34+ struct UnusedImportCheckVisitor < ' a , ' b : ' a , ' tcx : ' b > {
35+ resolver : & ' a mut Resolver < ' b , ' tcx > ,
3636}
3737
3838// Deref and DerefMut impls allow treating UnusedImportCheckVisitor as Resolver.
@@ -51,16 +51,16 @@ impl<'a, 'b, 'tcx:'b> DerefMut for UnusedImportCheckVisitor<'a, 'b, 'tcx> {
5151}
5252
5353impl < ' a , ' b , ' tcx > UnusedImportCheckVisitor < ' a , ' b , ' tcx > {
54- // We have information about whether `use` (import) directives are actually used now.
55- // If an import is not used at all, we signal a lint error. If an import is only used
56- // for a single namespace, we remove the other namespace from the recorded privacy
57- // information. That means in privacy.rs, we will only check imports and namespaces
58- // which are used. In particular, this means that if an import could name either a
59- // public or private item, we will check the correct thing, dependent on how the import
60- // is used.
54+ // We have information about whether `use` (import) directives are actually
55+ // used now. If an import is not used at all, we signal a lint error. If an
56+ // import is only used for a single namespace, we remove the other namespace
57+ // from the recorded privacy information. That means in privacy.rs, we will
58+ // only check imports and namespaces which are used. In particular, this
59+ // means that if an import could name either a public or private item, we
60+ // will check the correct thing, dependent on how the import is used.
6161 fn finalize_import ( & mut self , id : ast:: NodeId , span : Span ) {
6262 debug ! ( "finalizing import uses for {:?}" ,
63- self . session. codemap( ) . span_to_snippet( span) ) ;
63+ self . session. codemap( ) . span_to_snippet( span) ) ;
6464
6565 if !self . used_imports . contains ( & ( id, TypeNS ) ) &&
6666 !self . used_imports . contains ( & ( id, ValueNS ) ) {
@@ -99,14 +99,14 @@ impl<'a, 'b, 'tcx> UnusedImportCheckVisitor<'a, 'b, 'tcx> {
9999 // we might have two LastPrivates pointing at the same thing. There is no point
100100 // checking both, so lets not check the value one.
101101 ( Some ( DependsOn ( def_v) ) , Some ( DependsOn ( def_t) ) ) if def_v == def_t => v_used = Unused ,
102- _ => { } ,
102+ _ => { }
103103 }
104104
105105 path_res. last_private = LastImport {
106106 value_priv : v_priv,
107107 value_used : v_used,
108108 type_priv : t_priv,
109- type_used : t_used
109+ type_used : t_used,
110110 } ;
111111 }
112112}
@@ -132,7 +132,7 @@ impl<'a, 'b, 'v, 'tcx> Visitor<'v> for UnusedImportCheckVisitor<'a, 'b, 'tcx> {
132132 "unused extern crate" . to_string ( ) ) ;
133133 }
134134 }
135- } ,
135+ }
136136 hir:: ItemUse ( ref p) => {
137137 match p. node {
138138 ViewPathSimple ( _, _) => {
0 commit comments