@@ -31,8 +31,8 @@ use rustc_front::hir;
31
31
use rustc_front:: hir:: { ViewPathGlob , ViewPathList , ViewPathSimple } ;
32
32
use rustc_front:: visit:: { self , Visitor } ;
33
33
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 > ,
36
36
}
37
37
38
38
// Deref and DerefMut impls allow treating UnusedImportCheckVisitor as Resolver.
@@ -51,16 +51,16 @@ impl<'a, 'b, 'tcx:'b> DerefMut for UnusedImportCheckVisitor<'a, 'b, 'tcx> {
51
51
}
52
52
53
53
impl < ' 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.
61
61
fn finalize_import ( & mut self , id : ast:: NodeId , span : Span ) {
62
62
debug ! ( "finalizing import uses for {:?}" ,
63
- self . session. codemap( ) . span_to_snippet( span) ) ;
63
+ self . session. codemap( ) . span_to_snippet( span) ) ;
64
64
65
65
if !self . used_imports . contains ( & ( id, TypeNS ) ) &&
66
66
!self . used_imports . contains ( & ( id, ValueNS ) ) {
@@ -99,14 +99,14 @@ impl<'a, 'b, 'tcx> UnusedImportCheckVisitor<'a, 'b, 'tcx> {
99
99
// we might have two LastPrivates pointing at the same thing. There is no point
100
100
// checking both, so lets not check the value one.
101
101
( Some ( DependsOn ( def_v) ) , Some ( DependsOn ( def_t) ) ) if def_v == def_t => v_used = Unused ,
102
- _ => { } ,
102
+ _ => { }
103
103
}
104
104
105
105
path_res. last_private = LastImport {
106
106
value_priv : v_priv,
107
107
value_used : v_used,
108
108
type_priv : t_priv,
109
- type_used : t_used
109
+ type_used : t_used,
110
110
} ;
111
111
}
112
112
}
@@ -132,7 +132,7 @@ impl<'a, 'b, 'v, 'tcx> Visitor<'v> for UnusedImportCheckVisitor<'a, 'b, 'tcx> {
132
132
"unused extern crate" . to_string ( ) ) ;
133
133
}
134
134
}
135
- } ,
135
+ }
136
136
hir:: ItemUse ( ref p) => {
137
137
match p. node {
138
138
ViewPathSimple ( _, _) => {
0 commit comments