@@ -10,7 +10,7 @@ use std::collections::hash_map::Entry;
10
10
use std:: slice;
11
11
12
12
use 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} ;
14
14
use rustc_attr_parsing:: { AttributeParser , Late } ;
15
15
use rustc_data_structures:: fx:: FxHashMap ;
16
16
use rustc_errors:: { Applicability , DiagCtxtHandle , IntoDiagArg , MultiSpan , StashKey } ;
@@ -245,8 +245,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
245
245
| AttributeKind :: PassByValue ( ..)
246
246
| AttributeKind :: StdInternalSymbol ( ..)
247
247
| AttributeKind :: Coverage ( ..)
248
- | AttributeKind :: ShouldPanic
249
- | AttributeKind :: Coroutine , //TODO
248
+ | AttributeKind :: ShouldPanic { .. }
249
+ | AttributeKind :: Coroutine ( .. ) ,
250
250
) => { /* do nothing */ }
251
251
252
252
Attribute :: Unparsed ( attr_item) => {
@@ -513,28 +513,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
513
513
}
514
514
}
515
515
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
-
538
516
/// Checks if `#[naked]` is applied to a function definition.
539
517
fn check_naked ( & self , hir_id : HirId , target : Target ) {
540
518
match target {
@@ -2002,15 +1980,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
2002
1980
}
2003
1981
}
2004
1982
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
-
2014
1983
fn check_type_const ( & self , hir_id : HirId , attr_span : Span , target : Target ) {
2015
1984
let tcx = self . tcx ;
2016
1985
if target == Target :: AssocConst
0 commit comments