@@ -143,15 +143,15 @@ impl<'a> Context<'a> {
143143 }
144144}
145145
146- impl < ' a > Visitor < ( ) > for Context < ' a > {
147- fn visit_ident ( & mut self , sp : Span , id : ast:: Ident , _ : ( ) ) {
146+ impl < ' a , ' v > Visitor < ' v > for Context < ' a > {
147+ fn visit_ident ( & mut self , sp : Span , id : ast:: Ident ) {
148148 if !token:: get_ident ( id) . get ( ) . is_ascii ( ) {
149149 self . gate_feature ( "non_ascii_idents" , sp,
150150 "non-ascii idents are not fully supported." ) ;
151151 }
152152 }
153153
154- fn visit_view_item ( & mut self , i : & ast:: ViewItem , _ : ( ) ) {
154+ fn visit_view_item ( & mut self , i : & ast:: ViewItem ) {
155155 match i. node {
156156 ast:: ViewItemUse ( ref path) => {
157157 match path. node {
@@ -173,10 +173,10 @@ impl<'a> Visitor<()> for Context<'a> {
173173 }
174174 }
175175 }
176- visit:: walk_view_item ( self , i, ( ) )
176+ visit:: walk_view_item ( self , i)
177177 }
178178
179- fn visit_item ( & mut self , i : & ast:: Item , _ : ( ) ) {
179+ fn visit_item ( & mut self , i : & ast:: Item ) {
180180 for attr in i. attrs . iter ( ) {
181181 if attr. name ( ) . equiv ( & ( "thread_local" ) ) {
182182 self . gate_feature ( "thread_local" , i. span ,
@@ -252,10 +252,10 @@ impl<'a> Visitor<()> for Context<'a> {
252252 _ => { }
253253 }
254254
255- visit:: walk_item ( self , i, ( ) ) ;
255+ visit:: walk_item ( self , i) ;
256256 }
257257
258- fn visit_mac ( & mut self , macro : & ast:: Mac , _ : ( ) ) {
258+ fn visit_mac ( & mut self , macro : & ast:: Mac ) {
259259 let ast:: MacInvocTT ( ref path, _, _) = macro. node ;
260260 let id = path. segments . last ( ) . unwrap ( ) . identifier ;
261261 let quotes = [ "quote_tokens" , "quote_expr" , "quote_ty" ,
@@ -299,16 +299,16 @@ impl<'a> Visitor<()> for Context<'a> {
299299 }
300300 }
301301
302- fn visit_foreign_item ( & mut self , i : & ast:: ForeignItem , _ : ( ) ) {
302+ fn visit_foreign_item ( & mut self , i : & ast:: ForeignItem ) {
303303 if attr:: contains_name ( i. attrs . as_slice ( ) , "linkage" ) {
304304 self . gate_feature ( "linkage" , i. span ,
305305 "the `linkage` attribute is experimental \
306306 and not portable across platforms")
307307 }
308- visit:: walk_foreign_item ( self , i, ( ) )
308+ visit:: walk_foreign_item ( self , i)
309309 }
310310
311- fn visit_ty ( & mut self , t : & ast:: Ty , _ : ( ) ) {
311+ fn visit_ty ( & mut self , t : & ast:: Ty ) {
312312 match t. node {
313313 ast:: TyClosure ( closure) if closure. onceness == ast:: Once => {
314314 self . gate_feature ( "once_fns" , t. span ,
@@ -325,10 +325,10 @@ impl<'a> Visitor<()> for Context<'a> {
325325 _ => { }
326326 }
327327
328- visit:: walk_ty ( self , t, ( ) ) ;
328+ visit:: walk_ty ( self , t) ;
329329 }
330330
331- fn visit_expr ( & mut self , e : & ast:: Expr , _ : ( ) ) {
331+ fn visit_expr ( & mut self , e : & ast:: Expr ) {
332332 match e. node {
333333 ast:: ExprUnary ( ast:: UnBox , _) => {
334334 self . gate_box ( e. span ) ;
@@ -346,10 +346,10 @@ impl<'a> Visitor<()> for Context<'a> {
346346 }
347347 _ => { }
348348 }
349- visit:: walk_expr ( self , e, ( ) ) ;
349+ visit:: walk_expr ( self , e) ;
350350 }
351351
352- fn visit_generics ( & mut self , generics : & ast:: Generics , _ : ( ) ) {
352+ fn visit_generics ( & mut self , generics : & ast:: Generics ) {
353353 for type_parameter in generics. ty_params . iter ( ) {
354354 match type_parameter. default {
355355 Some ( ty) => {
@@ -360,18 +360,18 @@ impl<'a> Visitor<()> for Context<'a> {
360360 None => { }
361361 }
362362 }
363- visit:: walk_generics ( self , generics, ( ) ) ;
363+ visit:: walk_generics ( self , generics) ;
364364 }
365365
366- fn visit_attribute ( & mut self , attr : & ast:: Attribute , _ : ( ) ) {
366+ fn visit_attribute ( & mut self , attr : & ast:: Attribute ) {
367367 if attr:: contains_name ( [ * attr] , "lang" ) {
368368 self . gate_feature ( "lang_items" ,
369369 attr. span ,
370370 "language items are subject to change" ) ;
371371 }
372372 }
373373
374- fn visit_pat ( & mut self , pattern : & ast:: Pat , ( ) : ( ) ) {
374+ fn visit_pat ( & mut self , pattern : & ast:: Pat ) {
375375 match pattern. node {
376376 ast:: PatVec ( _, Some ( _) , ref last) if !last. is_empty ( ) => {
377377 self . gate_feature ( "advanced_slice_patterns" ,
@@ -382,25 +382,24 @@ impl<'a> Visitor<()> for Context<'a> {
382382 }
383383 _ => { }
384384 }
385- visit:: walk_pat ( self , pattern, ( ) )
385+ visit:: walk_pat ( self , pattern)
386386 }
387387
388388 fn visit_fn ( & mut self ,
389- fn_kind : & visit:: FnKind ,
390- fn_decl : & ast:: FnDecl ,
391- block : & ast:: Block ,
389+ fn_kind : visit:: FnKind < ' v > ,
390+ fn_decl : & ' v ast:: FnDecl ,
391+ block : & ' v ast:: Block ,
392392 span : Span ,
393- _: NodeId ,
394- ( ) : ( ) ) {
395- match * fn_kind {
396- visit:: FkItemFn ( _, _, _, ref abi) if * abi == RustIntrinsic => {
393+ _: NodeId ) {
394+ match fn_kind {
395+ visit:: FkItemFn ( _, _, _, abi) if abi == RustIntrinsic => {
397396 self . gate_feature ( "intrinsics" ,
398397 span,
399398 "intrinsics are subject to change" )
400399 }
401400 _ => { }
402401 }
403- visit:: walk_fn ( self , fn_kind, fn_decl, block, span, ( ) ) ;
402+ visit:: walk_fn ( self , fn_kind, fn_decl, block, span) ;
404403 }
405404}
406405
@@ -453,7 +452,7 @@ pub fn check_crate(sess: &Session, krate: &ast::Crate) {
453452 }
454453 }
455454
456- visit:: walk_crate ( & mut cx, krate, ( ) ) ;
455+ visit:: walk_crate ( & mut cx, krate) ;
457456
458457 sess. abort_if_errors ( ) ;
459458
0 commit comments