@@ -251,6 +251,18 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
251
251
return self . dcx ( ) . emit_err ( err) ;
252
252
}
253
253
254
+ let trait_args = & ty:: GenericArgs :: identity_for_item ( tcx, best_trait) [ 1 ..] ;
255
+ let mut trait_ref = trait_name. clone ( ) ;
256
+ let applicability = if let [ arg, args @ ..] = trait_args {
257
+ use std:: fmt:: Write ;
258
+ write ! ( trait_ref, "</* {arg}" ) . unwrap ( ) ;
259
+ args. iter ( ) . try_for_each ( |arg| write ! ( trait_ref, ", {arg}" ) ) . unwrap ( ) ;
260
+ trait_ref += " */>" ;
261
+ Applicability :: HasPlaceholders
262
+ } else {
263
+ Applicability :: MaybeIncorrect
264
+ } ;
265
+
254
266
let identically_named = suggested_name == assoc_name. name ;
255
267
256
268
if let DefKind :: TyAlias = tcx. def_kind ( item_def_id)
@@ -260,22 +272,15 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
260
272
lo : ty_param_span. shrink_to_lo ( ) ,
261
273
mi : ty_param_span. shrink_to_hi ( ) ,
262
274
hi : ( !identically_named) . then_some ( assoc_name. span ) ,
263
- // FIXME(fmease): Use a full trait ref here (with placeholders).
264
- trait_ : & trait_name,
275
+ trait_ref,
265
276
identically_named,
266
277
suggested_name,
278
+ applicability,
267
279
} ) ;
268
280
} else {
269
281
let mut err = self . dcx ( ) . create_err ( err) ;
270
282
if suggest_constraining_type_param (
271
- tcx,
272
- generics,
273
- & mut err,
274
- & qself_str,
275
- // FIXME(fmease): Use a full trait ref here (with placeholders).
276
- & trait_name,
277
- None ,
278
- None ,
283
+ tcx, generics, & mut err, & qself_str, & trait_ref, None , None ,
279
284
) && !identically_named
280
285
{
281
286
// We suggested constraining a type parameter, but the associated item on it
0 commit comments