mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Merge commit '9b3d03408c
' into sync-from-ra
This commit is contained in:
parent
883f16d805
commit
30d8aa1bec
136 changed files with 3865 additions and 1451 deletions
|
@ -61,6 +61,14 @@ impl ast::BlockExpr {
|
|||
pub fn tail_expr(&self) -> Option<ast::Expr> {
|
||||
self.stmt_list()?.tail_expr()
|
||||
}
|
||||
/// Block expressions accept outer and inner attributes, but only when they are the outer
|
||||
/// expression of an expression statement or the final expression of another block expression.
|
||||
pub fn may_carry_attributes(&self) -> bool {
|
||||
matches!(
|
||||
self.syntax().parent().map(|it| it.kind()),
|
||||
Some(SyntaxKind::BLOCK_EXPR | SyntaxKind::EXPR_STMT)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue