Fix a freshly detected wrong TraitRef
This commit is contained in:
parent
0ae3da34c3
commit
9f6ae8828e
1 changed files with 5 additions and 9 deletions
|
@ -694,16 +694,12 @@ fn receiver_is_dispatchable<'tcx>(
|
||||||
|
|
||||||
// U: Trait<Arg1, ..., ArgN>
|
// U: Trait<Arg1, ..., ArgN>
|
||||||
let trait_predicate = {
|
let trait_predicate = {
|
||||||
let substs =
|
let trait_def_id = method.trait_container(tcx).unwrap();
|
||||||
InternalSubsts::for_item(tcx, method.trait_container(tcx).unwrap(), |param, _| {
|
let substs = InternalSubsts::for_item(tcx, trait_def_id, |param, _| {
|
||||||
if param.index == 0 {
|
if param.index == 0 { unsized_self_ty.into() } else { tcx.mk_param_from_def(param) }
|
||||||
unsized_self_ty.into()
|
});
|
||||||
} else {
|
|
||||||
tcx.mk_param_from_def(param)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ty::Binder::dummy(tcx.mk_trait_ref(unsize_did, substs)).to_predicate(tcx)
|
ty::Binder::dummy(tcx.mk_trait_ref(trait_def_id, substs)).to_predicate(tcx)
|
||||||
};
|
};
|
||||||
|
|
||||||
let caller_bounds: Vec<Predicate<'tcx>> =
|
let caller_bounds: Vec<Predicate<'tcx>> =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue