forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#115649 - notriddle:notriddle/82038, r=compi…
…ler-errors diagnostics: add test case for trait bounds diagnostic Closes rust-lang#82038 It was fixed by rust-lang#89580, a wide-reaching obligation tracking improvement. This commit adds a test case.
- Loading branch information
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Failed bound `bool: Foo` must not point at the `Self: Clone` line | ||
|
||
trait Foo { | ||
fn my_method() where Self: Clone; | ||
} | ||
|
||
fn main() { | ||
<bool as Foo>::my_method(); //~ERROR [E0277] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0277]: the trait bound `bool: Foo` is not satisfied | ||
--> $DIR/issue-82038.rs:8:6 | ||
| | ||
LL | <bool as Foo>::my_method(); | ||
| ^^^^ the trait `Foo` is not implemented for `bool` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |