diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 2cb4ed2c335..163a3194435 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -3190,6 +3190,14 @@ impl Type { matches!(self.ty.kind(Interner), TyKind::Raw(..)) } + pub fn remove_raw_ptr(&self) -> Option { + if let TyKind::Raw(_, ty) = self.ty.kind(Interner) { + Some(self.derived(ty.clone())) + } else { + None + } + } + pub fn contains_unknown(&self) -> bool { // FIXME: When we get rid of `ConstScalar::Unknown`, we can just look at precomputed // `TypeFlags` in `TyData`.