Skip to content

Conversation

@aytey
Copy link
Contributor

@aytey aytey commented Jan 29, 2026

-Zunpretty=expanded,hygiene was not printing the syntax context for lifetimes. For example, two macro-generated lifetimes 'a with different hygiene would both print as /* 2538 */ instead of /* 2538#0 */ and /* 2538#1 */, making it impossible to distinguish them.

This was fixed by changing print_lifetime to call ann_post() with the full Ident, matching how regular identifiers are handled in print_ident.

Closes: #151797

@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 Jan 29, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 29, 2026

r? @jdonszelmann

rustbot has assigned @jdonszelmann.
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

@rustbot

This comment has been minimized.

`-Zunpretty=expanded,hygiene` was not printing the syntax context for
lifetimes. For example, two macro-generated lifetimes `'a` with different
hygiene would both print as `/* 2538 */` instead of `/* 2538#0 */` and
`/* 2538#1 */`, making it impossible to distinguish them.

This was fixed by changing `print_lifetime` to call `ann_post()` with
the full `Ident`, matching how regular identifiers are handled in
`print_ident`.
@aytey aytey force-pushed the fix_lifetime_unpretty_hygiene branch from 6bc4b5f to a333f6f Compare January 29, 2026 12:07
@jdonszelmann
Copy link
Contributor

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 29, 2026

📌 Commit a333f6f has been approved by jdonszelmann

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 29, 2026
…e, r=jdonszelmann

Fix missing syntax context in lifetime hygiene debug output

`-Zunpretty=expanded,hygiene` was not printing the syntax context for lifetimes. For example, two macro-generated lifetimes `'a` with different hygiene would both print as `/* 2538 */` instead of `/* 2538#0 */` and `/* 2538#1 */`, making it impossible to distinguish them.

This was fixed by changing `print_lifetime` to call `ann_post()` with the full `Ident`, matching how regular identifiers are handled in `print_ident`.

Closes: rust-lang#151797
rust-bors bot pushed a commit that referenced this pull request Jan 29, 2026
…uwer

Rollup of 3 pull requests

Successful merges:

 - #151808 (Document a safety condition for `TypedArena::alloc_raw_slice`)
 - #151811 (Fix false positive in unused_parens caused by break)
 - #151817 (Fix missing syntax context in lifetime hygiene debug output)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 29, 2026
…e, r=jdonszelmann

Fix missing syntax context in lifetime hygiene debug output

`-Zunpretty=expanded,hygiene` was not printing the syntax context for lifetimes. For example, two macro-generated lifetimes `'a` with different hygiene would both print as `/* 2538 */` instead of `/* 2538#0 */` and `/* 2538#1 */`, making it impossible to distinguish them.

This was fixed by changing `print_lifetime` to call `ann_post()` with the full `Ident`, matching how regular identifiers are handled in `print_ident`.

Closes: rust-lang#151797
rust-bors bot pushed a commit that referenced this pull request Jan 29, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #151808 (Document a safety condition for `TypedArena::alloc_raw_slice`)
 - #151811 (Fix false positive in unused_parens caused by break)
 - #151817 (Fix missing syntax context in lifetime hygiene debug output)
 - #151836 (Fix flakyness issue with `tests/rustdoc-gui/globals.goml` test)
rust-bors bot pushed a commit that referenced this pull request Jan 30, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #151808 (Document a safety condition for `TypedArena::alloc_raw_slice`)
 - #151811 (Fix false positive in unused_parens caused by break)
 - #151817 (Fix missing syntax context in lifetime hygiene debug output)
 - #151836 (Fix flakyness issue with `tests/rustdoc-gui/globals.goml` test)
Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 30, 2026
…e, r=jdonszelmann

Fix missing syntax context in lifetime hygiene debug output

`-Zunpretty=expanded,hygiene` was not printing the syntax context for lifetimes. For example, two macro-generated lifetimes `'a` with different hygiene would both print as `/* 2538 */` instead of `/* 2538#0 */` and `/* 2538#1 */`, making it impossible to distinguish them.

This was fixed by changing `print_lifetime` to call `ann_post()` with the full `Ident`, matching how regular identifiers are handled in `print_ident`.

Closes: rust-lang#151797
rust-bors bot pushed a commit that referenced this pull request Jan 30, 2026
Rollup of 6 pull requests

Successful merges:

 - #151777 (    Reduce generics use in the query system.)
 - #151808 (Document a safety condition for `TypedArena::alloc_raw_slice`)
 - #151811 (Fix false positive in unused_parens caused by break)
 - #151817 (Fix missing syntax context in lifetime hygiene debug output)
 - #151836 (Fix flakyness issue with `tests/rustdoc-gui/globals.goml` test)
 - #151844 (rustc-dev-guide subtree update)
rust-bors bot pushed a commit that referenced this pull request Jan 30, 2026
Rollup of 5 pull requests

Successful merges:

 - #151777 (    Reduce generics use in the query system.)
 - #151808 (Document a safety condition for `TypedArena::alloc_raw_slice`)
 - #151811 (Fix false positive in unused_parens caused by break)
 - #151817 (Fix missing syntax context in lifetime hygiene debug output)
 - #151844 (rustc-dev-guide subtree update)
@rust-bors rust-bors bot merged commit dcc74dd into rust-lang:main Jan 30, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Jan 30, 2026
rust-timer added a commit that referenced this pull request Jan 30, 2026
Rollup merge of #151817 - aytey:fix_lifetime_unpretty_hygiene, r=jdonszelmann

Fix missing syntax context in lifetime hygiene debug output

`-Zunpretty=expanded,hygiene` was not printing the syntax context for lifetimes. For example, two macro-generated lifetimes `'a` with different hygiene would both print as `/* 2538 */` instead of `/* 2538#0 */` and `/* 2538#1 */`, making it impossible to distinguish them.

This was fixed by changing `print_lifetime` to call `ann_post()` with the full `Ident`, matching how regular identifiers are handled in `print_ident`.

Closes: #151797
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jan 31, 2026
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#151777 (    Reduce generics use in the query system.)
 - rust-lang/rust#151808 (Document a safety condition for `TypedArena::alloc_raw_slice`)
 - rust-lang/rust#151811 (Fix false positive in unused_parens caused by break)
 - rust-lang/rust#151817 (Fix missing syntax context in lifetime hygiene debug output)
 - rust-lang/rust#151844 (rustc-dev-guide subtree update)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Lifetime hygiene comments missing #N suffix in -Zunpretty=expanded,hygiene output

3 participants