Rollup merge of #128524 - chenyukang:yukang-fix-127930-invalid-outer-style-sugg, r=cjgillot
Don't suggest turning crate-level attributes into outer style Fixes #127930
This commit is contained in:
commit
dfe7d5c31e
13 changed files with 70 additions and 53 deletions
|
@ -2902,6 +2902,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue