diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-12 15:50:37 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-12 15:50:37 +0100 |
commit | 10ca6b286c6f763f0d2a44bc551139f64549938e (patch) | |
tree | fcf4b661c6f656229e1e598ae3798705780ead39 /crates/hir_ty/src | |
parent | f9e67d692d915b326bd20a4c487039ade377029b (diff) | |
parent | 6f0141a14026827edfe4ef046013001acd22d94d (diff) |
Merge #9231
9231: minor: optimize r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/hir_ty/src')
-rw-r--r-- | crates/hir_ty/src/diagnostics/unsafe_check.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/hir_ty/src/diagnostics/unsafe_check.rs b/crates/hir_ty/src/diagnostics/unsafe_check.rs index a4054cef9..777f347b8 100644 --- a/crates/hir_ty/src/diagnostics/unsafe_check.rs +++ b/crates/hir_ty/src/diagnostics/unsafe_check.rs | |||
@@ -13,7 +13,6 @@ use crate::{db::HirDatabase, InferenceResult, Interner, TyExt, TyKind}; | |||
13 | pub fn missing_unsafe(db: &dyn HirDatabase, def: DefWithBodyId) -> Vec<ExprId> { | 13 | pub fn missing_unsafe(db: &dyn HirDatabase, def: DefWithBodyId) -> Vec<ExprId> { |
14 | let infer = db.infer(def); | 14 | let infer = db.infer(def); |
15 | 15 | ||
16 | // let unsafe_expressions = ; | ||
17 | let is_unsafe = match def { | 16 | let is_unsafe = match def { |
18 | DefWithBodyId::FunctionId(it) => db.function_data(it).is_unsafe(), | 17 | DefWithBodyId::FunctionId(it) => db.function_data(it).is_unsafe(), |
19 | DefWithBodyId::StaticId(_) | DefWithBodyId::ConstId(_) => false, | 18 | DefWithBodyId::StaticId(_) | DefWithBodyId::ConstId(_) => false, |
@@ -29,12 +28,12 @@ pub fn missing_unsafe(db: &dyn HirDatabase, def: DefWithBodyId) -> Vec<ExprId> { | |||
29 | .collect() | 28 | .collect() |
30 | } | 29 | } |
31 | 30 | ||
32 | pub(crate) struct UnsafeExpr { | 31 | struct UnsafeExpr { |
33 | pub(crate) expr: ExprId, | 32 | pub(crate) expr: ExprId, |
34 | pub(crate) inside_unsafe_block: bool, | 33 | pub(crate) inside_unsafe_block: bool, |
35 | } | 34 | } |
36 | 35 | ||
37 | pub(crate) fn unsafe_expressions( | 36 | fn unsafe_expressions( |
38 | db: &dyn HirDatabase, | 37 | db: &dyn HirDatabase, |
39 | infer: &InferenceResult, | 38 | infer: &InferenceResult, |
40 | def: DefWithBodyId, | 39 | def: DefWithBodyId, |