Skip to content

Commit 69a70e4

Browse files
committed
Fix attribute checking
Following rust-lang/rust#135726
1 parent f7185c4 commit 69a70e4

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

compiler/src/passes/instr/decision.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ fn find_inheritable_first_filtered<'tcx>(
152152
/// If the attribute is not found, or the argument passed to the attribute is invalid
153153
/// returns `None`.
154154
fn opt_instrument_attr<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Option<bool> {
155-
use rustc_hir::{AttrArgs, AttrKind};
155+
use rustc_hir::{AttrArgs, Attribute};
156156
// Avoid possibly problematic const items.
157157
// See https://github.com/rust-lang/rust/issues/128145
158158
if matches!(
@@ -162,13 +162,13 @@ fn opt_instrument_attr<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> Option<bool> {
162162
return None;
163163
}
164164

165-
tcx.get_attrs_by_path(def_id, &[
166-
Symbol::intern(TOOL_NAME),
167-
Symbol::intern(ATTR_NAME),
168-
])
165+
tcx.get_attrs_by_path(
166+
def_id,
167+
&[Symbol::intern(TOOL_NAME), Symbol::intern(ATTR_NAME)],
168+
)
169169
.next()
170-
.and_then(|attr| match &attr.kind {
171-
AttrKind::Normal(attr) => Some(attr),
170+
.and_then(|attr| match attr {
171+
Attribute::Unparsed(attr) => Some(attr),
172172
_ => None,
173173
})
174174
.and_then(|attr| match &attr.args {

0 commit comments

Comments
 (0)