File tree Expand file tree Collapse file tree
tests/ui/diagnostic_namespace Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ error[E0277]: this message
2+ --> $DIR/duplicate_coalescing.rs:16:17
3+ |
4+ LL | takes_trait(());
5+ | ----------- ^^ this label
6+ | |
7+ | required by a bound introduced by this call
8+ |
9+ = help: the trait `Trait` is not implemented for `()`
10+ = note: a note
11+ = note: another note
12+ help: this trait has no implementations, consider adding one
13+ --> $DIR/duplicate_coalescing.rs:11:1
14+ |
15+ LL | trait Trait {}
16+ | ^^^^^^^^^^^
17+ note: required by a bound in `takes_trait`
18+ --> $DIR/duplicate_coalescing.rs:13:24
19+ |
20+ LL | fn takes_trait(_: impl Trait) {}
21+ | ^^^^^ required by this bound in `takes_trait`
22+
23+ error: aborting due to 1 previous error
24+
25+ For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change 1+ error[E0277]: this message
2+ --> $DIR/duplicate_coalescing.rs:16:17
3+ |
4+ LL | takes_trait(());
5+ | ----------- ^^ this label
6+ | |
7+ | required by a bound introduced by this call
8+ |
9+ = help: the trait `Trait` is not implemented for `()`
10+ = note: a note
11+ help: this trait has no implementations, consider adding one
12+ --> $DIR/duplicate_coalescing.rs:11:1
13+ |
14+ LL | trait Trait {}
15+ | ^^^^^^^^^^^
16+ note: required by a bound in `takes_trait`
17+ --> $DIR/duplicate_coalescing.rs:13:24
18+ |
19+ LL | fn takes_trait(_: impl Trait) {}
20+ | ^^^^^ required by this bound in `takes_trait`
21+
22+ error: aborting due to 1 previous error
23+
24+ For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change 1+ error[E0277]: this message
2+ --> $DIR/duplicate_coalescing.rs:16:17
3+ |
4+ LL | takes_trait(());
5+ | ----------- ^^ the trait `Trait` is not implemented for `()`
6+ | |
7+ | required by a bound introduced by this call
8+ |
9+ = note: a note
10+ = note: another note
11+ help: this trait has no implementations, consider adding one
12+ --> $DIR/duplicate_coalescing.rs:11:1
13+ |
14+ LL | trait Trait {}
15+ | ^^^^^^^^^^^
16+ note: required by a bound in `takes_trait`
17+ --> $DIR/duplicate_coalescing.rs:13:24
18+ |
19+ LL | fn takes_trait(_: impl Trait) {}
20+ | ^^^^^ required by this bound in `takes_trait`
21+
22+ error: aborting due to 1 previous error
23+
24+ For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change 1+ //@ reference: attributes.diagnostic.on_unimplemented.duplicates
2+ //@ revisions: label note both
3+ //@[both] compile-flags: --cfg label --cfg note
4+ //@ dont-require-annotations: NOTE
5+
6+ //! Example and test of multiple diagnostic attributes coalescing together.
7+
8+ #[ diagnostic:: on_unimplemented( message = "this message" , note = "a note" ) ]
9+ #[ cfg_attr( label, diagnostic:: on_unimplemented( label = "this label" ) ) ]
10+ #[ cfg_attr( note, diagnostic:: on_unimplemented( note = "another note" ) ) ]
11+ trait Trait { }
12+
13+ fn takes_trait ( _: impl Trait ) { }
14+
15+ fn main ( ) {
16+ takes_trait ( ( ) ) ;
17+ //~^ERROR this message
18+ //[label]~|NOTE this label
19+ //[both]~|NOTE this label
20+ //~|NOTE a note
21+ //[note]~|NOTE another note
22+ //[both]~|NOTE another note
23+ }
You can’t perform that action at this time.
0 commit comments