@@ -143,15 +143,15 @@ impl<'a> Context<'a> {
143
143
}
144
144
}
145
145
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 ) {
148
148
if !token:: get_ident ( id) . get ( ) . is_ascii ( ) {
149
149
self . gate_feature ( "non_ascii_idents" , sp,
150
150
"non-ascii idents are not fully supported." ) ;
151
151
}
152
152
}
153
153
154
- fn visit_view_item ( & mut self , i : & ast:: ViewItem , _ : ( ) ) {
154
+ fn visit_view_item ( & mut self , i : & ast:: ViewItem ) {
155
155
match i. node {
156
156
ast:: ViewItemUse ( ref path) => {
157
157
match path. node {
@@ -173,10 +173,10 @@ impl<'a> Visitor<()> for Context<'a> {
173
173
}
174
174
}
175
175
}
176
- visit:: walk_view_item ( self , i, ( ) )
176
+ visit:: walk_view_item ( self , i)
177
177
}
178
178
179
- fn visit_item ( & mut self , i : & ast:: Item , _ : ( ) ) {
179
+ fn visit_item ( & mut self , i : & ast:: Item ) {
180
180
for attr in i. attrs . iter ( ) {
181
181
if attr. name ( ) . equiv ( & ( "thread_local" ) ) {
182
182
self . gate_feature ( "thread_local" , i. span ,
@@ -252,10 +252,10 @@ impl<'a> Visitor<()> for Context<'a> {
252
252
_ => { }
253
253
}
254
254
255
- visit:: walk_item ( self , i, ( ) ) ;
255
+ visit:: walk_item ( self , i) ;
256
256
}
257
257
258
- fn visit_mac ( & mut self , macro : & ast:: Mac , _ : ( ) ) {
258
+ fn visit_mac ( & mut self , macro : & ast:: Mac ) {
259
259
let ast:: MacInvocTT ( ref path, _, _) = macro. node ;
260
260
let id = path. segments . last ( ) . unwrap ( ) . identifier ;
261
261
let quotes = [ "quote_tokens" , "quote_expr" , "quote_ty" ,
@@ -299,16 +299,16 @@ impl<'a> Visitor<()> for Context<'a> {
299
299
}
300
300
}
301
301
302
- fn visit_foreign_item ( & mut self , i : & ast:: ForeignItem , _ : ( ) ) {
302
+ fn visit_foreign_item ( & mut self , i : & ast:: ForeignItem ) {
303
303
if attr:: contains_name ( i. attrs . as_slice ( ) , "linkage" ) {
304
304
self . gate_feature ( "linkage" , i. span ,
305
305
"the `linkage` attribute is experimental \
306
306
and not portable across platforms")
307
307
}
308
- visit:: walk_foreign_item ( self , i, ( ) )
308
+ visit:: walk_foreign_item ( self , i)
309
309
}
310
310
311
- fn visit_ty ( & mut self , t : & ast:: Ty , _ : ( ) ) {
311
+ fn visit_ty ( & mut self , t : & ast:: Ty ) {
312
312
match t. node {
313
313
ast:: TyClosure ( closure) if closure. onceness == ast:: Once => {
314
314
self . gate_feature ( "once_fns" , t. span ,
@@ -325,10 +325,10 @@ impl<'a> Visitor<()> for Context<'a> {
325
325
_ => { }
326
326
}
327
327
328
- visit:: walk_ty ( self , t, ( ) ) ;
328
+ visit:: walk_ty ( self , t) ;
329
329
}
330
330
331
- fn visit_expr ( & mut self , e : & ast:: Expr , _ : ( ) ) {
331
+ fn visit_expr ( & mut self , e : & ast:: Expr ) {
332
332
match e. node {
333
333
ast:: ExprUnary ( ast:: UnBox , _) => {
334
334
self . gate_box ( e. span ) ;
@@ -346,10 +346,10 @@ impl<'a> Visitor<()> for Context<'a> {
346
346
}
347
347
_ => { }
348
348
}
349
- visit:: walk_expr ( self , e, ( ) ) ;
349
+ visit:: walk_expr ( self , e) ;
350
350
}
351
351
352
- fn visit_generics ( & mut self , generics : & ast:: Generics , _ : ( ) ) {
352
+ fn visit_generics ( & mut self , generics : & ast:: Generics ) {
353
353
for type_parameter in generics. ty_params . iter ( ) {
354
354
match type_parameter. default {
355
355
Some ( ty) => {
@@ -360,18 +360,18 @@ impl<'a> Visitor<()> for Context<'a> {
360
360
None => { }
361
361
}
362
362
}
363
- visit:: walk_generics ( self , generics, ( ) ) ;
363
+ visit:: walk_generics ( self , generics) ;
364
364
}
365
365
366
- fn visit_attribute ( & mut self , attr : & ast:: Attribute , _ : ( ) ) {
366
+ fn visit_attribute ( & mut self , attr : & ast:: Attribute ) {
367
367
if attr:: contains_name ( [ * attr] , "lang" ) {
368
368
self . gate_feature ( "lang_items" ,
369
369
attr. span ,
370
370
"language items are subject to change" ) ;
371
371
}
372
372
}
373
373
374
- fn visit_pat ( & mut self , pattern : & ast:: Pat , ( ) : ( ) ) {
374
+ fn visit_pat ( & mut self , pattern : & ast:: Pat ) {
375
375
match pattern. node {
376
376
ast:: PatVec ( _, Some ( _) , ref last) if !last. is_empty ( ) => {
377
377
self . gate_feature ( "advanced_slice_patterns" ,
@@ -382,25 +382,24 @@ impl<'a> Visitor<()> for Context<'a> {
382
382
}
383
383
_ => { }
384
384
}
385
- visit:: walk_pat ( self , pattern, ( ) )
385
+ visit:: walk_pat ( self , pattern)
386
386
}
387
387
388
388
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 ,
392
392
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 => {
397
396
self . gate_feature ( "intrinsics" ,
398
397
span,
399
398
"intrinsics are subject to change" )
400
399
}
401
400
_ => { }
402
401
}
403
- visit:: walk_fn ( self , fn_kind, fn_decl, block, span, ( ) ) ;
402
+ visit:: walk_fn ( self , fn_kind, fn_decl, block, span) ;
404
403
}
405
404
}
406
405
@@ -453,7 +452,7 @@ pub fn check_crate(sess: &Session, krate: &ast::Crate) {
453
452
}
454
453
}
455
454
456
- visit:: walk_crate ( & mut cx, krate, ( ) ) ;
455
+ visit:: walk_crate ( & mut cx, krate) ;
457
456
458
457
sess. abort_if_errors ( ) ;
459
458
0 commit comments