Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diagnostics: add test case for trait bounds diagnostic #115649

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/ui/trait-bounds/issue-82038.rs
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]
}
9 changes: 9 additions & 0 deletions tests/ui/trait-bounds/issue-82038.stderr
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`.