@@ -129,106 +129,85 @@ pub trait LintPass {
129129//
130130// FIXME: eliminate the duplication with `Visitor`. But this also
131131// contains a few lint-specific methods with no equivalent in `Visitor`.
132- pub trait LateLintPass : LintPass {
132+ pub trait LateLintPass < ' a , ' tcx > : LintPass {
133133 fn check_name ( & mut self , _: & LateContext , _: Span , _: ast:: Name ) { }
134- fn check_crate < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > , _: & ' tcx hir:: Crate ) { }
135- fn check_crate_post < ' a , ' tcx : ' a > ( & mut self ,
136- _: & ' a LateContext < ' a , ' tcx > ,
137- _: & ' tcx hir:: Crate ) { }
138- fn check_mod < ' a , ' tcx : ' a > ( & mut self ,
139- _: & ' a LateContext < ' a , ' tcx > ,
140- _: & ' tcx hir:: Mod ,
141- _: Span ,
142- _: ast:: NodeId ) { }
143- fn check_mod_post < ' a , ' tcx : ' a > ( & mut self ,
144- _: & ' a LateContext < ' a , ' tcx > ,
145- _: & ' tcx hir:: Mod ,
146- _: Span ,
147- _: ast:: NodeId ) { }
148- fn check_foreign_item < ' a , ' tcx : ' a > ( & mut self ,
149- _: & ' a LateContext < ' a , ' tcx > ,
150- _: & ' tcx hir:: ForeignItem ) { }
151- fn check_foreign_item_post < ' a , ' tcx : ' a > ( & mut self ,
152- _: & ' a LateContext < ' a , ' tcx > ,
153- _: & ' tcx hir:: ForeignItem ) { }
154- fn check_item < ' a , ' tcx : ' a > ( & mut self ,
155- _: & ' a LateContext < ' a , ' tcx > ,
156- _: & ' tcx hir:: Item ) { }
157- fn check_item_post < ' a , ' tcx : ' a > ( & mut self ,
158- _: & ' a LateContext < ' a , ' tcx > ,
159- _: & ' tcx hir:: Item ) { }
160- fn check_local < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > , _: & ' tcx hir:: Local ) { }
161- fn check_block < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > , _: & ' tcx hir:: Block ) { }
162- fn check_block_post < ' a , ' tcx : ' a > ( & mut self ,
163- _: & ' a LateContext < ' a , ' tcx > ,
164- _: & ' tcx hir:: Block ) { }
165- fn check_stmt < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > , _: & ' tcx hir:: Stmt ) { }
166- fn check_arm < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > , _: & ' tcx hir:: Arm ) { }
167- fn check_pat < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > , _: & ' tcx hir:: Pat ) { }
168- fn check_decl < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > , _: & ' tcx hir:: Decl ) { }
169- fn check_expr < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > , _: & ' tcx hir:: Expr ) { }
170- fn check_expr_post < ' a , ' tcx : ' a > ( & mut self ,
171- _: & ' a LateContext < ' a , ' tcx > ,
172- _: & ' tcx hir:: Expr ) { }
173- fn check_ty < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > , _: & ' tcx hir:: Ty ) { }
174- fn check_generics < ' a , ' tcx : ' a > ( & mut self ,
175- _: & ' a LateContext < ' a , ' tcx > ,
176- _: & ' tcx hir:: Generics ) { }
177- fn check_fn < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > ,
178- _: FnKind < ' tcx > , _: & ' tcx hir:: FnDecl , _: & ' tcx hir:: Expr , _: Span , _: ast:: NodeId ) { }
179- fn check_fn_post < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > ,
180- _: FnKind < ' tcx > , _: & ' tcx hir:: FnDecl , _: & ' tcx hir:: Expr , _: Span , _: ast:: NodeId ) { }
181- fn check_trait_item < ' a , ' tcx : ' a > ( & mut self ,
182- _: & ' a LateContext < ' a , ' tcx > ,
183- _: & ' tcx hir:: TraitItem ) { }
184- fn check_trait_item_post < ' a , ' tcx : ' a > ( & mut self ,
185- _: & ' a LateContext < ' a , ' tcx > ,
186- _: & ' tcx hir:: TraitItem ) { }
187- fn check_impl_item < ' a , ' tcx : ' a > ( & mut self ,
188- _: & ' a LateContext < ' a , ' tcx > ,
189- _: & ' tcx hir:: ImplItem ) { }
190- fn check_impl_item_post < ' a , ' tcx : ' a > ( & mut self ,
191- _: & ' a LateContext < ' a , ' tcx > ,
192- _: & ' tcx hir:: ImplItem ) { }
193- fn check_struct_def < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > ,
194- _: & ' tcx hir:: VariantData , _: ast:: Name , _: & ' tcx hir:: Generics , _: ast:: NodeId ) { }
195- fn check_struct_def_post < ' a , ' tcx : ' a > ( & mut self , _: & ' a LateContext < ' a , ' tcx > ,
196- _: & ' tcx hir:: VariantData , _: ast:: Name , _: & ' tcx hir:: Generics , _: ast:: NodeId ) { }
197- fn check_struct_field < ' a , ' tcx : ' a > ( & mut self ,
198- _: & ' a LateContext < ' a , ' tcx > ,
199- _: & ' tcx hir:: StructField ) { }
200- fn check_variant < ' a , ' tcx : ' a > ( & mut self ,
201- _: & ' a LateContext < ' a , ' tcx > ,
202- _: & ' tcx hir:: Variant ,
203- _: & ' tcx hir:: Generics ) { }
204- fn check_variant_post < ' a , ' tcx : ' a > ( & mut self ,
205- _: & ' a LateContext < ' a , ' tcx > ,
206- _: & ' tcx hir:: Variant ,
207- _: & ' tcx hir:: Generics ) { }
208- fn check_lifetime < ' a , ' tcx : ' a > ( & mut self ,
209- _: & ' a LateContext < ' a , ' tcx > ,
210- _: & ' tcx hir:: Lifetime ) { }
211- fn check_lifetime_def < ' a , ' tcx : ' a > ( & mut self ,
212- _: & ' a LateContext < ' a , ' tcx > ,
213- _: & ' tcx hir:: LifetimeDef ) { }
214- fn check_path < ' a , ' tcx : ' a > ( & mut self ,
215- _: & ' a LateContext < ' a , ' tcx > ,
216- _: & ' tcx hir:: Path ,
217- _: ast:: NodeId ) { }
218- fn check_attribute < ' a , ' tcx : ' a > ( & mut self ,
219- _: & ' a LateContext < ' a , ' tcx > ,
220- _: & ' tcx ast:: Attribute ) { }
134+ fn check_crate ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Crate ) { }
135+ fn check_crate_post ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Crate ) { }
136+ fn check_mod ( & mut self ,
137+ _: & LateContext < ' a , ' tcx > ,
138+ _: & ' tcx hir:: Mod ,
139+ _: Span ,
140+ _: ast:: NodeId ) { }
141+ fn check_mod_post ( & mut self ,
142+ _: & LateContext < ' a , ' tcx > ,
143+ _: & ' tcx hir:: Mod ,
144+ _: Span ,
145+ _: ast:: NodeId ) { }
146+ fn check_foreign_item ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: ForeignItem ) { }
147+ fn check_foreign_item_post ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: ForeignItem ) { }
148+ fn check_item ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Item ) { }
149+ fn check_item_post ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Item ) { }
150+ fn check_local ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Local ) { }
151+ fn check_block ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Block ) { }
152+ fn check_block_post ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Block ) { }
153+ fn check_stmt ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Stmt ) { }
154+ fn check_arm ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Arm ) { }
155+ fn check_pat ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Pat ) { }
156+ fn check_decl ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Decl ) { }
157+ fn check_expr ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Expr ) { }
158+ fn check_expr_post ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Expr ) { }
159+ fn check_ty ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Ty ) { }
160+ fn check_generics ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Generics ) { }
161+ fn check_fn ( & mut self ,
162+ _: & LateContext < ' a , ' tcx > ,
163+ _: FnKind < ' tcx > ,
164+ _: & ' tcx hir:: FnDecl ,
165+ _: & ' tcx hir:: Expr ,
166+ _: Span ,
167+ _: ast:: NodeId ) { }
168+ fn check_fn_post ( & mut self ,
169+ _: & LateContext < ' a , ' tcx > ,
170+ _: FnKind < ' tcx > ,
171+ _: & ' tcx hir:: FnDecl ,
172+ _: & ' tcx hir:: Expr ,
173+ _: Span ,
174+ _: ast:: NodeId ) { }
175+ fn check_trait_item ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: TraitItem ) { }
176+ fn check_trait_item_post ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: TraitItem ) { }
177+ fn check_impl_item ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: ImplItem ) { }
178+ fn check_impl_item_post ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: ImplItem ) { }
179+ fn check_struct_def ( & mut self ,
180+ _: & LateContext < ' a , ' tcx > ,
181+ _: & ' tcx hir:: VariantData ,
182+ _: ast:: Name ,
183+ _: & ' tcx hir:: Generics ,
184+ _: ast:: NodeId ) { }
185+ fn check_struct_def_post ( & mut self ,
186+ _: & LateContext < ' a , ' tcx > ,
187+ _: & ' tcx hir:: VariantData ,
188+ _: ast:: Name ,
189+ _: & ' tcx hir:: Generics ,
190+ _: ast:: NodeId ) { }
191+ fn check_struct_field ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: StructField ) { }
192+ fn check_variant ( & mut self ,
193+ _: & LateContext < ' a , ' tcx > ,
194+ _: & ' tcx hir:: Variant ,
195+ _: & ' tcx hir:: Generics ) { }
196+ fn check_variant_post ( & mut self ,
197+ _: & LateContext < ' a , ' tcx > ,
198+ _: & ' tcx hir:: Variant ,
199+ _: & ' tcx hir:: Generics ) { }
200+ fn check_lifetime ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Lifetime ) { }
201+ fn check_lifetime_def ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: LifetimeDef ) { }
202+ fn check_path ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx hir:: Path , _: ast:: NodeId ) { }
203+ fn check_attribute ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx ast:: Attribute ) { }
221204
222205 /// Called when entering a syntax node that can have lint attributes such
223206 /// as `#[allow(...)]`. Called with *all* the attributes of that node.
224- fn enter_lint_attrs < ' a , ' tcx : ' a > ( & mut self ,
225- _: & ' a LateContext < ' a , ' tcx > ,
226- _: & ' tcx [ ast:: Attribute ] ) { }
207+ fn enter_lint_attrs ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx [ ast:: Attribute ] ) { }
227208
228209 /// Counterpart to `enter_lint_attrs`.
229- fn exit_lint_attrs < ' a , ' tcx : ' a > ( & mut self ,
230- _: & ' a LateContext < ' a , ' tcx > ,
231- _: & ' tcx [ ast:: Attribute ] ) { }
210+ fn exit_lint_attrs ( & mut self , _: & LateContext < ' a , ' tcx > , _: & ' tcx [ ast:: Attribute ] ) { }
232211}
233212
234213pub trait EarlyLintPass : LintPass {
@@ -282,7 +261,7 @@ pub trait EarlyLintPass: LintPass {
282261
283262/// A lint pass boxed up as a trait object.
284263pub type EarlyLintPassObject = Box < EarlyLintPass + ' static > ;
285- pub type LateLintPassObject = Box < LateLintPass + ' static > ;
264+ pub type LateLintPassObject = Box < for < ' a , ' tcx > LateLintPass < ' a , ' tcx > + ' static > ;
286265
287266/// Identifies a lint known to the compiler.
288267#[ derive( Clone , Copy , Debug ) ]
0 commit comments