rust/tests/ui/diagnostic_namespace/on_unimplemented/multiple_notes.stderr
Georg Semmler 160b1793b2
Allows #[diagnostic::on_unimplemented] attributes to have multiple
notes

This commit extends the `#[diagnostic::on_unimplemented]` (and
`#[rustc_on_unimplemented]`) attributes to allow multiple `note`
options. This enables emitting multiple notes for custom error messages.
For now I've opted to not change any of the existing usages of
`#[rustc_on_unimplemented]` and just updated the relevant compile tests.
2023-10-27 12:42:42 +02:00

48 lines
1.2 KiB
Plaintext

error[E0277]: Foo
--> $DIR/multiple_notes.rs:14:15
|
LL | takes_foo(());
| --------- ^^ Bar
| |
| required by a bound introduced by this call
|
= help: the trait `Foo` is not implemented for `()`
= note: Baz
= note: Boom
help: this trait has no implementations, consider adding one
--> $DIR/multiple_notes.rs:4:1
|
LL | trait Foo {}
| ^^^^^^^^^
note: required by a bound in `takes_foo`
--> $DIR/multiple_notes.rs:10:22
|
LL | fn takes_foo(_: impl Foo) {}
| ^^^ required by this bound in `takes_foo`
error[E0277]: Bar
--> $DIR/multiple_notes.rs:16:15
|
LL | takes_bar(());
| --------- ^^ Foo
| |
| required by a bound introduced by this call
|
= help: the trait `Bar` is not implemented for `()`
= note: Baz
= note: Baz2
help: this trait has no implementations, consider adding one
--> $DIR/multiple_notes.rs:8:1
|
LL | trait Bar {}
| ^^^^^^^^^
note: required by a bound in `takes_bar`
--> $DIR/multiple_notes.rs:11:22
|
LL | fn takes_bar(_: impl Bar) {}
| ^^^ required by this bound in `takes_bar`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.