From 6c32bbf3ca5980fb33c1ea28dd1c5a1524ce81cb Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 13 Mar 2021 14:44:51 +0100 Subject: Separate `Ty` and `TyKind` like in Chalk Currently `Ty` just wraps `TyKind`, but this allows us to change most places to already use `intern` / `interned`. --- crates/hir_ty/src/diagnostics/unsafe_check.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/diagnostics/unsafe_check.rs') diff --git a/crates/hir_ty/src/diagnostics/unsafe_check.rs b/crates/hir_ty/src/diagnostics/unsafe_check.rs index e77a20fea..e095bee28 100644 --- a/crates/hir_ty/src/diagnostics/unsafe_check.rs +++ b/crates/hir_ty/src/diagnostics/unsafe_check.rs @@ -11,7 +11,7 @@ use hir_def::{ }; use hir_expand::diagnostics::DiagnosticSink; -use crate::{db::HirDatabase, diagnostics::MissingUnsafe, InferenceResult, Ty}; +use crate::{db::HirDatabase, diagnostics::MissingUnsafe, InferenceResult, Interner, TyKind}; pub(super) struct UnsafeValidator<'a, 'b: 'a> { owner: DefWithBodyId, @@ -110,7 +110,7 @@ fn walk_unsafe( } } Expr::UnaryOp { expr, op: UnaryOp::Deref } => { - if let Ty::Raw(..) = &infer[*expr] { + if let TyKind::Raw(..) = &infer[*expr].interned(&Interner) { unsafe_exprs.push(UnsafeExpr { expr: current, inside_unsafe_block }); } } -- cgit v1.2.3