diff options
| author | Michael Goulet <michael@errs.io> | 2024-02-16 15:07:32 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-02-16 15:07:37 +0000 |
| commit | f624d55ea77b1b24e9294818ee1d6b1da9d0ec2d (patch) | |
| tree | 73c756a8874ee51120d6acf61fc6c32904d26ba9 /compiler/rustc_macros/src | |
| parent | a9dbf63087049549a74c0f31705df92bcf15098f (diff) | |
| download | rust-f624d55ea77b1b24e9294818ee1d6b1da9d0ec2d.tar.gz rust-f624d55ea77b1b24e9294818ee1d6b1da9d0ec2d.zip | |
Nits
Diffstat (limited to 'compiler/rustc_macros/src')
| -rw-r--r-- | compiler/rustc_macros/src/extension.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_macros/src/extension.rs b/compiler/rustc_macros/src/extension.rs index 7830137f218..5377bbdfeab 100644 --- a/compiler/rustc_macros/src/extension.rs +++ b/compiler/rustc_macros/src/extension.rs @@ -68,7 +68,14 @@ pub(crate) fn extension( /// Only keep `#[doc]` attrs. fn scrub_attrs(attrs: &[Attribute]) -> Vec<Attribute> { - attrs.into_iter().cloned().filter(|attr| attr.path().segments[0].ident == "doc").collect() + attrs + .into_iter() + .cloned() + .filter(|attr| { + let ident = &attr.path().segments[0].ident; + ident == "doc" || ident == "must_use" + }) + .collect() } /// Scrub arguments so that they're valid for trait signatures. |
