Small clean up of E0277 message logic
This commit is contained in:
parent
c475e2303b
commit
d89c2c569a
1 changed files with 9 additions and 15 deletions
|
@ -4769,21 +4769,15 @@ pub(super) fn get_explanation_based_on_obligation<'tcx>(
|
||||||
} else {
|
} else {
|
||||||
String::new()
|
String::new()
|
||||||
};
|
};
|
||||||
match ty_desc {
|
let desc = match ty_desc {
|
||||||
Some(desc) => format!(
|
Some(desc) => format!(" {desc}"),
|
||||||
"{}the trait `{}` is not implemented for {} `{}`{post}",
|
None => String::new(),
|
||||||
pre_message,
|
};
|
||||||
trait_predicate.print_modifiers_and_trait_path(),
|
format!(
|
||||||
desc,
|
"{pre_message}the trait `{}` is not implemented for{desc} `{}`{post}",
|
||||||
tcx.short_ty_string(trait_ref.skip_binder().self_ty(), &mut None),
|
|
||||||
),
|
|
||||||
None => format!(
|
|
||||||
"{}the trait `{}` is not implemented for `{}`{post}",
|
|
||||||
pre_message,
|
|
||||||
trait_predicate.print_modifiers_and_trait_path(),
|
trait_predicate.print_modifiers_and_trait_path(),
|
||||||
tcx.short_ty_string(trait_ref.skip_binder().self_ty(), &mut None),
|
tcx.short_ty_string(trait_ref.skip_binder().self_ty(), &mut None),
|
||||||
),
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue