Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1497daa8a96b61decc37bed908eec352
use std::fmt::Display;
trait Foo {
type Bar;
}
impl Foo for () {
type Bar = Vec<i32>;
}
fn foo() -> impl Foo<Bar = impl Display> {
()
}
The current output is:
error[E0277]: `Vec<i32>` doesn't implement `std::fmt::Display`
--> src/main.rs:11:13
|
11 | fn foo() -> impl Foo<Bar = impl Display> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Vec<i32>` cannot be formatted with the default formatter
|
= help: the trait `std::fmt::Display` is not implemented for `Vec<i32>`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
Ideally the output should look like:
error[E0277]: `Vec<i32>` doesn't implement `std::fmt::Display`
--> src/main.rs:11:13
|
11 | fn foo() -> impl Foo<Bar = impl Display> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Vec<i32>` cannot be formatted with the default formatter
|
= help: the trait `std::fmt::Display` is not implemented for `Vec<i32>`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
note: required due to associated type of `impl Foo for ()`
|
9 | type Bar = Vec<i32>;
| ^^^^^^^^
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1497daa8a96b61decc37bed908eec352
The current output is:
Ideally the output should look like: