pub use self::trait_def::TraitDef;
-pub use self::maps::queries;
+pub use self::query::queries;
pub mod adjustment;
pub mod binding;
pub mod item_path;
pub mod layout;
pub mod _match;
-pub mod maps;
pub mod outlives;
+pub mod query;
pub mod relate;
pub mod steal;
pub mod subst;
/// Due to normalization being eager, this applies even if
/// the associated type is behind a pointer, e.g. issue #31299.
pub fn sized_constraint(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> &'tcx [Ty<'tcx>] {
- match tcx.try_get_query::<queries::adt_sized_constraint>(DUMMY_SP, self.did) {
+ match tcx.try_adt_sized_constraint(DUMMY_SP, self.did) {
Ok(tys) => tys,
Err(mut bug) => {
debug!("adt_sized_constraint: {:?} is recursive", self);
fn param_env<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId)
-> ParamEnv<'tcx> {
+
+ // The param_env of an existential type is its parent's param_env
+ if let Some(Def::Existential(_)) = tcx.describe_def(def_id) {
+ let parent = tcx.parent_def_id(def_id).expect("impl trait item w/o a parent");
+ return param_env(tcx, parent);
+ }
// Compute the bounds on Self and the type parameters.
let bounds = tcx.predicates_of(def_id).instantiate_identity(tcx);
}
}
-pub fn provide(providers: &mut ty::maps::Providers) {
+pub fn provide(providers: &mut ty::query::Providers) {
context::provide(providers);
erase_regions::provide(providers);
layout::provide(providers);
util::provide(providers);
- *providers = ty::maps::Providers {
+ *providers = ty::query::Providers {
associated_item,
associated_item_def_ids,
adt_sized_constraint,