Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 3 tasks
WaffleLapkin opened this issue Jul 24, 2022 · 0 comments
Open
1 of 3 tasks
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. F-impl_trait_in_fn_trait_return `#![feature(impl_trait_in_fn_trait_return)]` S-tracking-impl-incomplete Status: The implementation is incomplete. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@WaffleLapkin
Copy link
Member

WaffleLapkin commented Jul 24, 2022

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

@WaffleLapkin WaffleLapkin added the C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. label Jul 24, 2022
@rustbot rustbot added the T-lang Relevant to the language team, which will review and decide on the PR/issue. label Jul 24, 2022
@camelid camelid added the F-impl_trait_in_fn_trait_return `#![feature(impl_trait_in_fn_trait_return)]` label Jul 25, 2022
@joshtriplett joshtriplett added the S-tracking-impl-incomplete Status: The implementation is incomplete. label Aug 10, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 8, 2022
…-errors

Add help for `#![feature(impl_trait_in_fn_trait_return)]`

This adds a new variant `ImplTraitContext::FeatureGated`, so we can
generalize the help for `return_position_impl_trait_in_trait` to also
work for `impl_trait_in_fn_trait_return`.

cc rust-lang#99697
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 8, 2022
…-errors

Add help for `#![feature(impl_trait_in_fn_trait_return)]`

This adds a new variant `ImplTraitContext::FeatureGated`, so we can
generalize the help for `return_position_impl_trait_in_trait` to also
work for `impl_trait_in_fn_trait_return`.

cc rust-lang#99697
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 8, 2022
…-errors

Add help for `#![feature(impl_trait_in_fn_trait_return)]`

This adds a new variant `ImplTraitContext::FeatureGated`, so we can
generalize the help for `return_position_impl_trait_in_trait` to also
work for `impl_trait_in_fn_trait_return`.

cc rust-lang#99697
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
…-errors

Add help for `#![feature(impl_trait_in_fn_trait_return)]`

This adds a new variant `ImplTraitContext::FeatureGated`, so we can
generalize the help for `return_position_impl_trait_in_trait` to also
work for `impl_trait_in_fn_trait_return`.

cc rust-lang#99697
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. F-impl_trait_in_fn_trait_return `#![feature(impl_trait_in_fn_trait_return)]` S-tracking-impl-incomplete Status: The implementation is incomplete. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants