diagnostics: add test case for trait bounds diagnostic
Closes #82038 It was fixed by b8e5ab20ed7a7677a998a163ccf7853764b195e6, a wide-reaching obligation tracking improvement. This commit adds a test case.
This commit is contained in:
parent
70c7e4d21c
commit
31e5dd3a79
9
tests/ui/trait-bounds/issue-82038.rs
Normal file
9
tests/ui/trait-bounds/issue-82038.rs
Normal file
@ -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]
|
||||
}
|
9
tests/ui/trait-bounds/issue-82038.stderr
Normal file
9
tests/ui/trait-bounds/issue-82038.stderr
Normal file
@ -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`.
|
Loading…
x
Reference in New Issue
Block a user