File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,11 @@ impl Attribute {
175
175
176
176
/// Returns `true` if the attribute's path matches the argument.
177
177
/// If it matches, then the attribute is marked as used.
178
- /// Should only be used by rustc, other tools can use `has_name` instead.
178
+ /// Should only be used by rustc, other tools can use `has_name` instead,
179
+ /// because only rustc is supposed to report the `unused_attributes` lint.
180
+ /// `MetaItem` and `NestedMetaItem` are produced by "lowering" an `Attribute`
181
+ /// and don't have identity, so they only has the `has_name` method,
182
+ /// and you need to mark the original `Attribute` as used when necessary.
179
183
pub fn check_name ( & self , name : Symbol ) -> bool {
180
184
let matches = self . has_name ( name) ;
181
185
if matches {
You can’t perform that action at this time.
0 commit comments