mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Track unsafe blocks, don't trigger missing unsafe diagnostic when unsafe exprs within unsafe block
This commit is contained in:
parent
3df0f9ce7e
commit
278cbf12cd
7 changed files with 82 additions and 19 deletions
|
@ -150,6 +150,9 @@ pub enum Expr {
|
|||
Tuple {
|
||||
exprs: Vec<ExprId>,
|
||||
},
|
||||
UnsafeBlock {
|
||||
body: ExprId,
|
||||
},
|
||||
Array(Array),
|
||||
Literal(Literal),
|
||||
}
|
||||
|
@ -247,7 +250,7 @@ impl Expr {
|
|||
f(*expr);
|
||||
}
|
||||
}
|
||||
Expr::TryBlock { body } => f(*body),
|
||||
Expr::TryBlock { body } | Expr::UnsafeBlock { body } => f(*body),
|
||||
Expr::Loop { body, .. } => f(*body),
|
||||
Expr::While { condition, body, .. } => {
|
||||
f(*condition);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue