Handle trait/impl GAC mismatches when inferring missing/placeholder types
This commit is contained in:
parent
24afa42a90
commit
39d9b840bb
4 changed files with 27 additions and 16 deletions
|
@ -244,7 +244,8 @@ fn infer_type_if_missing<'tcx>(fcx: &FnCtxt<'_, 'tcx>, node: Node<'tcx>) -> Opti
|
|||
impl_def_id,
|
||||
impl_trait_ref.args,
|
||||
);
|
||||
Some(tcx.type_of(trait_item_def_id).instantiate(tcx, args))
|
||||
tcx.check_args_compatible(trait_item_def_id, args)
|
||||
.then(|| tcx.type_of(trait_item_def_id).instantiate(tcx, args))
|
||||
} else {
|
||||
Some(fcx.next_ty_var(span))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue