-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Closed
Copy link
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I'm trying to use a where
clause to define one trait in terms of another, as applied to a wrapper type:
struct Wrapper<T>(T);
trait Base {}
trait Wrapped: Sized where Wrapper<Self>: Base {}
fn wat<F: Wrapped>() {}
But when I try to bound by the new trait, I get a strange error:
error[E0277]: the trait bound `Wrapper<F>: Base` is not satisfied
--> src/main.rs:7:1
|
7 | fn wat<F: Wrapped>() {}
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Base` is not implemented for `Wrapper<F>`
|
note: required by `Wrapped`
--> src/main.rs:5:1
|
5 | trait Wrapped: Sized where Wrapper<Self>: Base {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LukasKalbertodt
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.