sort suggestions for object diagnostic
This commit is contained in:
parent
9322882ade
commit
540be28f6c
4 changed files with 7 additions and 6 deletions
|
@ -178,12 +178,13 @@ pub fn report_object_safety_error<'tcx>(
|
|||
)));
|
||||
}
|
||||
impls => {
|
||||
let types = impls
|
||||
let mut types = impls
|
||||
.iter()
|
||||
.map(|t| {
|
||||
with_no_trimmed_paths!(format!(" {}", tcx.type_of(*t).instantiate_identity(),))
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
types.sort();
|
||||
err.help(format!(
|
||||
"the following types implement the trait, consider defining an enum where each \
|
||||
variant holds one of these types, implementing `{}` for this new enum and using \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue