debug!("Dynamic");
debug!("field_ty = {}", &field_ty);
debug!("ty in field = {}", &ty);
- if let Some(ex_trait_ref) = obj.principal() {
- // Here, we are passing the type `usize` as a
- // placeholder value with the function
- // `with_self_ty`, since there is no concrete type
- // `Self` for a `dyn Trait` at this
- // stage. Therefore when checking explicit
- // predicates in `check_explicit_predicates` we
- // need to ignore checking the explicit_map for
- // Self type.
- let substs = ex_trait_ref
- .with_self_ty(tcx, tcx.types.usize)
- .skip_binder()
- .substs;
- check_explicit_predicates(
- tcx,
- &ex_trait_ref.skip_binder().def_id,
- substs,
- required_predicates,
- explicit_map,
- IgnoreSelfTy(true),
- );
- }
+ let ex_trait_ref = obj.principal();
+ // Here, we are passing the type `usize` as a
+ // placeholder value with the function
+ // `with_self_ty`, since there is no concrete type
+ // `Self` for a `dyn Trait` at this
+ // stage. Therefore when checking explicit
+ // predicates in `check_explicit_predicates` we
+ // need to ignore checking the explicit_map for
+ // Self type.
+ let substs = ex_trait_ref
+ .with_self_ty(tcx, tcx.types.usize)
+ .skip_binder()
+ .substs;
+ check_explicit_predicates(
+ tcx,
+ &ex_trait_ref.skip_binder().def_id,
+ substs,
+ required_predicates,
+ explicit_map,
+ IgnoreSelfTy(true),
+ );
}
ty::Projection(obj) => {
}
}
+#[derive(Debug)]
pub struct IgnoreSelfTy(bool);
/// We also have to check the explicit predicates
explicit_map: &mut ExplicitPredicatesMap<'tcx>,
ignore_self_ty: IgnoreSelfTy,
) {
- debug!("def_id = {:?}", &def_id);
- debug!("substs = {:?}", &substs);
- debug!("explicit_map = {:?}", explicit_map);
- debug!("required_predicates = {:?}", required_predicates);
+ debug!(
+ "check_explicit_predicates(def_id={:?}, \
+ substs={:?}, \
+ explicit_map={:?}, \
+ required_predicates={:?}, \
+ ignore_self_ty={:?})",
+ def_id,
+ substs,
+ explicit_map,
+ required_predicates,
+ ignore_self_ty,
+ );
let explicit_predicates = explicit_map.explicit_predicates_of(tcx, *def_id);
for outlives_predicate in explicit_predicates.iter() {