@@ -274,19 +274,6 @@ impl<'a> AstValidator<'a> {
274
274
self . session . dcx ( )
275
275
}
276
276
277
- fn check_lifetime ( & self , ident : Ident ) {
278
- let valid_names = [ kw:: UnderscoreLifetime , kw:: StaticLifetime , kw:: Empty ] ;
279
- if !valid_names. contains ( & ident. name ) && ident. without_first_quote ( ) . is_reserved ( ) {
280
- self . dcx ( ) . emit_err ( errors:: KeywordLifetime { span : ident. span } ) ;
281
- }
282
- }
283
-
284
- fn check_label ( & self , ident : Ident ) {
285
- if ident. without_first_quote ( ) . is_reserved ( ) {
286
- self . dcx ( ) . emit_err ( errors:: InvalidLabel { span : ident. span , name : ident. name } ) ;
287
- }
288
- }
289
-
290
277
fn visibility_not_permitted ( & self , vis : & Visibility , note : errors:: VisibilityNotPermittedNote ) {
291
278
if let VisibilityKind :: Inherited = vis. kind {
292
279
return ;
@@ -892,16 +879,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
892
879
self . walk_ty ( ty)
893
880
}
894
881
895
- fn visit_label ( & mut self , label : & ' a Label ) {
896
- self . check_label ( label. ident ) ;
897
- visit:: walk_label ( self , label) ;
898
- }
899
-
900
- fn visit_lifetime ( & mut self , lifetime : & ' a Lifetime , _: visit:: LifetimeCtxt ) {
901
- self . check_lifetime ( lifetime. ident ) ;
902
- visit:: walk_lifetime ( self , lifetime) ;
903
- }
904
-
905
882
fn visit_field_def ( & mut self , field : & ' a FieldDef ) {
906
883
self . deny_unnamed_field ( field) ;
907
884
visit:: walk_field_def ( self , field)
@@ -1328,13 +1305,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
1328
1305
}
1329
1306
}
1330
1307
1331
- fn visit_generic_param ( & mut self , param : & ' a GenericParam ) {
1332
- if let GenericParamKind :: Lifetime { .. } = param. kind {
1333
- self . check_lifetime ( param. ident ) ;
1334
- }
1335
- visit:: walk_generic_param ( self , param) ;
1336
- }
1337
-
1338
1308
fn visit_param_bound ( & mut self , bound : & ' a GenericBound , ctxt : BoundKind ) {
1339
1309
match bound {
1340
1310
GenericBound :: Trait ( trait_ref, modifiers) => {
0 commit comments