@@ -284,19 +284,6 @@ impl<'a> AstValidator<'a> {
284284 self . session . dcx ( )
285285 }
286286
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-
300287 fn visibility_not_permitted ( & self , vis : & Visibility , note : errors:: VisibilityNotPermittedNote ) {
301288 if let VisibilityKind :: Inherited = vis. kind {
302289 return ;
@@ -923,16 +910,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
923910 self . walk_ty ( ty)
924911 }
925912
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-
936913 fn visit_field_def ( & mut self , field : & ' a FieldDef ) {
937914 self . deny_unnamed_field ( field) ;
938915 visit:: walk_field_def ( self , field)
@@ -1371,13 +1348,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
13711348 }
13721349 }
13731350
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-
13811351 fn visit_param_bound ( & mut self , bound : & ' a GenericBound , ctxt : BoundKind ) {
13821352 match bound {
13831353 GenericBound :: Trait ( trait_ref, modifiers) => {
0 commit comments