- Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`
Description
I tried this code:
trait Duh {} impl Duh for i32 {} trait Trait { type Assoc: Duh; } impl<R: Duh, F: FnMut() -> R> Trait for F { type Assoc = R; } type Sendable = impl Send; type Foo = impl Trait<Assoc = Sendable>; fn foo() -> Foo { || 42 }
I expected to see this happen: it compiles, just like
trait Duh {} impl Duh for i32 {} trait Trait { type Assoc: Duh; } impl<R: Duh, F: FnMut() -> R> Trait for F { type Assoc = R; } type Sendable = impl Send; fn foo() -> impl Trait<Assoc = Sendable> { || 42 }
Instead, this happened:
error[[E0277]](https://doc.rust-lang.org/nightly/error-index.html#E0277): the trait bound `Sendable: Duh` is not satisfied --> src/lib.rs:19:5 | 19 | || 42 | ^^^^^ the trait `Duh` is not implemented for `Sendable` | = help: the trait `Duh` is implemented for `i32` note: required for `[closure@src/lib.rs:19:5: 19:7]` to implement `Trait` --> src/lib.rs:10:31 | 10 | impl<R: Duh, F: FnMut() -> R> Trait for F { | ^^^^^ ^
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`
Type
Projects
Status
Done