-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.
Description
I tried this code:
trait MyTrait {}
struct Foo<T> where T: MyTrait, (T)
I expected to see this happen: It compiles and requires T to implement MyTrait
Instead, this happened: It doesn't compile
Meta
rustc --version --verbose
:
rustc 1.67.0-nightly (83356b78c 2022-11-17)
binary: rustc
commit-hash: 83356b78c4ff3e7d84e977aa6143793545967301
commit-date: 2022-11-17
host: x86_64-unknown-linux-gnu
release: 1.67.0-nightly
LLVM version: 15.0.4
"Backtrace" (compiler error)
error: expected one of `:`, `==`, or `=`, found `;`
--> src/lib.rs:3:36
|
3 | struct Foo<T> where T: MyTrait, (T);
| ^ expected one of `:`, `==`, or `=`
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.