Skip to content

Commit 1f9e51c

Browse files
committed
Update rustc_hir::Attribute changes
1 parent b082560 commit 1f9e51c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/attribute.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::sync::Arc;
77
use rustc_ast::tokenstream::{self, TokenTree};
88
use rustc_ast::{token, DelimArgs};
99
use rustc_errors::{Diag, ErrorGuaranteed};
10-
use rustc_hir::{AttrArgs, AttrItem, AttrKind, Attribute, HirId};
10+
use rustc_hir::{AttrArgs, AttrItem, Attribute, HirId};
1111
use rustc_middle::ty::TyCtxt;
1212
use rustc_span::symbol::Ident;
1313
use rustc_span::Span;
@@ -351,7 +351,7 @@ impl<'tcx> AttrParser<'tcx> {
351351
..
352352
}) = &item.args
353353
else {
354-
self.error(attr.span, |diag| {
354+
self.error(attr.span(), |diag| {
355355
diag.help("correct usage looks like `#[kint::preempt_count(...)]`");
356356
})?;
357357
};
@@ -410,15 +410,15 @@ impl<'tcx> AttrParser<'tcx> {
410410
}
411411

412412
fn parse(&self, attr: &Attribute) -> Option<KlintAttribute> {
413-
let AttrKind::Normal(item) = &attr.kind else {
413+
let Attribute::Unparsed(item) = attr else {
414414
return None;
415415
};
416416
if item.path.segments[0].name != *crate::symbol::klint {
417417
return None;
418418
};
419419
if item.path.segments.len() != 2 {
420420
self.tcx
421-
.node_span_lint(crate::INCORRECT_ATTRIBUTE, self.hir_id, attr.span, |lint| {
421+
.node_span_lint(crate::INCORRECT_ATTRIBUTE, self.hir_id, item.span, |lint| {
422422
lint.primary_message("invalid klint attribute");
423423
});
424424
return None;

0 commit comments

Comments
 (0)