@@ -274,19 +274,6 @@ impl<'a> AstValidator<'a> {
274274 self . session . dcx ( )
275275 }
276276
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-
290277 fn visibility_not_permitted ( & self , vis : & Visibility , note : errors:: VisibilityNotPermittedNote ) {
291278 if let VisibilityKind :: Inherited = vis. kind {
292279 return ;
@@ -892,16 +879,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
892879 self . walk_ty ( ty)
893880 }
894881
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-
905882 fn visit_field_def ( & mut self , field : & ' a FieldDef ) {
906883 self . deny_unnamed_field ( field) ;
907884 visit:: walk_field_def ( self , field)
@@ -1328,13 +1305,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
13281305 }
13291306 }
13301307
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-
13381308 fn visit_param_bound ( & mut self , bound : & ' a GenericBound , ctxt : BoundKind ) {
13391309 match bound {
13401310 GenericBound :: Trait ( trait_ref, modifiers) => {
0 commit comments