Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/consts.rs')
| -rw-r--r-- | crates/hir-ty/src/next_solver/consts.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/crates/hir-ty/src/next_solver/consts.rs b/crates/hir-ty/src/next_solver/consts.rs index da86fa3ae5..2fc1fc4f45 100644 --- a/crates/hir-ty/src/next_solver/consts.rs +++ b/crates/hir-ty/src/next_solver/consts.rs @@ -7,8 +7,8 @@ use intern::{Interned, Symbol}; use macros::{TypeFoldable, TypeVisitable}; use rustc_ast_ir::{try_visit, visit::VisitorResult}; use rustc_type_ir::{ - BoundVar, FlagComputation, Flags, TypeFoldable, TypeSuperFoldable, TypeSuperVisitable, - TypeVisitable, TypeVisitableExt, WithCachedTypeInfo, + BoundVar, DebruijnIndex, FlagComputation, Flags, TypeFoldable, TypeSuperFoldable, + TypeSuperVisitable, TypeVisitable, TypeVisitableExt, WithCachedTypeInfo, inherent::{IntoKind, ParamEnv as _, PlaceholderLike, SliceLike}, relate::Relate, }; @@ -62,6 +62,10 @@ impl<'db> Const<'db> { Const::new(interner, ConstKind::Placeholder(placeholder)) } + pub fn new_bound(interner: DbInterner<'db>, index: DebruijnIndex, bound: BoundConst) -> Self { + Const::new(interner, ConstKind::Bound(index, bound)) + } + pub fn new_valtree( interner: DbInterner<'db>, ty: Ty<'db>, @@ -159,11 +163,11 @@ impl ParamConst { /// Represents a typed, fully evaluated constant. #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, TypeFoldable, TypeVisitable)] pub struct ValueConst<'db> { - pub(crate) ty: Ty<'db>, + pub ty: Ty<'db>, // FIXME: Should we ignore this for TypeVisitable, TypeFoldable? #[type_visitable(ignore)] #[type_foldable(identity)] - pub(crate) value: Valtree<'db>, + pub value: Valtree<'db>, } impl<'db> ValueConst<'db> { |