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 Rust 2024: Reserve gen keyword #123904

Closed
7 tasks done
traviscross opened this issue Apr 13, 2024 · 5 comments
Closed
7 tasks done

Tracking Issue for Rust 2024: Reserve gen keyword #123904

traviscross opened this issue Apr 13, 2024 · 5 comments
Assignees
Labels
A-edition-2024 Area: The 2024 edition B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC F-gen_blocks `gen {}` expressions that produce `Iterator`s S-tracking-ready-for-edition Status: This issue is ready for inclusion in the edition. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@traviscross
Copy link
Contributor

traviscross commented Apr 13, 2024

This is a tracking issue for reserving the gen keyword in Rust 2024 according to:

The feature gate for the issue is #![feature(gen_blocks)].

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

Related

Implementation history

cc @oli-obk @compiler-errors

@traviscross traviscross added B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. T-lang Relevant to the language team, which will review and decide on the PR/issue. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC A-edition-2024 Area: The 2024 edition F-gen_blocks `gen {}` expressions that produce `Iterator`s labels Apr 13, 2024
@traviscross traviscross self-assigned this Apr 13, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Apr 29, 2024

Does the gen_blocks feature need to be stabilized for the 2024? or is it fine to just stabilize the syntax in the parser?

nope, just syntax is fine, all that is needed to fix this issue is writing documentation

@jhpratt
Copy link
Member

jhpratt commented May 7, 2024

Minor bug in the lint: #124862

@zachgrayio
Copy link

what will it take to support this in rust-analyzer?

@traviscross traviscross added the S-tracking-needs-documentation Status: Needs documentation. label May 21, 2024
traviscross added a commit to traviscross/rust-reference that referenced this issue May 24, 2024
Following RFC 3513 and subsequent work, the `gen` keyword is reserved
in the Rust 2024 edition.  Let's document that.

See tracking issue:

- rust-lang/rust#123904
@traviscross traviscross added S-tracking-ready-to-stabilize Status: This is ready to stabilize; it may need a stabilization report and a PR and removed S-tracking-needs-documentation Status: Needs documentation. labels May 27, 2024
@ehuss
Copy link
Contributor

ehuss commented May 28, 2024

Results from the crater run showed a few limitations of the migration lint, which I don't think there is much we can do about. The following is a summary:

attribute macro issues:

use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
    #[error("it is {gen}")]
    A{gen: i32}
}

[email protected]
[email protected] (via schemars macro)
[email protected] (via schemars macro)
[email protected] (via schemars macro)
[email protected] (via schemars macro)
[email protected] (via schemars macro)
[email protected] (via schemars macro)
https://github.com/mahamzaidi/secret-marketplace (via schemars macro)
https://github.com/kubecfg/kubit (via schemars macro)
https://github.com/hatuank97lhp/ptrans2 (via schemars macro)
https://github.com/chinhnotional/custom-snip721 (via schemars macro)

proc-macro got confused via quote!:

let gen = 123;
quote!(let a = #gen);

trait-gen-0.3.2
[email protected]

build.rs generated code:
[email protected]
[email protected]
switchtec-user-sys
[email protected]

Pulled via include! which isn't fixed:
[email protected]

@traviscross
Copy link
Contributor Author

traviscross commented May 28, 2024

We reviewed this in the edition call today. This item is ready for Rust 2024. It's implemented; the automatic migration lints have landed; we've tested those with crater, and the item is documented in the reference and in the edition guide.

Thanks to @oli-obk and to @compiler-errors for pushing this forward, and thanks to @ehuss for writing up the content for the edition guide and for running crater and analyzing its results.

@traviscross traviscross added S-tracking-ready-for-edition Status: This issue is ready for inclusion in the edition. and removed S-tracking-ready-to-stabilize Status: This is ready to stabilize; it may need a stabilization report and a PR labels Jun 11, 2024
ehuss pushed a commit to traviscross/rust-reference that referenced this issue Nov 25, 2024
Following RFC 3513 and subsequent work, the `gen` keyword is reserved
in the Rust 2024 edition.  Let's document that.

See tracking issue:

- rust-lang/rust#123904
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2024 Area: The 2024 edition B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC F-gen_blocks `gen {}` expressions that produce `Iterator`s S-tracking-ready-for-edition Status: This issue is ready for inclusion in the edition. 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