@@ -10,7 +10,7 @@ use std::collections::hash_map::Entry;
1010use std:: slice;
1111
1212use rustc_abi:: { Align , ExternAbi , Size } ;
13- use rustc_ast:: { AttrStyle , LitKind , MetaItemInner , MetaItemKind , ast, join_path_syms } ;
13+ use rustc_ast:: { AttrStyle , LitKind , MetaItemInner , MetaItemKind , ast} ;
1414use rustc_attr_parsing:: { AttributeParser , Late } ;
1515use rustc_data_structures:: fx:: FxHashMap ;
1616use rustc_errors:: { Applicability , DiagCtxtHandle , IntoDiagArg , MultiSpan , StashKey } ;
@@ -245,8 +245,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
245245 | AttributeKind :: PassByValue ( ..)
246246 | AttributeKind :: StdInternalSymbol ( ..)
247247 | AttributeKind :: Coverage ( ..)
248- | AttributeKind :: ShouldPanic
249- | AttributeKind :: Coroutine , //TODO
248+ | AttributeKind :: ShouldPanic { .. }
249+ | AttributeKind :: Coroutine ( .. ) ,
250250 ) => { /* do nothing */ }
251251
252252 Attribute :: Unparsed ( attr_item) => {
@@ -513,28 +513,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
513513 }
514514 }
515515
516- /// FIXME: Remove when all attributes are ported to the new parser
517- fn check_generic_attr_unparsed (
518- & self ,
519- hir_id : HirId ,
520- attr : & Attribute ,
521- target : Target ,
522- allowed_target : Target ,
523- ) {
524- if target != allowed_target {
525- let attr_name = join_path_syms ( attr. path ( ) ) ;
526- self . tcx . emit_node_span_lint (
527- UNUSED_ATTRIBUTES ,
528- hir_id,
529- attr. span ( ) ,
530- errors:: OnlyHasEffectOn {
531- attr_name,
532- target_name : allowed_target. plural_name ( ) . to_string ( ) ,
533- } ,
534- ) ;
535- }
536- }
537-
538516 /// Checks if `#[naked]` is applied to a function definition.
539517 fn check_naked ( & self , hir_id : HirId , target : Target ) {
540518 match target {
@@ -2002,15 +1980,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
20021980 }
20031981 }
20041982
2005- fn check_coroutine ( & self , attr_span : Span , target : Target ) {
2006- match target {
2007- Target :: Closure => return ,
2008- _ => {
2009- self . dcx ( ) . emit_err ( errors:: CoroutineOnNonClosure { span : attr_span } ) ;
2010- }
2011- }
2012- }
2013-
20141983 fn check_type_const ( & self , hir_id : HirId , attr_span : Span , target : Target ) {
20151984 let tcx = self . tcx ;
20161985 if target == Target :: AssocConst
0 commit comments