Use Cast::cast() instead of interning GenericArgData

This commit is contained in:
Ryo Yoshida 2023-08-09 00:47:29 +09:00
parent 783130bd26
commit 6aa03c5d15
No known key found for this signature in database
GPG key ID: E25698A930586171
7 changed files with 45 additions and 73 deletions

View file

@ -1,7 +1,7 @@
//! Constant evaluation details
use base_db::CrateId;
use chalk_ir::{BoundVar, DebruijnIndex, GenericArgData};
use chalk_ir::{cast::Cast, BoundVar, DebruijnIndex};
use hir_def::{
hir::Expr,
path::Path,
@ -120,7 +120,7 @@ pub fn unknown_const(ty: Ty) -> Const {
}
pub fn unknown_const_as_generic(ty: Ty) -> GenericArg {
GenericArgData::Const(unknown_const(ty)).intern(Interner)
unknown_const(ty).cast(Interner)
}
/// Interns a constant scalar with the given type