@@ -14,7 +14,6 @@ use rustc_errors::struct_span_err;
14
14
use rustc_hir as hir;
15
15
use rustc_hir:: def_id:: DefId ;
16
16
use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
17
- use rustc_hir:: DUMMY_HIR_ID ;
18
17
use rustc_hir:: { self , HirId , Item , ItemKind , TraitItem } ;
19
18
use rustc_hir:: { MethodKind , Target } ;
20
19
use rustc_session:: lint:: builtin:: { CONFLICTING_REPR_HINTS , UNUSED_ATTRIBUTES } ;
@@ -360,7 +359,7 @@ impl CheckAttrVisitor<'tcx> {
360
359
if let hir:: StmtKind :: Local ( ref l) = stmt. kind {
361
360
for attr in l. attrs . iter ( ) {
362
361
if attr. check_name ( sym:: inline) {
363
- self . check_inline ( DUMMY_HIR_ID , attr, & stmt. span , Target :: Statement ) ;
362
+ self . check_inline ( l . hir_id , attr, & stmt. span , Target :: Statement ) ;
364
363
}
365
364
if attr. check_name ( sym:: repr) {
366
365
self . emit_repr_error (
@@ -381,7 +380,7 @@ impl CheckAttrVisitor<'tcx> {
381
380
} ;
382
381
for attr in expr. attrs . iter ( ) {
383
382
if attr. check_name ( sym:: inline) {
384
- self . check_inline ( DUMMY_HIR_ID , attr, & expr. span , target) ;
383
+ self . check_inline ( expr . hir_id , attr, & expr. span , target) ;
385
384
}
386
385
if attr. check_name ( sym:: repr) {
387
386
self . emit_repr_error (
0 commit comments