Prevent the creation of TraitRef without dedicated methods
This commit is contained in:
@@ -703,9 +703,7 @@ fn receiver_is_dispatchable<'tcx>(
|
||||
}
|
||||
});
|
||||
|
||||
ty::Binder::dummy(ty::TraitRef { def_id: unsize_did, substs })
|
||||
.without_const()
|
||||
.to_predicate(tcx)
|
||||
ty::Binder::dummy(tcx.mk_trait_ref(unsize_did, substs)).to_predicate(tcx)
|
||||
};
|
||||
|
||||
let caller_bounds: Vec<Predicate<'tcx>> =
|
||||
|
||||
@@ -1309,8 +1309,7 @@ fn assemble_candidate_for_impl_trait_in_trait<'cx, 'tcx>(
|
||||
let trait_substs =
|
||||
obligation.predicate.substs.truncate_to(tcx, tcx.generics_of(trait_def_id));
|
||||
// FIXME(named-returns): Binders
|
||||
let trait_predicate =
|
||||
ty::Binder::dummy(ty::TraitRef { def_id: trait_def_id, substs: trait_substs });
|
||||
let trait_predicate = ty::Binder::dummy(tcx.mk_trait_ref(trait_def_id, trait_substs));
|
||||
|
||||
let _ = selcx.infcx.commit_if_ok(|_| {
|
||||
match selcx.select(&obligation.with(tcx, trait_predicate)) {
|
||||
|
||||
Reference in New Issue
Block a user