Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/ui/diagnostic_namespace/duplicate_coalescing.both.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
error[E0277]: this message
--> $DIR/duplicate_coalescing.rs:15:17
|
LL | takes_trait(());
| ----------- ^^ this label
| |
| required by a bound introduced by this call
|
= help: the trait `Trait` is not implemented for `()`
= note: a note
= note: another note
help: this trait has no implementations, consider adding one
--> $DIR/duplicate_coalescing.rs:10:1
|
LL | trait Trait {}
| ^^^^^^^^^^^
note: required by a bound in `takes_trait`
--> $DIR/duplicate_coalescing.rs:12:24
|
LL | fn takes_trait(_: impl Trait) {}
| ^^^^^ required by this bound in `takes_trait`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.
24 changes: 24 additions & 0 deletions tests/ui/diagnostic_namespace/duplicate_coalescing.label.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
error[E0277]: this message
--> $DIR/duplicate_coalescing.rs:15:17
|
LL | takes_trait(());
| ----------- ^^ this label
| |
| required by a bound introduced by this call
|
= help: the trait `Trait` is not implemented for `()`
= note: a note
help: this trait has no implementations, consider adding one
--> $DIR/duplicate_coalescing.rs:10:1
|
LL | trait Trait {}
| ^^^^^^^^^^^
note: required by a bound in `takes_trait`
--> $DIR/duplicate_coalescing.rs:12:24
|
LL | fn takes_trait(_: impl Trait) {}
| ^^^^^ required by this bound in `takes_trait`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.
24 changes: 24 additions & 0 deletions tests/ui/diagnostic_namespace/duplicate_coalescing.note.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
error[E0277]: this message
--> $DIR/duplicate_coalescing.rs:15:17
|
LL | takes_trait(());
| ----------- ^^ the trait `Trait` is not implemented for `()`
| |
| required by a bound introduced by this call
|
= note: a note
= note: another note
help: this trait has no implementations, consider adding one
--> $DIR/duplicate_coalescing.rs:10:1
|
LL | trait Trait {}
| ^^^^^^^^^^^
note: required by a bound in `takes_trait`
--> $DIR/duplicate_coalescing.rs:12:24
|
LL | fn takes_trait(_: impl Trait) {}
| ^^^^^ required by this bound in `takes_trait`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.
22 changes: 22 additions & 0 deletions tests/ui/diagnostic_namespace/duplicate_coalescing.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//@ revisions: label note both
//@[both] compile-flags: --cfg label --cfg note
//@ dont-require-annotations: NOTE

//! Example and test of multiple diagnostic attributes coalescing together.

#[diagnostic::on_unimplemented(message = "this message", note = "a note")]
#[cfg_attr(label, diagnostic::on_unimplemented(label = "this label"))]
#[cfg_attr(note, diagnostic::on_unimplemented(note = "another note"))]
trait Trait {}

fn takes_trait(_: impl Trait) {}

fn main() {
takes_trait(());
//~^ERROR this message
//[label]~|NOTE this label
//[both]~|NOTE this label
//~|NOTE a note
//[note]~|NOTE another note
//[both]~|NOTE another note
}
Loading