// required that their size stay the same, but we don't want to change
// it inadvertently. This assert just ensures we're aware of any change.
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
-static_assert_size!(DepNode, 18);
+static_assert_size!(DepNode, 17);
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
static_assert_size!(DepNode, 24);
desc { |tcx| "elaborating item bounds for `{}`", tcx.def_path_str(key) }
}
- query projection_ty_from_predicates(key: (DefId, DefId)) -> Option<ty::ProjectionTy<'tcx>> {
- desc { |tcx| "finding projection type inside predicates of `{}`", tcx.def_path_str(key.0) }
- }
-
query native_libraries(_: CrateNum) -> Lrc<Vec<NativeLib>> {
desc { "looking up the native libraries of a linked crate" }
}
generics_of,
predicates_of,
predicates_defined_on,
- projection_ty_from_predicates,
explicit_predicates_of,
super_predicates_of,
super_predicates_that_define_assoc_type,
}
}
-fn projection_ty_from_predicates(
- tcx: TyCtxt<'tcx>,
- key: (
- // ty_def_id
- DefId,
- // def_id of `N` in `<T as Trait>::N`
- DefId,
- ),
-) -> Option<ty::ProjectionTy<'tcx>> {
- let (ty_def_id, item_def_id) = key;
- let mut projection_ty = None;
- for (predicate, _) in tcx.predicates_of(ty_def_id).predicates {
- if let ty::PredicateKind::Projection(projection_predicate) = predicate.kind().skip_binder()
- {
- if item_def_id == projection_predicate.projection_ty.item_def_id {
- projection_ty = Some(projection_predicate.projection_ty);
- break;
- }
- }
- }
- projection_ty
-}
-
/// Converts a specific `GenericBound` from the AST into a set of
/// predicates that apply to the self type. A vector is returned
/// because this can be anywhere from zero predicates (`T: ?Sized` adds no