Unify/streamline long type name written to disk mechanism
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I've unified (I think) the long type output file in
note_obligation_cause_code, and moved the filename note to the end ofnote_obligation_cause_code. The long type output file probably should be passed even further up the call chain. Although further up in the call chain, there are also various instances of scattered output file / filename notes (esp. inrustc_hir_typeck) which probably should eventually be somehow unified too (probably not in this PR).
Originally posted by @jieyouxu in https://github.com/rust-lang/rust/issues/121739#issuecomment-1969819008
In rustc_hir_typeck and probably in more places, there are random scattered logic for writing long type names to disk. Last I tried to modify them in #121739, I discovered that:
- Where and how these long type name files are created is inconsistent.
- There are probably multiple places where different files are created, which can cause multiple long type name files to emitted if you aren't careful.
- AFAICT, they might not properly respect
--remap-path-prefixand such. - Not sure if this is problematic for reproducibility, probably not.
It's probably better if we tried to unify the long type name written to disk so they are treated consistently and to avoid the duplicate type name file output footguns. This could potentially aid in addressing #129296.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the long-type output handling in note_obligation_cause_code and the scattered logic in rustc_hir_typeck, then trace how the filename and output file move up the call chain. Done means long type names are written through one consistent mechanism, without duplicate files, while respecting path remapping; consider how this relates to #129296.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100