diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-06-26 15:22:15 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2021-06-26 15:28:38 +0200 |
| commit | 38569c03eb0d0917698d83aea5fbbc35acf7305c (patch) | |
| tree | aae130447f9a3f434971cfff1f1dcc021c23eb13 /clippy_utils/src | |
| parent | 3e5956339482e06dfcb8690dee9211b77aa6e218 (diff) | |
| download | rust-38569c03eb0d0917698d83aea5fbbc35acf7305c.tar.gz rust-38569c03eb0d0917698d83aea5fbbc35acf7305c.zip | |
Don't suggest unstable and doc(hidden) variants.
Diffstat (limited to 'clippy_utils/src')
| -rw-r--r-- | clippy_utils/src/attrs.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clippy_utils/src/attrs.rs b/clippy_utils/src/attrs.rs index 0318c483959..c19b558cd8c 100644 --- a/clippy_utils/src/attrs.rs +++ b/clippy_utils/src/attrs.rs @@ -157,3 +157,8 @@ pub fn is_doc_hidden(attrs: &[ast::Attribute]) -> bool { .filter_map(ast::Attribute::meta_item_list) .any(|l| attr::list_contains_name(&l, sym::hidden)) } + +/// Return true if the attributes contain `#[unstable]` +pub fn is_unstable(attrs: &[ast::Attribute]) -> bool { + attrs.iter().any(|attr| attr.has_name(sym::unstable)) +} |
