@@ -154,6 +154,14 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
154
154
Attribute :: Parsed ( AttributeKind :: AsPtr ( attr_span) ) => {
155
155
self . check_applied_to_fn_or_method ( hir_id, * attr_span, span, target)
156
156
}
157
+ & Attribute :: Parsed ( AttributeKind :: PubTransparent ( attr_span) ) => {
158
+ if !find_attr ! (
159
+ attrs,
160
+ AttributeKind :: Repr ( r) => r. iter( ) . any( |( r, _) | r == & ReprAttr :: ReprTransparent )
161
+ ) . unwrap_or ( false ) {
162
+ self . dcx ( ) . emit_err ( errors:: RustcPubTransparent { span, attr_span } ) ;
163
+ }
164
+ }
157
165
Attribute :: Unparsed ( _) => {
158
166
match attr. path ( ) . as_slice ( ) {
159
167
[ sym:: diagnostic, sym:: do_not_recommend, ..] => {
@@ -279,7 +287,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
279
287
self . check_type_const ( hir_id, attr, target) ;
280
288
}
281
289
[ sym:: linkage, ..] => self . check_linkage ( attr, span, target) ,
282
- [ sym:: rustc_pub_transparent, ..] => self . check_rustc_pub_transparent ( attr. span ( ) , span, attrs) ,
283
290
[
284
291
// ok
285
292
sym:: allow
@@ -2643,14 +2650,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
2643
2650
}
2644
2651
}
2645
2652
2646
- fn check_rustc_pub_transparent ( & self , attr_span : Span , span : Span , attrs : & [ Attribute ] ) {
2647
- if !find_attr ! ( attrs, AttributeKind :: Repr ( r) => r. iter( ) . any( |( r, _) | r == & ReprAttr :: ReprTransparent ) )
2648
- . unwrap_or ( false )
2649
- {
2650
- self . dcx ( ) . emit_err ( errors:: RustcPubTransparent { span, attr_span } ) ;
2651
- }
2652
- }
2653
-
2654
2653
fn check_rustc_force_inline (
2655
2654
& self ,
2656
2655
hir_id : HirId ,
0 commit comments