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 return type notation #109417

Open
1 of 4 tasks
compiler-errors opened this issue Mar 20, 2023 · 1 comment
Open
1 of 4 tasks

Tracking Issue for return type notation #109417

compiler-errors opened this issue Mar 20, 2023 · 1 comment
Labels
B-experimental Feature: In-tree experiment; RFC pending or unneeded. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. F-return_type_notation `#[feature(return_type_notation)]` 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

@compiler-errors
Copy link
Member

compiler-errors commented Mar 20, 2023

This is a tracking issue for the EXPERIMENTAL feature return type notation (RFC: pending).
The feature gate for the issue is #![feature(return_type_notation)].

Additional background: https://smallcultfollowing.com/babysteps/blog/2023/02/13/return-type-notation-send-bounds-part-2/

About experimental features

An experimental feature is one that has not yet had an RFC. The idea is to allow implementation work to proceed to better inform an upcoming RFC. Experimental features cannot be stabilized without first having an RFC. The existence of an experimental feature does not indicate lang team consensus that the feature is desirable, only that there is the problem is worthy of being solved and that the idea has enough merit to consider exploring. See the lang team process page for more details.

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

Experimental results

Part of the goal of the experimental process is to identify benefits but also concerns that need to be addressed in the RFC. This section catalogues notable findings thus far.

Implementation history

@compiler-errors compiler-errors added the C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. label Mar 20, 2023
@compiler-errors compiler-errors changed the title Tracking Issue for Return Type Notation (feature(return_type_notation)) Tracking Issue for Return Type Notation (#![feature(return_type_notation)]) Mar 20, 2023
tamasfe added a commit to tamasfe/rust-analyzer that referenced this issue Apr 1, 2023
Limited syntactic support for experimental return type notations.
rust-lang/rust#109417
bors added a commit to rust-lang/rust-analyzer that referenced this issue Apr 1, 2023
Limited syntax support for return type notations (RTN)

Experimental RTN bound support was recently merged into rustc (rust-lang/rust#109417), the goal of this PR is to allow experimentation without syntax errors everywhere.

The parsing implemented currently aligns with the state of the tracking issue, it only supports the form `T<foo(..): Bounds>`. The parser always checks for the presence of `..` to disambiguate from `Fn*()` types, this is not ideal but I didn't want to spend too much time as it is an experimental feature.
@Nilstrieb Nilstrieb added the T-lang Relevant to the language team, which will review and decide on the PR/issue. label Apr 5, 2023
@jackh726 jackh726 added the F-return_type_notation `#[feature(return_type_notation)]` label Aug 21, 2023
@VictorBulba
Copy link

hey

Is there a way to use this the following way?

#![feature(async_fn_in_trait)]
#![feature(return_type_notation)]

use std::future::Future;

trait Inner: Send + Sync {
    async fn do_async(&self);
}

trait Outer {
    type In: Inner<do_async(): Send>;
} 

fn foo<T>(inner: T::In) -> impl Future + Send
where
    T: Outer,
{
    async move {
        inner.do_async().await;
    }
}

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=d69310a05735ec25356754d4b8bdd708

@fmease fmease added S-tracking-impl-incomplete Status: The implementation is incomplete. B-experimental Feature: In-tree experiment; RFC pending or unneeded. labels Feb 28, 2024
@fmease fmease changed the title Tracking Issue for Return Type Notation (#![feature(return_type_notation)]) Tracking Issue for return type notation Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-experimental Feature: In-tree experiment; RFC pending or unneeded. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. F-return_type_notation `#[feature(return_type_notation)]` 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

5 participants