Skip to content

Rollup of 25 pull requests - #162300

Closed
GuillaumeGomez wants to merge 67 commits into
rust-lang:mainfrom
GuillaumeGomez:rollup-aWWJI58
Closed

Rollup of 25 pull requests#162300
GuillaumeGomez wants to merge 67 commits into
rust-lang:mainfrom
GuillaumeGomez:rollup-aWWJI58

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

Dnreikronos and others added 30 commits August 11, 2026 15:21
Store identity argument indices instead of bound generic arguments so
callers can index concrete alias arguments without changing rigidness
through instantiation.
Match the existing params_in_repr / unsizing_params convention;
the compiler already treats generic arg counts as u32-sized.
Treat missing outlives information as no restriction so all sources can be
intersected uniformly. Keep bivariant alias arguments out of the final region
walk.
This is mainly because it would be very useful in Clippy to have a fast
way to check if two DefIds are related (and what that relation is).
`User::new_uninit_bytes` and `User::drop` are asking the host to
alloc/dealloc memory with potentially mismatched alignment, as the
enclave side is unconditionally over-aligning on allocation but not
doing the same on free.

- Ex: `User::<ByteBuffer>` -> `alloc(_, align=8)` -> `drop()` -> `free(_, align=1)`

For most hosts running stock x86_64-linux + glibc malloc, I don't
believe this mismatch is an issue, since posix `free` ignores the
alignment anyway. My guess is that if you're using jemalloc, which does
care about the dealloc alignment, then something _might_ go wrong.

It's also not clear that we can just round-up the alignment on `free`,
since `User::from_raw` exists, and there's various places that call it
outside std.

We should probably just remove the min. alignment until we come up with
a more satisfactory solution. My guess is that the right place to do the
min. alignment optimization is in the host-side enclave-runner:
<https://github.com/fortanix/rust-sgx/blob/be93e7abe92eff4b5610e15fe21b16196ace1e6e/intel-sgx/enclave-runner-sgx/src/usercalls/mod.rs#L1596>
and other places that hand memory to the SGX enclave.

NB. The min. alignment exists for performance reasons (see:
`copy_from_userspace`). It's highly preferable if all memory copied from
userspace is at least 8 byte aligned, otherwise we have to fallback to a
super slow copy routine for the unaligned prefix (and suffix).
This attempts to match clang's behavior of implicitly disabling
sanitizers that are incompatible. Specifically, if a set of default
sanitizers would be incompatible with ones provided by -Zsanitize=...,
then clang (and now rust) will opt for keeping the ones specified via
flags over the ones used as platform defaults. This helps maintain build
consistency where we can just enable sanitizers via flags for both rust and
c++ code without needing to manually disable others.

The driving reason for this is asan and safestack where we'd like to
enable safestack by default for x86_64 fuchsia but disable it if
-Zsanitize=address is passed (matching clang's behavior).

This commit also refactors all uses of `self.opts.unstable_opts.sanitizer`
to go through the updated `sanitizer()` method.

AI: Gemini was used to help review the code and write some tests, but it
did not generate the whole patch. I edited and reviewed this PR to the
best of my ability before pushing for review.
This patch introduces the following:

* Extends `FnAbi` (`callconv`) with a `ptrauth_type_discriminator`
  field. This field is only used when emitting pointer authentication
  call bundles. It is stored in `FnAbi` because the call site is not
  guaranteed to have access to an `Instance`, so the discriminator
  cannot always be computed on demand.
* Adds support for `llvm.ptrauth.resign`. This intrinsic will be used
  when support for semantic transmute is added.
* Performs a minor API redesign as groundwork for allowing call sites to
  modify schemas in place.
This commit updates documentation, configuration, etc, within the
compiler to promote the `wasm32-wasip3` target to tier 2. This means
that precompiled binaries will be made available in `rustup` for usage.
This target MCP for this change is [rust-lang/compiler-team/100][mcp].

This target requires LLVM 23 which rustc recently has updated to, and
then additionally requires wasi-sdk-34 which additionally uses LLVM 23
which was also updated recently. With these ingredients in place the ABI
for `wasm32-wasip3` is all lined up and ready to go. These changes were
all necessary to bring cooperative threading to the target in the
future, but that's not quite ready in the ecosystem yet.

I've locally been testing this target and it's done well so far, but I
suspect this'll need subsequent bug fixes here and there as other new
issues crop up. I don't expect anything major will be necessary,
however.

[mcp]: rust-lang/compiler-team#1001
There are various types used to carry name resolution results across
crate boundaries. They are scattered across places like
`rustc_middle::ty`, `rustc_middle::metadata`, and `rustc_hir::def`.

This commit moves them into the new module, a more logical place for
them to live. As part of this it eliminates the small
`rustc_middle::metadata` module.

One nice consequence of this change: it removes the single use of a
`LocalDefId` in `rustc_ast`. (This is what got my attention in the first
place.)
@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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-rust-analyzer Relevant to the rust-analyzer 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 4, 2026
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

@bors r+ p=5

@rust-bors

rust-bors Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3463513 has been approved by GuillaumeGomez

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 4, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member

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

@rust-bors

This comment has been minimized.

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


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

This comment has been minimized.

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

Successful merges:

 - #159074 ([PAC] FnAbi, llvm.ptrauth.resign and Session API change (2/8))
 - #159792 (A more readable debug map for IndexMaps)
 - #160745 (make closures act like MaybeDangling)
 - #161895 (std::sys::pal::sgx: fix mismatched alloc/free alignment)
 - #161940 (Promote `wasm32-wasip3` to a tier 2 target)
 - #162072 (Add new Tier-3 target: `powerpc64-sony-ps3`)
 - #162179 (type system const items via direct rhs)
 - #162277 (Introduce `rustc_middle::middel::resolve`)
 - #162285 (box: fixup map/try_map deallocate calls)
 - #162286 (string: don't unwind prematurely)
 - #162289 (alloc: a bunch of safety comments)
 - #162292 (Update `askama` version to `0.16.1`)
 - #160509 (Remove `RegionExt`; move methods to `Region` in `rustc_type_ir`)
 - #160906 (Suggest usize instead of placeholder type for array length constants)
 - #160936 (traits: Represent live alias arguments as bitsets)
 - #161400 (Improve diagnostics for references to closures)
 - #161656 (Suggest mutable references for FnMut closure arguments)
 - #161711 (Add more splat fn type tests)
 - #161786 (Make `tcx.def_id_partial_cmp` public)
 - #161953 (sanitizers: Implicitly disable mutually exclusive sanitizers)
 - #162155 (add suggestion for `rustc_allowed_through_unstable_modules` attribute)
 - #162212 (Implement `Rng` for `Box`)
 - #162246 (Fix incorrect meta span)
 - #162266 (std: fix typo)
 - #162291 (Add regression test from 1.98.1)
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job dist-various-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] object test:false 6.087
warning: dropping unsupported crate type `dylib` for target `x86_64-fortanix-unknown-sgx`

error[E0308]: mismatched types
   --> /rustc/443d9e9fe234a8975eb84975a9276fc8e2b8c748/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs:260:76
    |
260 |             if let Ok(v) = crate::panic::catch_unwind(|| T::from_raw_sized(ptr, size)) {
    |                                                          ----------------- ^^^ types differ in mutability
    |                                                          |
    |                                                          arguments to this function are incorrect
    |
    = note: expected raw pointer `*mut u8`
               found raw pointer `*const _`
note: associated function defined here
   --> /rustc/443d9e9fe234a8975eb84975a9276fc8e2b8c748/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs:94:15
    |
 94 |     unsafe fn from_raw_sized(ptr: *mut u8, size: usize) -> NonNull<Self> {
    |               ^^^^^^^^^^^^^^ ------------

For more information about this error, try `rustc --explain E0308`.
[RUSTC-TIMING] std test:false 2.703
warning: `std` (lib) generated 1 warning

@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 4, 2026
@rust-bors

rust-bors Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 443d9e9 failed: CI. Failed job:

@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 4, 2026
@rust-bors

rust-bors Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

PR #161895, 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 4, 2026
@GuillaumeGomez
GuillaumeGomez deleted the rollup-aWWJI58 branch September 4, 2026 17:01
@rust-bors

rust-bors Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 0b1230a (0b1230acbe1f693f29d677d176eb6e09875ca90e)
Base parent: 0ed41eb (0ed41eb4142dda2df61eb1145a312c1a9d62eb56)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-testsuite Area: The testsuite used to check the correctness of rustc O-SGX Target: SGX rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure 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-rust-analyzer Relevant to the rust-analyzer 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.