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

Raw syntax for lifetimes and loop labels #126335

Closed
traviscross opened this issue Jun 12, 2024 · 3 comments
Closed

Raw syntax for lifetimes and loop labels #126335

traviscross opened this issue Jun 12, 2024 · 3 comments
Assignees
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@traviscross
Copy link
Contributor

traviscross commented Jun 12, 2024

We don't currently accept:

pub fn label() {
    'r#async: loop {
        break 'r#async;
    }
}

pub fn lifetime<'r#async>() {}

Should we? This has relevance to edition migrations.

See:

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 12, 2024
@traviscross traviscross added T-lang Relevant to the language team, which will review and decide on the PR/issue. C-discussion Category: Discussion or questions that doesn't represent real issues. I-lang-nominated Nominated for discussion during a lang team meeting. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 12, 2024
@traviscross
Copy link
Contributor Author

traviscross commented Jun 12, 2024

@rustbot labels -I-lang-nominated

We discussed this in the lang triage call today. Our consensus was that this should be allowed and that it seems to have been an oversight that it wasn't already, given RFC 3101 and other related work.

@rustbot rustbot removed the I-lang-nominated Nominated for discussion during a lang team meeting. label Jun 12, 2024
@compiler-errors
Copy link
Member

I'll put up a PR for this tomorrow. I've got a draft, just want to make sure it's actually correct.

@compiler-errors compiler-errors self-assigned this Jun 13, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 14, 2024
Implement raw lifetimes and labels (`'r#ident`)

This PR implements a syntax for raw lifetimes and labels as requested in rust-lang#126335.

This PR also moves keyword lifetime validation (i.e. checking that we don't have something like `'async`) from ast validation to the parser, similar to how we handle raw identifiers, since we don't distinguish raw identifiers after parsing.

This PR additionally extends the `keyword_idents_2024` lint to also check identifiers.

cc `@traviscross`
r? parser
@traviscross
Copy link
Contributor Author

This has been fixed by #126452, so we can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-discussion Category: Discussion or questions that doesn't represent real issues. 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

3 participants