@@ -150,9 +150,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
150150 Attribute :: Parsed ( AttributeKind :: ProcMacroDerive { .. } ) => {
151151 self . check_proc_macro ( hir_id, target, ProcMacroKind :: Derive )
152152 }
153- & Attribute :: Parsed ( AttributeKind :: TypeConst ( attr_span) ) => {
154- self . check_type_const ( hir_id, attr_span, target)
155- }
156153 Attribute :: Parsed (
157154 AttributeKind :: Stability {
158155 span : attr_span,
@@ -243,6 +240,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
243240 | AttributeKind :: ParenSugar ( ..)
244241 | AttributeKind :: AllowIncoherentImpl ( ..)
245242 | AttributeKind :: Confusables { .. }
243+ | AttributeKind :: TypeConst { ..}
246244 // `#[doc]` is actually a lot more than just doc comments, so is checked below
247245 | AttributeKind :: DocComment { ..}
248246 // handled below this loop and elsewhere
@@ -2102,16 +2100,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
21022100 }
21032101 }
21042102
2105- fn check_type_const ( & self , _hir_id : HirId , attr_span : Span , target : Target ) {
2106- if matches ! ( target, Target :: AssocConst | Target :: Const ) {
2107- return ;
2108- } else {
2109- self . dcx ( )
2110- . struct_span_err ( attr_span, "`#[type_const]` must only be applied to const items" )
2111- . emit ( ) ;
2112- }
2113- }
2114-
21152103 fn check_rustc_pub_transparent ( & self , attr_span : Span , span : Span , attrs : & [ Attribute ] ) {
21162104 if !find_attr ! ( attrs, AttributeKind :: Repr { reprs, .. } => reprs. iter( ) . any( |( r, _) | r == & ReprAttr :: ReprTransparent ) )
21172105 . unwrap_or ( false )
0 commit comments