Fix missing syntax context in lifetime hygiene debug output - #151817
Conversation
|
rustbot has assigned @jdonszelmann. Use |
This comment has been minimized.
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`.
6bc4b5f to
a333f6f
Compare
|
@bors r+ rollup |
…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
…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
…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)
…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)
…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
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)
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)
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
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)
|
The test you added here has very strange behavior. Just look at its git history: I think it's because this normalization doesn't normalize away newline differences. |
|
-Zunpretty=expanded,hygienewas not printing the syntax context for lifetimes. For example, two macro-generated lifetimes'awith 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_lifetimeto callann_post()with the fullIdent, matching how regular identifiers are handled inprint_ident.Closes: #151797