mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Fix string pattern matching in mir interpreter
This commit is contained in:
parent
dfaca9398a
commit
aab7589c40
6 changed files with 84 additions and 12 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue