diff options
| -rw-r--r-- | tests/ui/specialization/min_specialization/issue-79224.rs | 10 | ||||
| -rw-r--r-- | tests/ui/specialization/min_specialization/issue-79224.stderr | 8 |
2 files changed, 14 insertions, 4 deletions
diff --git a/tests/ui/specialization/min_specialization/issue-79224.rs b/tests/ui/specialization/min_specialization/issue-79224.rs index 6ddd3d79ccf..15429bf60e5 100644 --- a/tests/ui/specialization/min_specialization/issue-79224.rs +++ b/tests/ui/specialization/min_specialization/issue-79224.rs @@ -1,6 +1,16 @@ #![feature(min_specialization)] use std::fmt::{self, Display}; +pub trait ToString { + fn to_string(&self) -> String; +} + +impl<T: Display + ?Sized> ToString for T { + default fn to_string(&self) -> String { + todo!() + } +} + pub enum Cow<'a, B: ?Sized + 'a, O = <B as ToOwned>::Owned> where B: ToOwned, diff --git a/tests/ui/specialization/min_specialization/issue-79224.stderr b/tests/ui/specialization/min_specialization/issue-79224.stderr index 84e526f4597..ffa7462da16 100644 --- a/tests/ui/specialization/min_specialization/issue-79224.stderr +++ b/tests/ui/specialization/min_specialization/issue-79224.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `B: Clone` is not satisfied - --> $DIR/issue-79224.rs:18:29 + --> $DIR/issue-79224.rs:28:29 | LL | impl<B: ?Sized> Display for Cow<'_, B> { | ^^^^^^^^^^ the trait `Clone` is not implemented for `B` @@ -11,7 +11,7 @@ LL | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> { | +++++++++++++++++++ error[E0277]: the trait bound `B: Clone` is not satisfied - --> $DIR/issue-79224.rs:20:5 + --> $DIR/issue-79224.rs:30:5 | LL | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `B` @@ -23,7 +23,7 @@ LL | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> { | +++++++++++++++++++ error[E0277]: the trait bound `B: Clone` is not satisfied - --> $DIR/issue-79224.rs:20:13 + --> $DIR/issue-79224.rs:30:13 | LL | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ^^^^ the trait `Clone` is not implemented for `B` @@ -35,7 +35,7 @@ LL | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> { | +++++++++++++++++++ error[E0277]: the trait bound `B: Clone` is not satisfied - --> $DIR/issue-79224.rs:20:62 + --> $DIR/issue-79224.rs:30:62 | LL | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ______________________________________________________________^ |
