This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed
tests/ui/diagnostic_namespace Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ #[ diagnostic:: on_unimplemented( aa = "broken" ) ]
2+ pub trait Test { }
Original file line number Diff line number Diff line change 1+ //@ edition:2021
2+ //@ compile-flags:--test
3+ //@ aux-build:bad_on_unimplemented.rs
4+
5+ // Do not ICE when encountering a malformed `#[diagnostic::on_unimplemented]` annotation in a
6+ // dependency when incorrectly used (#124651).
7+
8+ extern crate bad_on_unimplemented;
9+
10+ use bad_on_unimplemented:: Test ;
11+
12+ fn breakage < T : Test > ( _: T ) { }
13+
14+ #[ test]
15+ fn test ( ) {
16+ breakage ( 1 ) ; //~ ERROR E0277
17+ }
Original file line number Diff line number Diff line change 1+ error[E0277]: the trait bound `{integer}: Test` is not satisfied
2+ --> $DIR/on_unimplemented_ice.rs:16:14
3+ |
4+ LL | breakage(1);
5+ | -------- ^ the trait `Test` is not implemented for `{integer}`
6+ | |
7+ | required by a bound introduced by this call
8+ |
9+ note: required by a bound in `breakage`
10+ --> $DIR/on_unimplemented_ice.rs:12:16
11+ |
12+ LL | fn breakage<T: Test>(_: T) {}
13+ | ^^^^ required by this bound in `breakage`
14+
15+ error: aborting due to 1 previous error
16+
17+ For more information about this error, try `rustc --explain E0277`.
You can’t perform that action at this time.
0 commit comments