Skip to content

Conversation

@gmorenz
Copy link

@gmorenz gmorenz commented Nov 21, 2025

Fixes #126759

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 21, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 21, 2025

r? @madsmtm

rustbot has assigned @madsmtm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@jieyouxu
Copy link
Member

jieyouxu commented Dec 2, 2025

This is a observable language change in that previously we didn't accept

struct Foo<'a>(&'a ());
fn foo<'K>(_x: Foo<'K>, _y: Foo<'>) {}
//      ^- latin K               ^- kelvin K
error[E0261]: use of undeclared lifetime name `'K`
 --> src/lib.rs:3:33
  |
3 | fn foo<'K>(_x: Foo<'K>, _y: Foo<'K>) {}
  |                                 ^^ undeclared lifetime
  |
help: consider introducing lifetime `'K` here
  |
3 | fn foo<'K, 'K>(_x: Foo<'K>, _y: Foo<'K>) {}
  |        +++

So when we do NFC-normalize the lifetimes, we are now accepting more code (but is consistent with the original RFC and regular identifiers). This needs a lang FCP, and probably an update to the reference on NFC-normalization.

@rustbot label: +I-lang-nominated

@rustbot rustbot added the I-lang-nominated Nominated for discussion during a lang team meeting. label Dec 2, 2025
@gmorenz
Copy link
Author

gmorenz commented Dec 2, 2025

I think the reference is actually fine - I'm not sure if something changed since the original bug report or the original bug report was just a generous reading of the current reference as accepting the non-normalizing implementation.

The lifetime syntax page is here, and simply references the lifetime identifiers as either IDENTIFIER_OR_KEYWORD or NON_KEYWORD_IDENTIFIER as defined here which specifies that they should be normalized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I-lang-nominated Nominated for discussion during a lang team meeting. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NFC normalisation of lifetimes and labels

4 participants