fix: false positive about inner attrs in docs

closes #8541
This commit is contained in:
Aleksey Kladov 2021-04-19 17:11:49 +03:00
parent e4f7f1e1bd
commit 5f89a60f1a
6 changed files with 238 additions and 182 deletions

View file

@ -13,7 +13,7 @@ pub(crate) fn validate_block_expr(block: ast::BlockExpr, errors: &mut Vec<Syntax
_ => {}
}
}
errors.extend(block.attrs().map(|attr| {
errors.extend(block.attrs().filter(|attr| attr.kind().is_inner()).map(|attr| {
SyntaxError::new(
"A block in this position cannot accept inner attributes",
attr.syntax().text_range(),