Remove usage of DUMMY_HIR_ID
in CheckAttrVisitor::check_inline
This commit is contained in:
parent
b4edda9849
commit
502ae0e898
@ -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};
|
||||
@ -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(
|
||||
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user