We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
raw_ptr
1 parent 4e29820 commit 9a481d1Copy full SHA for 9a481d1
crates/hir/src/lib.rs
@@ -3190,6 +3190,14 @@ impl Type {
3190
matches!(self.ty.kind(Interner), TyKind::Raw(..))
3191
}
3192
3193
+ pub fn as_raw_ptr_ty(&self) -> Option<Type> {
3194
+ if let TyKind::Raw(_, ty) = self.ty.kind(Interner) {
3195
+ Some(self.derived(ty.clone()))
3196
+ } else {
3197
+ None
3198
+ }
3199
3200
+
3201
pub fn contains_unknown(&self) -> bool {
3202
// FIXME: When we get rid of `ConstScalar::Unknown`, we can just look at precomputed
3203
// `TypeFlags` in `TyData`.
0 commit comments