-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Closed
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team
Description
Originally reported in #34511 (comment), separated out to make it easier to track. #43869 and #44731 are examples caused by this issue.
If a function is purely diverging, any part of the return type cannot contain impl Trait, e.g.
fn do_it_later_but_cannot() -> impl Iterator<Item=u8> { //~ ERROR E0227
unimplemented!()
}this fails because ! does not implement Iterator. But I think this should be allowed even without the explicit impl, since ! can be coerced to any concrete type.
Metadata
Metadata
Assignees
Labels
A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.Category: This is a bug.T-langRelevant to the language teamRelevant to the language team