1
Fork 0

Do not talk about "trait <Foo = Bar>"

Pass in an appropriate `Option<DefId>` in more cases from hir ty lowering.
This commit is contained in:
Esteban Küber 2024-11-28 23:40:17 +00:00
parent af09423967
commit b466405890
9 changed files with 21 additions and 13 deletions

View file

@ -279,7 +279,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
} else {
let mut err = self.dcx().create_err(err);
if suggest_constraining_type_param(
tcx, generics, &mut err, &qself_str, &trait_ref, None, None,
tcx,
generics,
&mut err,
&qself_str,
&trait_ref,
Some(best_trait),
None,
) && !identically_named
{
// We suggested constraining a type parameter, but the associated item on it