Skip to content

Commit 5c25ff5

Browse files
committed
rustc_macros: Reduce scope of span in from_attr()
1 parent 4a9fc48 commit 5c25ff5

File tree

1 file changed

+2
-2
lines changed
  • compiler/rustc_macros/src/diagnostics

1 file changed

+2
-2
lines changed

compiler/rustc_macros/src/diagnostics/utils.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,6 @@ impl SubdiagnosticVariant {
616616
return Ok(None);
617617
}
618618

619-
let span = attr.span().unwrap();
620-
621619
let name = attr.path().segments.last().unwrap().ident.to_string();
622620
let name = name.as_str();
623621

@@ -667,6 +665,8 @@ impl SubdiagnosticVariant {
667665
}
668666
};
669667

668+
let span = attr.span().unwrap();
669+
670670
let list = match &attr.meta {
671671
Meta::List(list) => {
672672
// An attribute with properties, such as `#[suggestion(code = "...")]` or

0 commit comments

Comments
 (0)