Skip to content

Commit 4054780

Browse files
estebankcuviper
authored andcommitted
Add test for rust-lang#124651
(cherry picked from commit 758e459)
1 parent 6af338d commit 4054780

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#[diagnostic::on_unimplemented(aa = "broken")]
2+
pub trait Test {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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`.

0 commit comments

Comments
 (0)