Rename Expr::UnsafeBlock to Expr::Unsafe

This commit is contained in:
Paul Daniel Faria 2020-05-24 16:28:02 -04:00
parent 278cbf12cd
commit b9569886a9
4 changed files with 5 additions and 5 deletions

View file

@ -220,7 +220,7 @@ impl ExprCollector<'_> {
} }
ast::Effect::Unsafe(_) => { ast::Effect::Unsafe(_) => {
let body = self.collect_block_opt(e.block_expr()); 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... // FIXME: we need to record these effects somewhere...
ast::Effect::Async(_) | ast::Effect::Label(_) => { ast::Effect::Async(_) | ast::Effect::Label(_) => {

View file

@ -150,7 +150,7 @@ pub enum Expr {
Tuple { Tuple {
exprs: Vec<ExprId>, exprs: Vec<ExprId>,
}, },
UnsafeBlock { Unsafe {
body: ExprId, body: ExprId,
}, },
Array(Array), Array(Array),
@ -250,7 +250,7 @@ impl Expr {
f(*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::Loop { body, .. } => f(*body),
Expr::While { condition, body, .. } => { Expr::While { condition, body, .. } => {
f(*condition); f(*condition);

View file

@ -340,7 +340,7 @@ pub fn unsafe_expressions(
let expr_scopes = db.expr_scopes(def); let expr_scopes = db.expr_scopes(def);
for (id, expr) in body.exprs.iter() { for (id, expr) in body.exprs.iter() {
match expr { match expr {
Expr::UnsafeBlock { body } => { Expr::Unsafe { body } => {
if let Some(scope) = expr_scopes.scope_for(*body) { if let Some(scope) = expr_scopes.scope_for(*body) {
unsafe_block_scopes.push(scope); unsafe_block_scopes.push(scope);
} }

View file

@ -142,7 +142,7 @@ impl<'a> InferenceContext<'a> {
// FIXME: Breakable block inference // FIXME: Breakable block inference
self.infer_block(statements, *tail, expected) 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 } => { Expr::TryBlock { body } => {
let _inner = self.infer_expr(*body, expected); let _inner = self.infer_expr(*body, expected);
// FIXME should be std::result::Result<{inner}, _> // FIXME should be std::result::Result<{inner}, _>