@@ -150,6 +150,14 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
150
150
Attribute :: Parsed ( AttributeKind :: AsPtr ( attr_span) ) => {
151
151
self . check_applied_to_fn_or_method ( hir_id, * attr_span, span, target)
152
152
}
153
+ & Attribute :: Parsed ( AttributeKind :: PubTransparent ( attr_span) ) => {
154
+ if !find_attr ! (
155
+ attrs,
156
+ AttributeKind :: Repr ( r) => r. iter( ) . any( |( r, _) | r == & ReprAttr :: ReprTransparent )
157
+ ) . unwrap_or ( false ) {
158
+ self . dcx ( ) . emit_err ( errors:: RustcPubTransparent { span, attr_span } ) ;
159
+ }
160
+ }
153
161
Attribute :: Unparsed ( _) => {
154
162
match attr. path ( ) . as_slice ( ) {
155
163
[ sym:: diagnostic, sym:: do_not_recommend, ..] => {
@@ -276,7 +284,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
276
284
self . check_type_const ( hir_id, attr, target) ;
277
285
}
278
286
[ sym:: linkage, ..] => self . check_linkage ( attr, span, target) ,
279
- [ sym:: rustc_pub_transparent, ..] => self . check_rustc_pub_transparent ( attr. span ( ) , span, attrs) ,
280
287
[
281
288
// ok
282
289
sym:: allow
@@ -2623,14 +2630,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
2623
2630
}
2624
2631
}
2625
2632
2626
- fn check_rustc_pub_transparent ( & self , attr_span : Span , span : Span , attrs : & [ Attribute ] ) {
2627
- if !find_attr ! ( attrs, AttributeKind :: Repr ( r) => r. iter( ) . any( |( r, _) | r == & ReprAttr :: ReprTransparent ) )
2628
- . unwrap_or ( false )
2629
- {
2630
- self . dcx ( ) . emit_err ( errors:: RustcPubTransparent { span, attr_span } ) ;
2631
- }
2632
- }
2633
-
2634
2633
fn check_rustc_force_inline (
2635
2634
& self ,
2636
2635
hir_id : HirId ,
0 commit comments