Unflatten use statements in HIR - #161349
Conversation
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Unflatten `use` statements in HIR
This comment has been minimized.
This comment has been minimized.
|
💔 Test for bb18a8a failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
|
The CI failure makes no sense, the only way that assert is reachable is by there being UB somewhere afaict: rust/compiler/rustc_metadata/src/rmeta/decoder.rs Lines 1447 to 1452 in b588ef3 Also I can't reproduce locally 😨 |
|
The backtrace doesn't make sense either: The assert is in And rust/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs Lines 138 to 163 in f7d782a |
probably got inlined. but the assert message says it's in a different line
I freshly rebased, so I assumed it should be fine, very odd |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Unflatten `use` statements in HIR
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (00e1020): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.0%, secondary 3.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -5.9%, secondary 3.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 470.08s -> 468.116s (-0.42%) |
03a839a to
a7c90ba
Compare
|
@bors r=petrochenkov |
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing f7575a9 (parent) -> 0d38a84 (this PR) Test differencesShow 76 test diffs76 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 0d38a842626a6e3b70e2c1efd76a8f22d2556d73 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (0d38a84): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Our benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 1.9%, secondary 5.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.8%, secondary 2.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 490.636s -> 491.128s (0.10%) |
…-obk Use get to avoid ICE on unresolved imports Fixes rust-lang#163294 After rust-lang#161349, unresolved imports may not have `import_res`.
…-obk Use get to avoid ICE on unresolved imports Fixes rust-lang#163294 After rust-lang#161349, unresolved imports may not have `import_res`.
View all comments
The HIR and AST representations of use statements are now mirrored, instead of having the HIR flatten the AST representation and duplicating early parts of nested paths:
used to get flattened in HIR to
which duplicated the
a::bpart several times (and many more if you have more nesting).This alone is fine, it made some parts of the compiler simpler and some parts harder, but it also meant we were generating more items (which are also owners) and had to duplicate resolver information across the flattened items. All that is gone with this PR.
This PR is the minimal version we can land, but there are obvious further avenues for cleanups and improvements. I did some refactorings in rustdoc, but I think the import logic can generally be improved by not handling imports together with other items and instead having them in separate tables.
Similarly clippy can probably benefit from a
check_use_treemethod onLateLintPass, but they often need to track separate information anyway, so it may be better to just always manually recurse.should unblock #159760
see related discussion on #t-compiler > partial_res_map vs per-owner tables @ 💬
part of rust-lang/goals#620