@@ -222,6 +222,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
222
222
Attribute :: Parsed ( AttributeKind :: Used { span : attr_span, .. } ) => {
223
223
self . check_used ( * attr_span, target, span) ;
224
224
}
225
+ & Attribute :: Parsed ( AttributeKind :: StdInternalSymbol ( attr_span) ) => {
226
+ self . check_rustc_std_internal_symbol ( attr_span, span, target)
227
+ }
225
228
Attribute :: Unparsed ( attr_item) => {
226
229
style = Some ( attr_item. style ) ;
227
230
match attr. path ( ) . as_slice ( ) {
@@ -248,9 +251,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
248
251
) ,
249
252
[ sym:: no_link, ..] => self . check_no_link ( hir_id, attr, span, target) ,
250
253
[ sym:: debugger_visualizer, ..] => self . check_debugger_visualizer ( attr, target) ,
251
- [ sym:: rustc_std_internal_symbol, ..] => {
252
- self . check_rustc_std_internal_symbol ( attr, span, target)
253
- }
254
254
[ sym:: rustc_no_implicit_autorefs, ..] => {
255
255
self . check_applied_to_fn_or_method ( hir_id, attr. span ( ) , span, target)
256
256
}
@@ -2189,13 +2189,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
2189
2189
}
2190
2190
}
2191
2191
2192
- fn check_rustc_std_internal_symbol ( & self , attr : & Attribute , span : Span , target : Target ) {
2192
+ fn check_rustc_std_internal_symbol ( & self , attr_span : Span , span : Span , target : Target ) {
2193
2193
match target {
2194
2194
Target :: Fn | Target :: Static | Target :: ForeignFn | Target :: ForeignStatic => { }
2195
2195
_ => {
2196
- self . tcx
2197
- . dcx ( )
2198
- . emit_err ( errors:: RustcStdInternalSymbol { attr_span : attr. span ( ) , span } ) ;
2196
+ self . tcx . dcx ( ) . emit_err ( errors:: RustcStdInternalSymbol { attr_span, span } ) ;
2199
2197
}
2200
2198
}
2201
2199
}
0 commit comments