Skip to content

Rollup of 7 pull requests - #163358

Closed
JonathanBrouwer wants to merge 33 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-5BWOfs6
Closed

JonathanBrouwer wants to merge 33 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-5BWOfs6

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

zakrad and others added 30 commits September 21, 2026 11:54
For production use, we should only link in the ubsan_minimal runtime,
instead of the complete ubsan runtime. This adds support for both
cfi-recover and cfi-diag to use the minimal runtime when
`-Zsanitizer-cfi-minimal-runtime` is specified.

This also includes tests, to ensure the flag can only be used if either
cfi-recover or cfi-diag is enabled, it doesn't disrupt the original
behavior, and links in the correct runtime when specified.

Co-Authored-By: Bastian Kersting <bkersting@google.com>
Co-Authored-By: Bastian Kersting <bkersting@google.com>
Only check `SanitizerCfiMinimalRuntimeRequiresCfiRecoverOrDiag` if CFI
is actually enabled.

Use `is_sanitizer_cfi_minimal_runtime_enabled()` helper within
`link.rs`.
This is a part of the stack-protector work.

Adding support for merge-functions is not strictly needed, but it does
prevent breakage if the GCC function merging logic changes.

Not adding tests for -Z merge-functions since I don't see any such tests for the
LLVM side of it.
we can pass it by reference when we have it (loan traversal), and use the one in regioncx's LivenessValues
when we don't have it already in scope (MIR dump traversal)
we're really deferring the region liveness computation to become on-demand, "deferred locals" is slightly inaccurate
in that some of the local's type data is also necessary for drop-liveness. we can focus on the output of the computation
rather than its inputs.

it also allows us to rename the suboptimal set of locals `deferred` colliding with `deferred_locals`
rename the various `deferred` to mention locals, now that `DeferredLocals` doesn't use `deferred_locals`
by not calling `compute_relevant_live_locals`:
- remove free regions hashset allocation
- remove unused boring locals allocation
- remove relevant locals vec allocation
- directly build relevant locals with nll_boring locals filtering

we could also optimize the boring nll locals hashset but it's unclear whether it's worth it
compared to when it's being iterated.
…=rcvalle

Add support for -Zsanitizer-cfi-minimal-runtime

For production use, we should only link in the ubsan_minimal runtime,
instead of the complete ubsan runtime. This adds support for both
cfi-recover and cfi-diag to use the minimal runtime when
`-Zsanitizer-cfi-minimal-runtime` is specified.

This also includes tests, to ensure the flag can only be used if either
cfi-recover or cfi-diag is enabled, it doesn't disrupt the original
behavior, and links in the correct runtime when specified.

cc @1c3t3a

?r rcvalle
…ent, r=Urgau

[rustdoc] Fix invalid jump to def link when `#[rustc_allow_incoherent_impl]` is involved

Fixes rust-lang#163112.

Problem here is that the method is not available in the crate where the type is defined. So `def_path` is actually problematic here as it resolves to the end item, which is not what we want. So instead, I made a simplified version of the `rustc_middle::ty::print::pretty::try_print_visible_def_path_recur` function.

It's also needed for rust-lang#162808.

r? @Urgau
…ol-suggestion-parens, r=estebank

Fix suggestion for Option to bool with proper precedence handling

Fixes rust-lang#163213
…ogaloo, r=jackh726

More deferred liveness cleanups

r? @jackh726

As discussed on zulip as a follow-up to rust-lang#163166, this contains another batch of small cleanups in eager and deferred liveness:
- removes the location map Rc that killed our vibe
- adds some comments here and there
- some renamings like we discussed
- also I stole your idea to remove the unnecessary allocations to compute the polonius-relevant deferred locals by stealing the 1 function call in `compute_relevant_live_locals` :3
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc PG-exploit-mitigations Project group: Exploit mitigations 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Sep 25, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,test-x86_64-gnu-aux,test-x86_64-gnu-llvm-21-3,test-x86_64-msvc-1,test-aarch64-apple-1,test-aarch64-apple-2,test-x86_64-mingw-1,test-i686-msvc,test-armhf-gnu

@rust-bors

rust-bors Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 48a5fed has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Sep 25, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 25, 2026
Rollup of 7 pull requests


try-job: dist-various-1
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-gnu-llvm-21-3
try-job: test-x86_64-msvc-1
try-job: test-aarch64-apple-1
try-job: test-aarch64-apple-2
try-job: test-x86_64-mingw-1
try-job: test-i686-msvc
try-job: test-armhf-gnu
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 25, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #162493 (Add support for -Zsanitizer-cfi-minimal-runtime)
 - #163133 ([rustdoc] Fix invalid jump to def link when `#[rustc_allow_incoherent_impl]` is involved)
 - #163215 (Fix suggestion for Option to bool with proper precedence handling)
 - #163266 (More deferred liveness cleanups)
 - #163274 (Support -Z merge-functions with gcc and add stack-protector asm tests)
 - #163312 (Add rustdoc regression test for glob import of a crate that re-exports)
 - #163332 (Add some docs to `Global`)
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 25, 2026
@rust-bors

rust-bors Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

💔 Test for de937e7 failed: CI. Failed job:

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-aarch64-apple-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests/run-make/sanitizer-cfi-runtime stdout ----

error: rmake recipe failed to complete
status: exit status: 1
command: cd "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/sanitizer-cfi-runtime/rmake_out" && env -u RUSTFLAGS -u __STD_REMAP_DEBUGINFO_ENABLED AR="ar" BUILD_ROOT="/Users/runner/work/rust/rust/build/aarch64-apple-darwin" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC --target=arm64-apple-macosx -mmacosx-version-min=11 -w" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC --target=arm64-apple-macosx -mmacosx-version-min=11 -w -stdlib=libc++" DYLD_LIBRARY_PATH=":/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage0/lib/rustlib/aarch64-apple-darwin/lib" HOST_RUSTC_DYLIB_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib" LD_LIB_PATH_ENVVAR="DYLD_LIBRARY_PATH" LLVM_BIN_DIR="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils abi aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cas cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfodwarflowlevel debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dtlto dwarfcfichecker dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddirective frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes plugins powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support supportlsp symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/llvm/bin/FileCheck" NODE="/opt/homebrew/bin/node" PYTHON="/opt/homebrew/opt/python@3.14/bin/python3.14" RUSTC="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" RUSTDOC="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustdoc" SOURCE_ROOT="/Users/runner/work/rust/rust" TARGET="aarch64-apple-darwin" TARGET_EXE_DYLIB_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/aarch64-apple-darwin/lib" __BOOTSTRAP_JOBS="3" __RMAKE_VERBOSE_SUBPROCESS_OUTPUT="1" __RUSTC_DEBUG_ASSERTIONS_ENABLED="1" __STD_DEBUG_ASSERTIONS_ENABLED="1" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/sanitizer-cfi-runtime/rmake"
stdout: none
--- stderr -------------------------------
DYLD_LIBRARY_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/sanitizer-cfi-runtime/rmake_out:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib::/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage0/lib/rustlib/aarch64-apple-darwin/lib" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/sanitizer-cfi-runtime/rmake_out" "-Clto" "-Ccodegen-units=1" "-Ctarget-feature=-crt-static" "-Cunsafe-allow-abi-mismatch=sanitizer" "-Zsanitizer=cfi" "--print" "link-args" "program.rs" "--target=aarch64-apple-darwin"
output status: `exit status: 0`
=== STDOUT ===
env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/aarch64-apple-darwin/bin:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/lld/bin:/opt/homebrew/lib/ruby/gems/3.3.0/bin:/opt/homebrew/opt/ruby@3.3/bin:/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Users/runner/Library/Android/sdk/tools:/Users/runner/Library/Android/sdk/platform-tools:/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools" SDKROOT="/Applications/Xcode_26.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk" VSLANG="1033" ZERO_AR_DATE="1" "cc" "program.program.45572bc5f2b14090-cgu.0.rcgu.o" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-69e41eb2221682ad.rlib" "-lSystem" "-lc" "-lm" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/sanitizer-cfi-runtime/rmake_out" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/aarch64-apple-darwin/lib" "-o" "program" "-Wl,-dead_strip" "-nodefaultlibs"



=== STDERR ===



command failed at line 34
DYLD_LIBRARY_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/sanitizer-cfi-runtime/rmake_out:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib::/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage0/lib/rustlib/aarch64-apple-darwin/lib" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/sanitizer-cfi-runtime/rmake_out" "-Clto" "-Ccodegen-units=1" "-Ctarget-feature=-crt-static" "-Cunsafe-allow-abi-mismatch=sanitizer" "-Zsanitizer=cfi" "-Zsanitizer-cfi-diag=true" "--print" "link-args" "program.rs" "--target=aarch64-apple-darwin"
output status: `exit status: 1`
=== STDOUT ===
env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/aarch64-apple-darwin/bin:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/lld/bin:/opt/homebrew/lib/ruby/gems/3.3.0/bin:/opt/homebrew/opt/ruby@3.3/bin:/Users/runner/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Users/runner/Library/Android/sdk/tools:/Users/runner/Library/Android/sdk/platform-tools:/Library/Frameworks/Python.framework/Versions/Current/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools" SDKROOT="/Applications/Xcode_26.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-Wl,-rpath,/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/aarch64-apple-darwin/lib" "-lrustc-nightly_rt.ubsan" "program.program.45572bc5f2b14090-cgu.0.rcgu.o" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-69e41eb2221682ad.rlib" "-lSystem" "-lc" "-lm" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/sanitizer-cfi-runtime/rmake_out" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/aarch64-apple-darwin/lib" "-o" "program" "-Wl,-dead_strip" "-nodefaultlibs"



=== STDERR ===
error: linking with `cc` failed: exit status: 1
  |
  = note:  "cc" "-Wl,-rpath,<sysroot>/lib/rustlib/aarch64-apple-darwin/lib" "-lrustc-nightly_rt.ubsan" "<1 object files omitted>" "<sysroot>/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-*.rlib" "-lSystem" "-lc" "-lm" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/sanitizer-cfi-runtime/rmake_out" "-L" "<sysroot>/lib/rustlib/aarch64-apple-darwin/lib" "-o" "program" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: ld: library 'rustc-nightly_rt.ubsan' not found
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: aborting due to 1 previous error
------------------------------------------

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 26, 2026
@rust-bors

rust-bors Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 4bb4745 failed: CI. Failed job:

@rust-bors

rust-bors Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

PR #162493, which is a member of this rollup, was unapproved.

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants