}
mod autoderef;
-pub mod primitive;
-pub mod traits;
-pub mod method_resolution;
-mod op;
-mod lower;
-pub(crate) mod infer;
-pub(crate) mod utils;
-mod chalk_cast;
-mod chalk_ext;
mod builder;
-mod walk;
-mod tls;
+mod chalk_db;
+mod chalk_ext;
+mod infer;
mod interner;
+mod lower;
mod mapping;
-mod chalk_db;
-
-pub mod display;
+mod op;
+mod tls;
+mod utils;
+mod walk;
pub mod db;
pub mod diagnostics;
+pub mod display;
+pub mod method_resolution;
+pub mod primitive;
+pub mod traits;
#[cfg(test)]
mod tests;
interner::HasInterner,
UintTy,
};
-use hir_def::{expr::ExprId, type_ref::Rawness, TypeParamId};
+use hir_def::{
+ expr::ExprId,
+ type_ref::{ConstScalar, Rawness},
+ TypeParamId,
+};
use crate::{db::HirDatabase, display::HirDisplay, utils::generics};
to_foreign_def_id, to_placeholder_idx,
};
pub use traits::TraitEnvironment;
+pub use utils::all_super_traits;
pub use walk::TypeWalk;
pub use chalk_ir::{
pub type ConcreteConst = chalk_ir::ConcreteConst<Interner>;
pub type ChalkTraitId = chalk_ir::TraitId<Interner>;
+pub type TraitRef = chalk_ir::TraitRef<Interner>;
+pub type QuantifiedWhereClause = Binders<WhereClause>;
+pub type QuantifiedWhereClauses = chalk_ir::QuantifiedWhereClauses<Interner>;
+pub type Canonical<T> = chalk_ir::Canonical<T>;
pub type FnSig = chalk_ir::FnSig<Interner>;
generics(db.upcast(), id.parent).param_idx(id)
}
-pub fn wrap_empty_binders<T>(value: T) -> Binders<T>
+pub(crate) fn wrap_empty_binders<T>(value: T) -> Binders<T>
where
T: Fold<Interner, Result = T> + HasInterner<Interner = Interner>,
{
Binders::empty(&Interner, value.shifted_in_from(&Interner, DebruijnIndex::ONE))
}
-pub fn make_only_type_binders<T: HasInterner<Interner = Interner>>(
+pub(crate) fn make_only_type_binders<T: HasInterner<Interner = Interner>>(
num_vars: usize,
value: T,
) -> Binders<T> {
Canonical { value, binders: chalk_ir::CanonicalVarKinds::from_iter(&Interner, kinds) }
}
-pub type TraitRef = chalk_ir::TraitRef<Interner>;
-
-pub type QuantifiedWhereClause = Binders<WhereClause>;
-
-pub type QuantifiedWhereClauses = chalk_ir::QuantifiedWhereClauses<Interner>;
-
-pub type Canonical<T> = chalk_ir::Canonical<T>;
-
/// A function signature as seen by type inference: Several parameter types and
/// one return type.
#[derive(Clone, PartialEq, Eq, Debug)]
is_varargs: bool,
}
+has_interner!(CallableSig);
+
/// A polymorphic function signature.
pub type PolyFnSig = Binders<CallableSig>;
pub(crate) impl_traits: Vec<ReturnTypeImplTrait>,
}
+has_interner!(ReturnTypeImplTraits);
+
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
pub(crate) struct ReturnTypeImplTrait {
pub(crate) bounds: Binders<Vec<QuantifiedWhereClause>>,
let usize_ty = chalk_ir::TyKind::Scalar(Scalar::Uint(UintTy::Usize)).intern(&Interner);
chalk_ir::ConstData {
ty: usize_ty,
- value: chalk_ir::ConstValue::Concrete(chalk_ir::ConcreteConst { interned: () }),
+ value: chalk_ir::ConstValue::Concrete(chalk_ir::ConcreteConst {
+ interned: ConstScalar::Unknown,
+ }),
}
.intern(&Interner)
}