@@ -284,19 +284,6 @@ impl<'a> AstValidator<'a> {
284
284
self . session . dcx ( )
285
285
}
286
286
287
- fn check_lifetime ( & self , ident : Ident ) {
288
- let valid_names = [ kw:: UnderscoreLifetime , kw:: StaticLifetime , kw:: Empty ] ;
289
- if !valid_names. contains ( & ident. name ) && ident. without_first_quote ( ) . is_reserved ( ) {
290
- self . dcx ( ) . emit_err ( errors:: KeywordLifetime { span : ident. span } ) ;
291
- }
292
- }
293
-
294
- fn check_label ( & self , ident : Ident ) {
295
- if ident. without_first_quote ( ) . is_reserved ( ) {
296
- self . dcx ( ) . emit_err ( errors:: InvalidLabel { span : ident. span , name : ident. name } ) ;
297
- }
298
- }
299
-
300
287
fn visibility_not_permitted ( & self , vis : & Visibility , note : errors:: VisibilityNotPermittedNote ) {
301
288
if let VisibilityKind :: Inherited = vis. kind {
302
289
return ;
@@ -923,16 +910,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
923
910
self . walk_ty ( ty)
924
911
}
925
912
926
- fn visit_label ( & mut self , label : & ' a Label ) {
927
- self . check_label ( label. ident ) ;
928
- visit:: walk_label ( self , label) ;
929
- }
930
-
931
- fn visit_lifetime ( & mut self , lifetime : & ' a Lifetime , _: visit:: LifetimeCtxt ) {
932
- self . check_lifetime ( lifetime. ident ) ;
933
- visit:: walk_lifetime ( self , lifetime) ;
934
- }
935
-
936
913
fn visit_field_def ( & mut self , field : & ' a FieldDef ) {
937
914
self . deny_unnamed_field ( field) ;
938
915
visit:: walk_field_def ( self , field)
@@ -1371,13 +1348,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
1371
1348
}
1372
1349
}
1373
1350
1374
- fn visit_generic_param ( & mut self , param : & ' a GenericParam ) {
1375
- if let GenericParamKind :: Lifetime { .. } = param. kind {
1376
- self . check_lifetime ( param. ident ) ;
1377
- }
1378
- visit:: walk_generic_param ( self , param) ;
1379
- }
1380
-
1381
1351
fn visit_param_bound ( & mut self , bound : & ' a GenericBound , ctxt : BoundKind ) {
1382
1352
match bound {
1383
1353
GenericBound :: Trait ( trait_ref, modifiers) => {
0 commit comments