-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
impl Trait return value infers 'static lifetime #51282
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This code (playground):
fails to compile with:
Replacing
impl Iteratorwith an explicit type works:Explicitly bounding the output lifetime also works: