about summary refs log tree commit diff
path: root/compiler/rustc_hir/src/def.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-31 08:44:14 +0000
committerbors <bors@rust-lang.org>2025-03-31 08:44:14 +0000
commit10a76d634781180b4f5402c519f0c237d3be6ee6 (patch)
treeb7e1b5ee322864536e8edda6ba3278efa2b2992c /compiler/rustc_hir/src/def.rs
parent7bfd9529be7f4e10ca12f9eee1f442c12c6ea8ad (diff)
parent7c74474d8d9fb2a714d86bae7a5099d27899e150 (diff)
downloadrust-10a76d634781180b4f5402c519f0c237d3be6ee6.tar.gz
rust-10a76d634781180b4f5402c519f0c237d3be6ee6.zip
Auto merge of #139083 - petrochenkov:ctxtdecod3, r=nnethercote
hygiene: Rewrite `apply_mark_internal` to be more understandable

The previous implementation allocated new `SyntaxContext`s in the inverted order, and it was generally very hard to understand why its result matches what the `opaque` and `opaque_and_semitransparent` field docs promise.
```rust
/// This context, but with all transparent and semi-transparent expansions filtered away.
opaque: SyntaxContext,
/// This context, but with all transparent expansions filtered away.
opaque_and_semitransparent: SyntaxContext,
```
It also couldn't be easily reused for the case where the context id is pre-reserved like in #129827.

The new implementation tries to follow the docs in a more straightforward way.
I did the transformation in small steps, so it indeed matches the old implementation, not just the docs.
So I suggest reading only the new version.
Diffstat (limited to 'compiler/rustc_hir/src/def.rs')
0 files changed, 0 insertions, 0 deletions