diff options
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r-- | crates/ra_hir_ty/src/unsafe_validation.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_hir_ty/src/unsafe_validation.rs b/crates/ra_hir_ty/src/unsafe_validation.rs index aad13d99c..c512c4f8e 100644 --- a/crates/ra_hir_ty/src/unsafe_validation.rs +++ b/crates/ra_hir_ty/src/unsafe_validation.rs | |||
@@ -108,13 +108,12 @@ fn walk_unsafe( | |||
108 | unsafe_exprs.push(UnsafeExpr { expr: current, inside_unsafe_block }); | 108 | unsafe_exprs.push(UnsafeExpr { expr: current, inside_unsafe_block }); |
109 | } | 109 | } |
110 | } | 110 | } |
111 | Expr::Unsafe { body: child } => { | ||
112 | return walk_unsafe(unsafe_exprs, db, infer, body, *child, true); | ||
113 | } | ||
111 | _ => {} | 114 | _ => {} |
112 | } | 115 | } |
113 | 116 | ||
114 | if let &Expr::Unsafe { body: child } = expr { | ||
115 | return walk_unsafe(unsafe_exprs, db, infer, body, child, true); | ||
116 | } | ||
117 | |||
118 | expr.walk_child_exprs(|child| { | 117 | expr.walk_child_exprs(|child| { |
119 | walk_unsafe(unsafe_exprs, db, infer, body, child, inside_unsafe_block); | 118 | walk_unsafe(unsafe_exprs, db, infer, body, child, inside_unsafe_block); |
120 | }); | 119 | }); |