Skip to content

Tracking Issue for impl Trait as output type of Fn traits in function return position #99697

Open
@WaffleLapkin

Description

@WaffleLapkin

This is a tracking issue for impl Trait as output type in Fn traits in return position of functions, for example fn f() -> impl Fn() -> impl Sized { ... }.
The feature gate for the issue is #![feature(impl_trait_in_fn_trait_return)].

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps

Unresolved Questions

Questions to be answered in stabilization report (after gaining experience).

Should we allow impl Fn() -> impl Trait in argument position of functions?

fn f(into_iter_fn: impl Fn() -> impl Iterator) {}

...and what does that desugar to? See discussion here.

Behavior of '_

What is the behavior of '_ in impl trait in general and in this specific case? In this particular case, '_ should be consistent with its use in other function signatures.

Parsing rules

Let's document the parsing behavior and assure ourselves we are happy with it. Some notes here.

Implementation history

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-impl_trait_in_fn_trait_return`#![feature(impl_trait_in_fn_trait_return)]`S-tracking-impl-incompleteStatus: The implementation is incomplete.T-langRelevant to the language team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions