Add more
This commit is contained in:
parent
b97ff8eb16
commit
f6c30b3a54
6 changed files with 10 additions and 10 deletions
|
@ -245,7 +245,7 @@ fn overlap<'tcx>(
|
|||
let trait_ref = infcx.resolve_vars_if_possible(trait_ref);
|
||||
format!(
|
||||
"of `{}` for `{}`",
|
||||
trait_ref.print_only_trait_path(),
|
||||
trait_ref.print_trait_sugared(),
|
||||
trait_ref.self_ty()
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1854,7 +1854,7 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
let end = if candidates.len() <= 9 { candidates.len() } else { 8 };
|
||||
err.help(format!(
|
||||
"the following {other}types implement trait `{}`:{}{}",
|
||||
trait_ref.print_only_trait_path(),
|
||||
trait_ref.print_trait_sugared(),
|
||||
candidates[..end].join(""),
|
||||
if candidates.len() > 9 {
|
||||
format!("\nand {} others", candidates.len() - 8)
|
||||
|
|
|
@ -78,7 +78,7 @@ impl<'tcx> IntercrateAmbiguityCause<'tcx> {
|
|||
IntercrateAmbiguityCause::DownstreamCrate { trait_ref, self_ty } => {
|
||||
format!(
|
||||
"downstream crates may implement trait `{trait_desc}`{self_desc}",
|
||||
trait_desc = trait_ref.print_only_trait_path(),
|
||||
trait_desc = trait_ref.print_trait_sugared(),
|
||||
self_desc = if let Some(self_ty) = self_ty {
|
||||
format!(" for type `{self_ty}`")
|
||||
} else {
|
||||
|
@ -90,7 +90,7 @@ impl<'tcx> IntercrateAmbiguityCause<'tcx> {
|
|||
format!(
|
||||
"upstream crates may add a new impl of trait `{trait_desc}`{self_desc} \
|
||||
in future versions",
|
||||
trait_desc = trait_ref.print_only_trait_path(),
|
||||
trait_desc = trait_ref.print_trait_sugared(),
|
||||
self_desc = if let Some(self_ty) = self_ty {
|
||||
format!(" for type `{self_ty}`")
|
||||
} else {
|
||||
|
|
|
@ -412,7 +412,7 @@ fn report_conflicting_impls<'tcx>(
|
|||
let msg = DelayDm(|| {
|
||||
format!(
|
||||
"conflicting implementations of trait `{}`{}{}",
|
||||
overlap.trait_ref.print_only_trait_path(),
|
||||
overlap.trait_ref.print_trait_sugared(),
|
||||
overlap.self_ty.map_or_else(String::new, |ty| format!(" for type `{ty}`")),
|
||||
match used_to_be_allowed {
|
||||
Some(FutureCompatOverlapErrorKind::Issue33140) => ": (E0119)",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue