Skip to content

Rollup of 8 pull requests #142770

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 28 commits into from
Jun 20, 2025
Merged

Rollup of 8 pull requests #142770

merged 28 commits into from
Jun 20, 2025

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Jun 20, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Qelxiros and others added 28 commits June 18, 2025 00:38
This does change the logic a bit: previously, we didn't forward reverse
implications of negated features to the backend, instead relying on the backend
to handle the implication itself.
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
This bumps to the latest versions of `r-efi` and `r-efi-alloc`, which
drop the dependency on `compiler_builtins` via crates.io.

Part of [rust-lang#142265].

[rust-lang#142265]: https://github.com/rust-lang/rust/issues/142265
rewrite `optimize` attribute to use new attribute parsing infrastructure

r? ```@oli-obk```

I'm afraid we'll get quite a few of these PRs in the future. If we get a lot of trivial changes I'll start merging multiple into one PR. They should be easy to review :)

Waiting on rust-lang#138165 first
…n, r=nnethercote,WaffleLapkin

Extract some shared code from codegen backend target feature handling

There's a bunch of code duplication between the GCC and LLVM backends in target feature handling. This moves that into new shared helper functions in `rustc_codegen_ssa`.

The first two commits should be purely refactoring. I am fairly sure the LLVM-side behavior stays the same; if the GCC side deliberately diverges from this then I may have missed that. I did account for one divergence, which I do not know is deliberate or not: GCC does not seem to use the `-Ctarget-feature` flag to populate `cfg(target_feature)`. That seems odd, since the `-Ctarget-feature` flag is used to populate the return value of `global_gcc_features` which controls the target features actually used by GCC. ``@GuillaumeGomez`` ``@antoyo`` is there a reason `target_config` ignores `-Ctarget-feature` but `global_gcc_features`  does not? The second commit also cleans up a bunch of unneeded complexity added in rust-lang#135927.

The third commit extracts some shared logic out of the functions that populate `cfg(target_feature)` and the backend target feature set, respectively. This one actually has some slight functional changes:
- Before, with `-Ctarget-feature=-feat`, if there is some other feature `x` that implies `feat` we would *not* add `-x` to the backend target feature set. Now, we do. This fixes rust-lang#134792.
- The logic that removes `x` from `cfg(target_feature)` in this case also changed a bit, avoiding a large number of calls to the (uncached) `sess.target.implied_target_features` (if there were a large number of positive features listed before a negative feature) but instead constructing a full inverse implication map when encountering the first negative feature. Ideally this would be done with queries but the backend target feature logic runs before `tcx` so we can't use that...
- Previously, if feature "a" implied "b" and "b" was unstable, then using `-Ctarget-feature=+a` would also emit a warning about `b`. I had to remove this since when accounting for negative implications, this emits a ton of warnings in a bunch of existing tests... I assume this was unintentional anyway.

The fourth commit increases consistency of the GCC backend with the LLVM backend.

The last commit does some further cleanup:
- Get rid of RUSTC_SPECIAL_FEATURES. It was only needed for s390x "backchain", but since LLVM 19 that is always a regular target feature so we don't need this hack any more. The hack also has various unintended side-effects so we don't want to keep it. Fixes rust-lang#142412.
- Move RUSTC_SPECIFIC_FEATURES handling into the shared parse_rust_feature_flag helper so all consumers of `-Ctarget-feature` that only care about actual target features (and not "crt-static") have it. Previously, we actually set `cfg(target_feature = "crt-static")` twice: once in the backend target feature logic, and once specifically for that one feature. IIUC, some targets are meant to ignore `-Ctarget-feature=+crt-static`, it seems like before this PR that flag still incorrectly enabled `cfg(target_feature = "crt-static")` (but I didn't test this).
- Move fixed_x18 handling together with retpoline handling.
- Forbid setting fixed_x18 as a regular target feature, even unstably. It must be set via the `-Z` flag.

``@bjorn3`` I did not touch the cranelift backend here, since AFAIK it doesn't really support target features. But if you ever do, please use the new helpers. :)

Cc ``@workingjubilee``
…r=ChrisDenton,tgross35

Implement send_signal for unix child processes

Tracking issue: rust-lang#141975

There are two main differences between my implementation and the Public API section of the tracking issue. ~First, `send_signal` requires a mutable reference, like `Child::kill`.~ Second, `ChildExt` has `Sealed` as a supertrait, bringing it more in line with other extension traits like `CommandExt`.

try-job: `dist-various*`
try-job: `test-various*`
vec_deque/fmt/vec tests: remove static mut

More rust-lang#125035.

r? ```@tgross35```
Reduce uses of `hir_crate`.

I tried rebasing my old incremental-HIR branch. This is a by-product, which is required if we want to get rid of `hir_crate` entirely.

The second commit is a drive-by cleanup. It can be pulled into its own PR.

r? ````@oli-obk````
Update books

## rust-lang/book

1 commits in 4433c9f0cad8460bee05ede040587f8a1fa3f1de..8a6d44e45b7b564eeb6bae30507e1fbac439d72d
2025-06-18 17:06:36 UTC to 2025-06-18 17:06:36 UTC

- Chapter 12 from tech review (rust-lang/book#4410)

## rust-lang/reference

6 commits in d4c66b346f4b72d29e70390a3fa3ea7d4e064db1..50fc1628f36563958399123829c73755fa7a8421
2025-06-19 02:02:39 UTC to 2025-06-17 21:18:46 UTC

- Document inferred const args (`feature(generic_arg_infer)`) (rust-lang/reference#1835)
- const_eval: we allow references to statics and promoteds (rust-lang/reference#1858)
- Fix missing rule on destructors (rust-lang/reference#1861)
- Fix inconsistent heading depth (rust-lang/reference#1860)
- Fix recursive root-accessible grammar check (rust-lang/reference#1852)
- Fix grammar links (rust-lang/reference#1851)

## rust-lang/rust-by-example

1 commits in 9baa9e863116cb9524a177d5a5c475baac18928a..05c7d8bae65f23a1837430c5a19be129d414f5ec
2025-06-18 13:15:17 UTC to 2025-06-18 13:15:17 UTC

- Revert "introduce new ````@media```` query to set a higher content width on ultra wide screens" (rust-lang/rust-by-example#1939)
…r, r=Kobzol

add comment to `src/bootstrap/build.rs`

I attempted to remove this build script but it's apparently needed. Add a comment for why.
…Simulacrum

Update library dependencies

This bumps to the latest versions of `r-efi` and `r-efi-alloc`, which drop the dependency on `compiler_builtins` via crates.io.

Part of [rust-lang#142265].

[rust-lang#142265]: rust-lang#142265
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. labels Jun 20, 2025
@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jun 20, 2025
@tgross35
Copy link
Contributor Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Jun 20, 2025

📌 Commit bb72cc7 has been approved by tgross35

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 20, 2025
@bors
Copy link
Collaborator

bors commented Jun 20, 2025

⌛ Testing commit bb72cc7 with merge 3b97f13...

@bors
Copy link
Collaborator

bors commented Jun 20, 2025

☀️ Test successful - checks-actions
Approved by: tgross35
Pushing 3b97f13 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 20, 2025
@bors bors merged commit 3b97f13 into rust-lang:master Jun 20, 2025
11 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 20, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#138291 rewrite optimize attribute to use new attribute parsing i… a59c44c99bbfa13708ea2eae05bec0e4a7ceed20 (link)
#140920 Extract some shared code from codegen backend target featur… 27ad89e3045a56b5dcf3aad11f87722197190f74 (link)
#141990 Implement send_signal for unix child processes 8ad9d80f80811bdea215e97cd785befe5751aa31 (link)
#142668 vec_deque/fmt/vec tests: remove static mut 812fc9e8b1de476775ff78c4ad215a7db68c17ca (link)
#142687 Reduce uses of hir_crate. f0954c54f4cc1fb9680864ff17b36ca04cd24542 (link)
#142699 Update books 78fa1de2d0c345554dec418d3a0e41785be43e00 (link)
#142714 add comment to src/bootstrap/build.rs 5b2352a00e228e2cdcd3cf2e3e25e618560ccc52 (link)
#142753 Update library dependencies a9a0198e1a21fc8a4bdd845d94cda700a4b63a21 (link)

previous master: 18491d5be0

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

Copy link
Contributor

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 18491d5 (parent) -> 3b97f13 (this PR)

Test differences

Show 234 test diffs

Stage 1

  • errors::verify_codegen_ssa_add_native_library_34: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_add_native_library_36: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_aix_strip_not_used_130: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_archive_build_failure_74: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_binary_output_to_tty_32: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_check_installed_visual_studio_49: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_compiler_builtins_cannot_call_126: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_copy_path_29: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_copy_path_buf_28: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_cpu_required_51: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_create_temp_dir_35: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_dlltool_fail_import_library_122: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_dlltool_fail_import_library_124: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_error_calling_dlltool_124: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_error_calling_dlltool_126: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_error_creating_import_library_127: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_error_creating_import_library_129: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_error_writing_def_file_123: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_error_writing_def_file_125: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_expected_one_argument_28: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_expected_used_symbol_78: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_extract_bundled_libs_archive_member_68: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_extract_bundled_libs_archive_member_70: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_extract_bundled_libs_parse_archive_66: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_extract_bundled_libs_read_entry_67: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_extract_bundled_libs_write_file_71: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_extract_bundled_libs_write_file_73: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_forbidden_ctarget_feature_136: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_forbidden_target_feature_attr_120: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_ignoring_output_32: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_link_ordinal_nargs_117: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_basic_float_type_83: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_cannot_return_106: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_cannot_return_108: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_cast_wide_pointer_110: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_expected_element_type_107: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_expected_element_type_109: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_expected_pointer_111: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_expected_return_type_105: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_expected_usize_112: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_expected_vector_element_type_115: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_float_to_int_unchecked_82: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_float_to_int_unchecked_84: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_floating_point_type_86: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_invalid_bitmask_92: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_invalid_bitmask_94: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_return_integer_type_98: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_return_length_100: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_return_length_input_type_93: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_return_length_input_type_95: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_return_type_104: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_simd_argument_86: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_simd_first_90: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_simd_input_87: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_simd_return_91: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_simd_return_93: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_simd_shuffle_99: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_unsupported_cast_113: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_unsupported_operation_116: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_unsupported_symbol_109: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_monomorphization_unsupported_symbol_of_size_108: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_invalid_no_sanitize_118: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_invalid_windows_subsystem_78: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_link_exe_unexpected_error_42: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_link_script_unavailable_59: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_link_script_write_failure_60: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_linker_file_stem_56: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_linker_file_stem_58: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_mixed_export_name_and_no_mangle_131: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_msvc_missing_linker_47: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_msvc_missing_linker_49: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_multiple_external_func_decl_37: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_multiple_main_functions_79: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_processing_dymutil_failed_52: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_read_file_72: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_read_file_74: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_repair_vs_build_tools_43: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_rlib_incompatible_dependency_formats_41: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_rlib_missing_format_36: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_rlib_missing_format_38: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_rlib_not_found_38: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_rlib_only_rmeta_found_39: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_select_cpp_build_tool_workload_43: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_select_cpp_build_tool_workload_45: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_self_contained_linker_missing_50: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_static_library_native_artifacts_57: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_static_library_native_artifacts_to_file_58: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_stripping_debug_info_failed_56: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_target_feature_safe_trait_119: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_target_feature_safe_trait_121: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_unable_to_run_dsymutil_53: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_unable_to_write_debugger_visualizer_64: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_unknown_archive_kind_75: [missing] -> pass (J0)
  • errors::verify_codegen_ssa_unsupported_link_self_contained_75: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_xcrun_sdk_path_warning_134: pass -> [missing] (J0)
  • errors::verify_codegen_ssa_xcrun_unsuccessful_131: [missing] -> pass (J0)
  • errors::verify_session_forbidden_ctarget_feature_52: pass -> [missing] (J0)
  • [assembly] tests/assembly/s390x-backchain-toggle.rs#default-backchain: [missing] -> pass (J1)

Stage 2

  • [assembly] tests/assembly/s390x-backchain-toggle.rs#default-backchain: [missing] -> pass (J2)
  • [codegen] tests/codegen/target-feature-negative-implication.rs: [missing] -> pass (J2)

(and 123 additional test diffs)

Additionally, 11 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 3b97f1308ff72016a4aaa93fbe6d09d4d6427815 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-i686-msvc: 10368.1s -> 6721.5s (-35.2%)
  2. i686-msvc-2: 11171.8s -> 7293.6s (-34.7%)
  3. dist-x86_64-apple: 11661.7s -> 7624.1s (-34.6%)
  4. dist-aarch64-linux: 7894.5s -> 5695.1s (-27.9%)
  5. x86_64-apple-2: 5596.5s -> 4178.7s (-25.3%)
  6. dist-loongarch64-linux: 6254.6s -> 5870.5s (-6.1%)
  7. x86_64-gnu-debug: 5330.1s -> 5650.0s (6.0%)
  8. dist-x86_64-windows-gnullvm: 5639.1s -> 5377.3s (-4.6%)
  9. aarch64-apple: 4363.8s -> 4556.7s (4.4%)
  10. x86_64-apple-1: 8569.5s -> 8192.4s (-4.4%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3b97f13): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -0.7%, secondary -1.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.9% [0.9%, 0.9%] 1
Regressions ❌
(secondary)
3.8% [2.3%, 5.8%] 3
Improvements ✅
(primary)
-2.2% [-2.2%, -2.2%] 1
Improvements ✅
(secondary)
-1.9% [-5.3%, -0.6%] 21
All ❌✅ (primary) -0.7% [-2.2%, 0.9%] 2

Cycles

Results (primary 0.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.7% [0.7%, 0.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [0.7%, 0.7%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 691.482s -> 693.577s (0.30%)
Artifact size: 371.94 MiB -> 371.92 MiB (-0.01%)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustdoc-json Area: Rustdoc JSON backend merged-by-bors This PR was explicitly merged by bors. O-unix Operating system: Unix-like rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants