1
Fork 0

Handle trait/impl GAC mismatches when inferring missing/placeholder types

This commit is contained in:
León Orell Valerian Liehr 2024-05-23 20:05:28 +02:00
parent 24afa42a90
commit 39d9b840bb
No known key found for this signature in database
GPG key ID: D17A07215F68E713
4 changed files with 27 additions and 16 deletions

View file

@ -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))
}