Skip to content

Commit 502ae0e

Browse files
committed
Remove usage of DUMMY_HIR_ID in CheckAttrVisitor::check_inline
1 parent b4edda9 commit 502ae0e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/librustc_passes/check_attr.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use rustc_errors::struct_span_err;
1414
use rustc_hir as hir;
1515
use rustc_hir::def_id::DefId;
1616
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
17-
use rustc_hir::DUMMY_HIR_ID;
1817
use rustc_hir::{self, HirId, Item, ItemKind, TraitItem};
1918
use rustc_hir::{MethodKind, Target};
2019
use 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

Comments
 (0)