Fix string pattern matching in mir interpreter

This commit is contained in:
hkalbasi 2023-06-02 23:45:29 +03:30
parent dfaca9398a
commit aab7589c40
6 changed files with 84 additions and 12 deletions

View file

@ -22,6 +22,7 @@ use crate::{
pub trait TyExt {
fn is_unit(&self) -> bool;
fn is_integral(&self) -> bool;
fn is_scalar(&self) -> bool;
fn is_floating_point(&self) -> bool;
fn is_never(&self) -> bool;
fn is_unknown(&self) -> bool;
@ -68,6 +69,10 @@ impl TyExt for Ty {
)
}
fn is_scalar(&self) -> bool {
matches!(self.kind(Interner), TyKind::Scalar(_))
}
fn is_floating_point(&self) -> bool {
matches!(
self.kind(Interner),