mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Merge #8409
8409: Various remaining fixes for Chalk IR move r=flodiebold a=flodiebold CC #8313 Co-authored-by: Florian Diebold <flodiebold@gmail.com>
This commit is contained in:
commit
3191a93185
15 changed files with 79 additions and 71 deletions
|
@ -41,7 +41,7 @@ use crate::{db::HirDatabase, display::HirDisplay, utils::generics};
|
|||
|
||||
pub use autoderef::autoderef;
|
||||
pub use builder::TyBuilder;
|
||||
pub use chalk_ext::{ProjectionTyExt, TyExt};
|
||||
pub use chalk_ext::*;
|
||||
pub use infer::{could_unify, InferenceResult};
|
||||
pub use lower::{
|
||||
associated_type_shorthand_candidates, callable_item_sig, CallableDefId, ImplTraitLoweringMode,
|
||||
|
@ -107,22 +107,18 @@ pub fn make_only_type_binders<T>(num_vars: usize, value: T) -> Binders<T> {
|
|||
)
|
||||
}
|
||||
|
||||
impl TraitRef {
|
||||
pub fn hir_trait_id(&self) -> TraitId {
|
||||
from_chalk_trait_id(self.trait_id)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Canonical<T> {
|
||||
pub fn new(value: T, kinds: impl IntoIterator<Item = TyVariableKind>) -> Self {
|
||||
let kinds = kinds.into_iter().map(|tk| {
|
||||
chalk_ir::CanonicalVarKind::new(
|
||||
chalk_ir::VariableKind::Ty(tk),
|
||||
chalk_ir::UniverseIndex::ROOT,
|
||||
)
|
||||
});
|
||||
Self { value, binders: chalk_ir::CanonicalVarKinds::from_iter(&Interner, kinds) }
|
||||
}
|
||||
// FIXME: get rid of this
|
||||
pub fn make_canonical<T>(
|
||||
value: T,
|
||||
kinds: impl IntoIterator<Item = TyVariableKind>,
|
||||
) -> Canonical<T> {
|
||||
let kinds = kinds.into_iter().map(|tk| {
|
||||
chalk_ir::CanonicalVarKind::new(
|
||||
chalk_ir::VariableKind::Ty(tk),
|
||||
chalk_ir::UniverseIndex::ROOT,
|
||||
)
|
||||
});
|
||||
Canonical { value, binders: chalk_ir::CanonicalVarKinds::from_iter(&Interner, kinds) }
|
||||
}
|
||||
|
||||
/// A function signature as seen by type inference: Several parameter types and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue