@@ -14,7 +14,6 @@ use rustc_errors::struct_span_err;
1414use rustc_hir as hir;
1515use rustc_hir:: def_id:: DefId ;
1616use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
17- use rustc_hir:: DUMMY_HIR_ID ;
1817use rustc_hir:: { self , HirId , Item , ItemKind , TraitItem } ;
1918use rustc_hir:: { MethodKind , Target } ;
2019use rustc_session:: lint:: builtin:: { CONFLICTING_REPR_HINTS , UNUSED_ATTRIBUTES } ;
@@ -360,7 +359,7 @@ impl CheckAttrVisitor<'tcx> {
360359 if let hir:: StmtKind :: Local ( ref l) = stmt. kind {
361360 for attr in l. attrs . iter ( ) {
362361 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 ) ;
364363 }
365364 if attr. check_name ( sym:: repr) {
366365 self . emit_repr_error (
@@ -381,7 +380,7 @@ impl CheckAttrVisitor<'tcx> {
381380 } ;
382381 for attr in expr. attrs . iter ( ) {
383382 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) ;
385384 }
386385 if attr. check_name ( sym:: repr) {
387386 self . emit_repr_error (
0 commit comments