Skip to content

Commit 7ec8136

Browse files
authored
Rollup merge of #115649 - notriddle:notriddle/82038, r=compiler-errors
diagnostics: add test case for trait bounds diagnostic Closes #82038 It was fixed by #89580, a wide-reaching obligation tracking improvement. This commit adds a test case.
2 parents 1979772 + 31e5dd3 commit 7ec8136

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/ui/trait-bounds/issue-82038.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Failed bound `bool: Foo` must not point at the `Self: Clone` line
2+
3+
trait Foo {
4+
fn my_method() where Self: Clone;
5+
}
6+
7+
fn main() {
8+
<bool as Foo>::my_method(); //~ERROR [E0277]
9+
}
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0277]: the trait bound `bool: Foo` is not satisfied
2+
--> $DIR/issue-82038.rs:8:6
3+
|
4+
LL | <bool as Foo>::my_method();
5+
| ^^^^ the trait `Foo` is not implemented for `bool`
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)