@@ -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
@@ -2115,16 +2113,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
21152113 }
21162114 }
21172115
2118- fn check_type_const ( & self , _hir_id : HirId , attr_span : Span , target : Target ) {
2119- if matches ! ( target, Target :: AssocConst | Target :: Const ) {
2120- return ;
2121- } else {
2122- self . dcx ( )
2123- . struct_span_err ( attr_span, "`#[type_const]` must only be applied to const items" )
2124- . emit ( ) ;
2125- }
2126- }
2127-
21282116 fn check_rustc_pub_transparent ( & self , attr_span : Span , span : Span , attrs : & [ Attribute ] ) {
21292117 if !find_attr ! ( attrs, AttributeKind :: Repr { reprs, .. } => reprs. iter( ) . any( |( r, _) | r == & ReprAttr :: ReprTransparent ) )
21302118 . unwrap_or ( false )
0 commit comments