don't suggest turning crate-level attributes into outer style
This commit is contained in:
parent
70591dc15d
commit
22aa104bce
13 changed files with 70 additions and 53 deletions
|
@ -439,11 +439,16 @@ impl<'a> Parser<'a> {
|
|||
pub fn parse_block(&mut self) -> PResult<'a, P<Block>> {
|
||||
let (attrs, block) = self.parse_inner_attrs_and_block()?;
|
||||
if let [.., last] = &*attrs {
|
||||
let suggest_to_outer = match &last.kind {
|
||||
ast::AttrKind::Normal(attr) => attr.item.is_valid_for_outer_style(),
|
||||
_ => false,
|
||||
};
|
||||
self.error_on_forbidden_inner_attr(
|
||||
last.span,
|
||||
super::attr::InnerAttrPolicy::Forbidden(Some(
|
||||
InnerAttrForbiddenReason::InCodeBlock,
|
||||
)),
|
||||
suggest_to_outer,
|
||||
);
|
||||
}
|
||||
Ok(block)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue