mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Rename Expr::UnsafeBlock to Expr::Unsafe
This commit is contained in:
parent
278cbf12cd
commit
b9569886a9
4 changed files with 5 additions and 5 deletions
|
@ -220,7 +220,7 @@ impl ExprCollector<'_> {
|
|||
}
|
||||
ast::Effect::Unsafe(_) => {
|
||||
let body = self.collect_block_opt(e.block_expr());
|
||||
self.alloc_expr(Expr::UnsafeBlock { body }, syntax_ptr)
|
||||
self.alloc_expr(Expr::Unsafe { body }, syntax_ptr)
|
||||
}
|
||||
// FIXME: we need to record these effects somewhere...
|
||||
ast::Effect::Async(_) | ast::Effect::Label(_) => {
|
||||
|
|
|
@ -150,7 +150,7 @@ pub enum Expr {
|
|||
Tuple {
|
||||
exprs: Vec<ExprId>,
|
||||
},
|
||||
UnsafeBlock {
|
||||
Unsafe {
|
||||
body: ExprId,
|
||||
},
|
||||
Array(Array),
|
||||
|
@ -250,7 +250,7 @@ impl Expr {
|
|||
f(*expr);
|
||||
}
|
||||
}
|
||||
Expr::TryBlock { body } | Expr::UnsafeBlock { body } => f(*body),
|
||||
Expr::TryBlock { body } | Expr::Unsafe { body } => f(*body),
|
||||
Expr::Loop { body, .. } => f(*body),
|
||||
Expr::While { condition, body, .. } => {
|
||||
f(*condition);
|
||||
|
|
|
@ -340,7 +340,7 @@ pub fn unsafe_expressions(
|
|||
let expr_scopes = db.expr_scopes(def);
|
||||
for (id, expr) in body.exprs.iter() {
|
||||
match expr {
|
||||
Expr::UnsafeBlock { body } => {
|
||||
Expr::Unsafe { body } => {
|
||||
if let Some(scope) = expr_scopes.scope_for(*body) {
|
||||
unsafe_block_scopes.push(scope);
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ impl<'a> InferenceContext<'a> {
|
|||
// FIXME: Breakable block inference
|
||||
self.infer_block(statements, *tail, expected)
|
||||
}
|
||||
Expr::UnsafeBlock { body } => self.infer_expr(*body, expected),
|
||||
Expr::Unsafe { body } => self.infer_expr(*body, expected),
|
||||
Expr::TryBlock { body } => {
|
||||
let _inner = self.infer_expr(*body, expected);
|
||||
// FIXME should be std::result::Result<{inner}, _>
|
||||
|
|
Loading…
Reference in a new issue