Auto merge of #149192 - gmorenz:normalize_lifetimes, r=madsmtm · rust-lang/rust@2cd4ee6 (original) (raw)
`@@ -316,7 +316,7 @@ impl<'psess, 'src> Lexer<'psess, 'src> {
`
316
316
`` // Include the leading ' in the real identifier, for macro
``
317
317
`// expansion purposes. See #12512 for the gory details of why
`
318
318
`// this is necessary.
`
319
``
`-
let lifetime_name = self.str_from(start);
`
``
319
`+
let lifetime_name = nfc_normalize(self.str_from(start));
`
320
320
`self.last_lifetime = Some(self.mk_sp(start, start + BytePos(1)));
`
321
321
`if starts_with_number {
`
322
322
`let span = self.mk_sp(start, self.pos);
`
`@@ -325,8 +325,7 @@ impl<'psess, 'src> Lexer<'psess, 'src> {
`
325
325
`.with_span(span)
`
326
326
`.stash(span, StashKey::LifetimeIsChar);
`
327
327
`}
`
328
``
`-
let ident = Symbol::intern(lifetime_name);
`
329
``
`-
token::Lifetime(ident, IdentIsRaw::No)
`
``
328
`+
token::Lifetime(lifetime_name, IdentIsRaw::No)
`
330
329
`}
`
331
330
` rustc_lexer::TokenKind::RawLifetime => {
`
332
331
`self.last_lifetime = Some(self.mk_sp(start, start + BytePos(1)));
`
`@@ -373,7 +372,7 @@ impl<'psess, 'src> Lexer<'psess, 'src> {
`
373
372
`String::with_capacity(lifetime_name_without_tick.as_str().len() + 1);
`
374
373
` lifetime_name.push(''');
`
375
374
` lifetime_name += lifetime_name_without_tick.as_str();
`
376
``
`-
let sym = Symbol::intern(&lifetime_name);
`
``
375
`+
let sym = nfc_normalize(&lifetime_name);
`
377
376
``
378
377
`// Make sure we mark this as a raw identifier.
`
379
378
`self.psess.raw_identifier_spans.push(span);
`
`@@ -393,9 +392,8 @@ impl<'psess, 'src> Lexer<'psess, 'src> {
`
393
392
`self.pos = lt_start;
`
394
393
`self.cursor = Cursor::new(&str_before[2 as usize..], FrontmatterAllowed::No);
`
395
394
``
396
``
`-
let lifetime_name = self.str_from(start);
`
397
``
`-
let ident = Symbol::intern(lifetime_name);
`
398
``
`-
token::Lifetime(ident, IdentIsRaw::No)
`
``
395
`+
let lifetime_name = nfc_normalize(self.str_from(start));
`
``
396
`+
token::Lifetime(lifetime_name, IdentIsRaw::No)
`
399
397
`}
`
400
398
`}
`
401
399
` rustc_lexer::TokenKind::Semi => token::Semi,
`