diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/traits/issue-97576.rs | 13 | ||||
| -rw-r--r-- | src/test/ui/traits/issue-97576.stderr | 11 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/traits/issue-97576.rs b/src/test/ui/traits/issue-97576.rs new file mode 100644 index 00000000000..fdc85e9fa89 --- /dev/null +++ b/src/test/ui/traits/issue-97576.rs @@ -0,0 +1,13 @@ +struct Foo { + bar: String, +} + +impl Foo { + pub fn new(bar: impl ToString) -> Self { + Self { + bar: bar.into(), //~ ERROR the trait bound `String: From<impl ToString>` is not satisfied + } + } +} + +fn main() {} diff --git a/src/test/ui/traits/issue-97576.stderr b/src/test/ui/traits/issue-97576.stderr new file mode 100644 index 00000000000..bdee073d6e3 --- /dev/null +++ b/src/test/ui/traits/issue-97576.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `String: From<impl ToString>` is not satisfied + --> $DIR/issue-97576.rs:8:22 + | +LL | bar: bar.into(), + | ^^^^ the trait `From<impl ToString>` is not implemented for `String` + | + = note: required because of the requirements on the impl of `Into<String>` for `impl ToString` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. |
