don't suggest turning crate-level attributes into outer style

This commit is contained in:
yukang 2024-08-02 00:28:57 +08:00
parent 70591dc15d
commit 22aa104bce
13 changed files with 70 additions and 53 deletions

View file

@ -2898,6 +2898,17 @@ pub struct AttrItem {
pub tokens: Option<LazyAttrTokenStream>,
}
impl AttrItem {
pub fn is_valid_for_outer_style(&self) -> bool {
self.path == sym::cfg_attr
|| self.path == sym::cfg
|| self.path == sym::forbid
|| self.path == sym::warn
|| self.path == sym::allow
|| self.path == sym::deny
}
}
/// `TraitRef`s appear in impls.
///
/// Resolution maps each `TraitRef`'s `ref_id` to its defining trait; that's all