Skip to content

Commit 93f922a

Browse files
committed
Add note where the first definition of msrv attr is
1 parent b2e2c08 commit 93f922a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clippy_lints/src/utils/attrs.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ pub fn get_unique_inner_attr(sess: &Session, attrs: &[ast::Attribute], name: &'s
130130
match attr.style {
131131
ast::AttrStyle::Inner if unique_attr.is_none() => unique_attr = Some(attr.clone()),
132132
ast::AttrStyle::Inner => {
133-
sess.span_err(attr.span, &format!("`{}` is defined multiple times", name));
133+
sess.struct_span_err(attr.span, &format!("`{}` is defined multiple times", name))
134+
.span_note(unique_attr.as_ref().unwrap().span, "first definition found here")
135+
.emit();
134136
},
135137
ast::AttrStyle::Outer => {
136138
sess.span_err(attr.span, &format!("`{}` cannot be an outer attribute", name));

0 commit comments

Comments
 (0)