Skip to content

Commit

Permalink
Remove usage of DUMMY_HIR_ID in CheckAttrVisitor::check_inline
Browse files Browse the repository at this point in the history
  • Loading branch information
marmeladema committed Apr 12, 2020
1 parent b4edda9 commit 502ae0e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/librustc_passes/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
use rustc_hir::DUMMY_HIR_ID;
use rustc_hir::{self, HirId, Item, ItemKind, TraitItem};
use rustc_hir::{MethodKind, Target};
use rustc_session::lint::builtin::{CONFLICTING_REPR_HINTS, UNUSED_ATTRIBUTES};
Expand Down Expand Up @@ -360,7 +359,7 @@ impl CheckAttrVisitor<'tcx> {
if let hir::StmtKind::Local(ref l) = stmt.kind {
for attr in l.attrs.iter() {
if attr.check_name(sym::inline) {
self.check_inline(DUMMY_HIR_ID, attr, &stmt.span, Target::Statement);
self.check_inline(l.hir_id, attr, &stmt.span, Target::Statement);
}
if attr.check_name(sym::repr) {
self.emit_repr_error(
Expand All @@ -381,7 +380,7 @@ impl CheckAttrVisitor<'tcx> {
};
for attr in expr.attrs.iter() {
if attr.check_name(sym::inline) {
self.check_inline(DUMMY_HIR_ID, attr, &expr.span, target);
self.check_inline(expr.hir_id, attr, &expr.span, target);
}
if attr.check_name(sym::repr) {
self.emit_repr_error(
Expand Down

0 comments on commit 502ae0e

Please sign in to comment.