Rollup of 7 pull requests - #161801
Conversation
The file path was changed in af4c79b. Fix the link, and use a specific commit so it doesn't break accidentally future.
Due to some bad ordering of session/config initialization code -- more about that in subsequent commits -- `cfg(target_has_threads)` fails to be set for the `wasm32-unknown-unknown` platform when `-Ctarget-feature=+atomics` is specified. This commit modifies a test to demonstrate the bug; as written the test passes.
- `parse_check_cfg` has a single call site and is followed by a call to `fill_well_known`. - `parse_cfg` has two call sites and in both cases is followed by a call to `build_configuration`. This commit moves the follow-up calls into the functions, simplifying `run_compiler`.
Currently it modifies the `Session` and the `Cfg` (and the `Cfg` afterwards is put into the `Session`). It also takes a `CodegenBackend`. Those are some heavyweight arguments. This commit moves the `Session` modifications to the caller so the `&mut Session` isn't necessary, and passes in the `TargetConfig` instead of the whole `CodegenBackend`, plus some other small arguments. `add_configuration` ends up more clearly about modifying the `Cfg`. This is a step towards untangling session/backend initialization.
Currently, `parse_cfg` calls `build_configuration`, which calls `default_configuration`, which calls `sess.target.singlethread(&sess.internal_target_features)`. But `sess.internal_target_features` hasn't been set at this point and is empty! This commit moves the setting of `sess.internal_target_features` before the `parse_cfg` call to fix this ordering bug. This results in the `cfg(target_has_threads)` being correctly set on `wasm32-unknown-unknown` when `-Ctarget-feature=+atomics` is specified. Note: I have plans to make this kind of ordering bug difficult/impossible in a follow-up (e.g. rust-lang#161432).
`RawSpan`, `RawDefId`, and `RawDefPathHash` were all introduced to work around the fact that `StableHashCtxt` in `rustc_data_structure` is upstream of `rustc_span`. However, `DefPathHash` is just a newtype around `Fingerprint`, which is defined in `rustc_data_structure`. So by working directly with `Fingerprint` we can remove `RawDefPathHash`, which is a nice simplification.
had to update several tests which used repeated aligns and packeds. they now produce both a warning and an error where appropriate (e.g. when using conflicting packeds) which i think is correct.
… r=jdonszelmann lint against repeated repr attributes fixes rust-lang#156029 by adding a lint against repeated repr attributes. r? scottmcm
…crum panic_unwind: Use global_asm! for IMGREL relocations Rust consteval cannot construct 32-bit values that contain the offset between two symbols, but this is required for panic_unwind on some architectures because unwinding on Windows SEH uses image-base-relative pointers for the panic information (which makes them fit in 32-bit rather than 64-bit). Currently, this is worked around by initializing these globals on panic with atomic stores. This works, but is undefined behavior as the panic runtime reads the values with non-atomic loads, which leads to a data race. Instead, utilize `global_asm!` to create the globals with `@IMGREL` relocations so that the linker constructs the relative pointers for us at link or load time. For context: [#t-compiler > relative pointers in windows SEH panic_unwind @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/relative.20pointers.20in.20windows.20SEH.20panic_unwind/near/613200087) AI assistance was involved with writing the assembly code.
Fix the wasm32-unknown-unknown target feature/cfg bug Due to some bad ordering of session/config initialization code, `cfg(target_has_threads)` fails to be set for the `wasm32-unknown-unknown` platform when `-Ctarget-feature=+atomics` is specified. This PR fixes the problem. Details in individual commits. r? @Mark-Simulacrum
Fix broken link to lang_items.rs in unstable book The file path was changed in af4c79b. Fix the link, and use a specific commit so it doesn't break accidentally in future.
…ee1-dead Remove `RawDefPathHash` `RawSpan`, `RawDefId`, and `RawDefPathHash` were all introduced to work around the fact that `StableHashCtxt` in `rustc_data_structure` is upstream of `rustc_span`. However, `DefPathHash` is just a newtype around `Fingerprint`, which is defined in `rustc_data_structure`. So by working directly with `Fingerprint` we can remove `RawDefPathHash`, which is a nice simplification. r? @fee1-dead
explicitly state that allocations cannot grow to the left This was already implied, but it seems better to make this explicit. Cc @rust-lang/opsem
…, r=mu001999 Remove dead parse error recovery (underscores in expressions) Back in rust-lang@b7f7756 (2019) the parser was extended to recover from `_`s as elements of tuple expressions (this was later extended to also cover call expressions). At the time, `_` obviously wasn't an expression yet. Nowadays `parse_expr_res` will *always* successfully parse `_` as an `ExprKind::Underscore` (irrespective of the passed `Restrictions`). Consequently, we will never reach the special case in `parse_expr_catch_underscore`. Drop this entire wrapper function. <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
|
@bors r+ p=5 |
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 6510953 (parent) -> 3ffb26f (this PR) Test differencesShow 655 test diffsStage 1
Stage 2
Additionally, 652 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 3ffb26fbf5bf232cf59e314e75ea325973f4f583 --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 (3ffb26f): comparison URL. Overall result: ❌ regressions - 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 (secondary -2.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 2.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.1%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 475.812s -> 476.994s (0.25%) |
|
📌 Perf builds for each rolled up PR:
parent commit: 6510953ce0 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
|
These are the only ones that seem potentially relevant. libc contains a lot of reprs and @rust-timer triage 39d59b8 4f30517 |
#157036 39d59b8 lint against repeated repr attributesInstruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary 2.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 0.6%, secondary 2.8%)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. #161744 4f30517 Remove
|
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
2.1% | [1.0%, 5.7%] | 5 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-4.1% | [-5.2%, -2.3%] | 3 |
| All ❌✅ (primary) | - | - | 0 |
Cycles
Results (primary 0.6%, secondary 0.9%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
3.4% | [3.4%, 3.4%] | 1 |
| Regressions ❌ (secondary) |
4.0% | [4.0%, 4.0%] | 1 |
| Improvements ✅ (primary) |
-2.1% | [-2.1%, -2.1%] | 1 |
| Improvements ✅ (secondary) |
-2.2% | [-2.2%, -2.2%] | 1 |
| All ❌✅ (primary) | 0.6% | [-2.1%, 3.4%] | 2 |
Binary size
This perf run didn't have relevant results for this metric.
|
@rust-timer triage ae960b0 |
#160183 ae960b0 panic_unwind: Use global_asm! for IMGREL relocationsInstruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary 4.1%, secondary 1.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.5%, secondary 2.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (secondary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
|
|
Weird, let's benchmark the rest, I guess @rust-timer triage 8a6ec0c ff19789 |
#161718 8a6ec0c Fix the wasm32-unknown-unknown target feature/cfg bugInstruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.5%, secondary -1.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (secondary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
#161796 ff19789 Remove dead parse error recovery (underscores in expressions)Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary -1.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.0%, secondary 1.8%)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. |
|
nice, definitely wouldn't guess this one. I'll continue the discussion on the PR. @rustbot label: +perf-regression-triaged |
Successful merges:
RawDefPathHash#161744 (RemoveRawDefPathHash)r? @ghost
Create a similar rollup