NFC normalisation of lifetimes and labels #126759
Labels
A-Unicode
Area: Unicode
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
The lexer NFC-normalises identifiers, as described in rfc2457. For example,
K
(LATIN CAPITAL LETTER K
) andK
(KELVIN SIGN
) are treated as representing the same identifier.But this doesn't happen for lifetimes or labels, so
'K
and'K
are different as lifetimes or labels.For example, this compiles (without warning) in Rust 1.79, while this doesn't compile.
I'm not sure whether this should be considered a bug.
rfc2457 doesn't explicitly mention lifetimes or labels.
The Reference describes the current behaviour: it treats identifiers and lifetimes/labels as parallel forms of token, and documents normalisation as happening for identifiers only.
On the other hand it seems surprising, and some of the discussion around #126452 has expressed the view that "lifetimes are identifiers".
The text was updated successfully, but these errors were encountered: