aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/body
diff options
context:
space:
mode:
authorPaul Daniel Faria <[email protected]>2020-05-24 21:24:36 +0100
committerPaul Daniel Faria <[email protected]>2020-06-27 15:10:26 +0100
commit278cbf12cd0f76fc191d5ce7f130e6245596a578 (patch)
tree7c00307fbef82b45cbd0072a45819ea962bf8900 /crates/ra_hir_def/src/body
parent3df0f9ce7e6eea48b67dae8b26e83aa7bd36ff24 (diff)
Track unsafe blocks, don't trigger missing unsafe diagnostic when unsafe exprs within unsafe block
Diffstat (limited to 'crates/ra_hir_def/src/body')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index a7e2e0982..174bbf9f4 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -218,8 +218,12 @@ impl ExprCollector<'_> {
218 let body = self.collect_block_opt(e.block_expr()); 218 let body = self.collect_block_opt(e.block_expr());
219 self.alloc_expr(Expr::TryBlock { body }, syntax_ptr) 219 self.alloc_expr(Expr::TryBlock { body }, syntax_ptr)
220 } 220 }
221 ast::Effect::Unsafe(_) => {
222 let body = self.collect_block_opt(e.block_expr());
223 self.alloc_expr(Expr::UnsafeBlock { body }, syntax_ptr)
224 }
221 // FIXME: we need to record these effects somewhere... 225 // FIXME: we need to record these effects somewhere...
222 ast::Effect::Async(_) | ast::Effect::Label(_) | ast::Effect::Unsafe(_) => { 226 ast::Effect::Async(_) | ast::Effect::Label(_) => {
223 self.collect_block_opt(e.block_expr()) 227 self.collect_block_opt(e.block_expr())
224 } 228 }
225 }, 229 },