Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: inline const as literal #14925

Merged
merged 4 commits into from Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/hir/src/lib.rs
Expand Up @@ -3494,6 +3494,14 @@ impl Type {
}
}

pub fn is_scalar(&self) -> bool {
matches!(self.ty.kind(Interner), TyKind::Scalar(_))
}

pub fn is_tuple(&self) -> bool {
matches!(self.ty.kind(Interner), TyKind::Tuple(..))
}

pub fn remove_ref(&self) -> Option<Type> {
match &self.ty.kind(Interner) {
TyKind::Ref(.., ty) => Some(self.derived(ty.clone())),
Expand Down