Skip to content

Rollup of 12 pull requests #143313

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 36 commits into from
Closed

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Jul 2, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

xizheyin and others added 30 commits June 2, 2025 17:45
The skipped test passes since nightly-2024-11-29. Let's stop skipping
it to increase the chance of detecing a regression.
compiletest has confusingly two terminology to refer to the same concept
-- "headers" and "directives". To make this more self-consistent and
less confusing, stick with "directives" only.

This commit **intentionally** tries to be limited to move-only (modulo
some key usage reference renames) to help git history.
Explain `TOCTOU` on the top of `std::fs`, and reference it in functions

Fixes rust-lang#141837

r? ```@workingjubilee```
…ilee

Expose elf abi on ppc64 targets

Fixes rust-lang#60617 (after MCP rust-lang/compiler-team#885 is accepted) by exposing the abi information on ppc64 targets.
Conditional compilation can now use `cfg(target_abi = "elfv1")` or `cfg(target_abi = "elfv2")` to determine the abi in use.

Technical details are included in the other PR rust-lang#142598
ci: aarch64-gnu: Stop skipping `panic_abort_doc_tests`

The skipped test passes since `nightly-2024-11-29`. See rust-lang#123733 (comment) and rust-lang#123733 (comment) for more info.

Let's stop skipping it to increase the chance of detecting a regression.

r? ```@cuviper``` who added the skip in rust-lang#123828

Also see rust-lang#142304 for an alternative regression test that I am hoping to also land in the near future to complement the test we now stop skipping, but I need to investigate that setup more.
…-traits, r=tgross35

avoid suggesting traits from private dependencies

fixes rust-lang#142676
fixes rust-lang#138191

r? ```@tgross35```
…-bitcast, r=workingjubilee

fix bitcast of single-element SIMD vectors

in effect this reverts rust-lang#142768 and adds additional tests. That PR relaxed the conditions on an early return in an incorrect way that would create broken LLVM IR.

https://godbolt.org/z/PaaGWTv5a

```rust
#![feature(repr_simd)]

#[repr(simd)]
#[derive(Clone, Copy)]
struct S([i64; 1]);

#[no_mangle]
pub extern "C" fn single_element_simd(b: S) -> i64 {
    unsafe { std::mem::transmute(b) }
}
```
at the time of writing generates this LLVM IR, where the type of the return is different from the function's return type.

```llvm
define noundef i64 ```@single_element_simd(<1``` x i64> %b) unnamed_addr {
start:
  ret <1 x i64> %b
}
```

The test output is actually the same for the existing tests, showing that the change didn't actually matter for any tested behavior. It is probably a bit faster to do the early return, but, well, it's incorrect in general.

zullip thread: [#t-compiler > Is transmuting a &rust-lang#96;T&rust-lang#96; to &rust-lang#96;Tx1&rust-lang#96; (one-element SIMD vector) UB?](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/with/526262799)
cc ```@sayantn```
r? ```@scottmcm```
jhpratt added 5 commits July 2, 2025 07:38
Suggest use another lifetime specifier instead of underscore lifetime

cc rust-lang#143152

r? compiler
…, r=Kobzol

[COMPILETEST-UNTANGLE 3/N] Use "directives" consistently within compiletest

Instead of using *both* "headers" and "directives" within compiletest to refer to the same thing. This of course induces some churn, but it's been bugging me for a while, and I rather do the self-consistency changes now than later.

The first commit tries to be mostly move-only to help per-file git history.

I intend to revisit rustc-dev-guide's testing docs, but I don't want to do it on rust-lang/rust side because it would need syncing and might conflict.
…e, r=oli-obk

Don't recompute `DisambiguatorState` for every RPITIT in trait definition

The `associated_type_for_impl_trait_in_trait` currently needs to rerun the `RPITVisitor` for every RPITIT to compute its disambiguator.

Instead of synthesizing all of the RPITITs def ids one at a time in different queries, just synthesize them inside of the `associated_types_for_impl_traits_in_associated_fn` query. There we can just share the same `DisambiguatorState` for all the RPITITs in one function signature.

r? ```@Zoxc``` or ```@oli-obk``` cc rust-lang#140453
Use the correct export kind for __rust_alloc_error_handler_should_panic

Fixes rust-lang#143253

`__rust_alloc_error_handler_should_panic` is a static but was being exported as a function.

For most targets this doesn't matter, but Arm64EC Windows uses different decorations for exported variables vs functions, hence it fails to link when `-Z oom=abort` is enabled.

Fix is to export the symbol as data.

r? ```@bjorn3```
ci: support optional jobs

try-job: optional-mingw-check-1
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc 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-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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 2, 2025
@jhpratt
Copy link
Member Author

jhpratt commented Jul 2, 2025

@bors r+ rollup=never p=5

@rustbot rustbot added the rollup A PR which is a rollup label Jul 2, 2025
@bors
Copy link
Collaborator

bors commented Jul 2, 2025

📌 Commit 87a74bd has been approved by jhpratt

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 Jul 2, 2025
@bors
Copy link
Collaborator

bors commented Jul 2, 2025

⌛ Testing commit 87a74bd with merge 4d9342a...

bors added a commit that referenced this pull request Jul 2, 2025
Rollup of 12 pull requests

Successful merges:

 - #141847 (Explain `TOCTOU` on the top of `std::fs`, and reference it in functions)
 - #142138 (Add `Vec::into_chunks`)
 - #142321 (Expose elf abi on ppc64 targets)
 - #142886 (ci: aarch64-gnu: Stop skipping `panic_abort_doc_tests`)
 - #143038 (avoid suggesting traits from private dependencies)
 - #143194 (fix bitcast of single-element SIMD vectors)
 - #143206 (Align attr fixes)
 - #143231 (Suggest use another lifetime specifier instead of underscore lifetime)
 - #143232 ([COMPILETEST-UNTANGLE 3/N] Use "directives" consistently within compiletest)
 - #143258 (Don't recompute `DisambiguatorState` for every RPITIT in trait definition)
 - #143260 (Use the correct export kind for __rust_alloc_error_handler_should_panic)
 - #143274 (ci: support optional jobs)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/attributes/fn-align-dyn.rs stdout ----

error: test run failed!
status: exit status: 134
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/attributes/fn-align-dyn" && RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUST_TEST_THREADS="4" "/wasmtime-v19.0.0-x86_64-linux/wasmtime" "run" "-C" "cache=n" "--dir" "." "--env" "RUSTC_BOOTSTRAP" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/attributes/fn-align-dyn/a.wasm"
stdout: none
--- stderr -------------------------------

thread 'main' panicked at /checkout/tests/ui/attributes/fn-align-dyn.rs:14:5:
assertion `left == right` failed
  left: 2
 right: 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: failed to run main module `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/attributes/fn-align-dyn/a.wasm`

Caused by:
    0: failed to invoke command default
    1: error while executing at wasm backtrace:
           0: 0x6b69 - a.wasm!abort
           1: 0x2891 - a.wasm!std::sys::pal::wasi::helpers::abort_internal::he0816b8c1fb7d912
           2: 0x12ca - a.wasm!std::process::abort::he2bfeb97273cff23
           3: 0x12c0 - a.wasm!__rustc[8af602e4efef08f7]::__rust_abort
           4:  0x415 - a.wasm!__rustc[8af602e4efef08f7]::__rust_start_panic
           5: 0x3bc6 - a.wasm!__rustc[8af602e4efef08f7]::rust_panic
           6: 0x3b4b - a.wasm!std::panicking::rust_panic_with_hook::hb95d79ebe903a606
           7: 0x2c41 - a.wasm!std::panicking::begin_panic_handler::{{closure}}::hd53d07bbf85834c1
           8: 0x2bad - a.wasm!std::sys::backtrace::__rust_end_short_backtrace::h221677bb5634f04c
           9: 0x3532 - a.wasm!__rustc[8af602e4efef08f7]::rust_begin_unwind
          10: 0x7e31 - a.wasm!core::panicking::panic_fmt::h021059fd8ef77a3d
          11: 0x8a04 - a.wasm!core::panicking::assert_failed_inner::hf6f388c91d70c3cb
          12: 0x8876 - a.wasm!core::panicking::assert_failed::h3c15f8e347bcca20
          13:  0x346 - a.wasm!fn_align_dyn::main::h593152a5eda5b822
          14:  0x2c6 - a.wasm!std::sys::backtrace::__rust_begin_short_backtrace::h516454a0d1e239ac
          15:  0x2b9 - a.wasm!std::rt::lang_start::{{closure}}::hd0f4bf49e60354a4
          16: 0x1769 - a.wasm!std::rt::lang_start_internal::hd2032cbb35e7660f
          17:  0x3af - a.wasm!__main_void
          18:  0x268 - a.wasm!_start
    2: wasm trap: wasm `unreachable` instruction executed
------------------------------------------


---- [ui] tests/ui/typeck/dont-suggest-private-dependencies.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/dont-suggest-private-dependencies/dont-suggest-private-dependencies.stderr`
---
-    |                ^^^^
6    |
- help: there is a method `read_at` with a similar name
8    |
- LL |         self.0.read_at(buf)
-    |                    +++
11 
12 error[E0599]: no function or associated item named `cast_from_lossy` found for type `u8` in the current scope
13   --> $DIR/dont-suggest-private-dependencies.rs:26:17


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args typeck/dont-suggest-private-dependencies.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/typeck/dont-suggest-private-dependencies.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=wasm32-wasip1" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/dont-suggest-private-dependencies" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/wasm32-wasip1/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/dont-suggest-private-dependencies/auxiliary" "-Zunstable-options" "--extern" "public_dep=/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/dont-suggest-private-dependencies/auxiliary/libpublic_dep.rlib"
stdout: none
--- stderr -------------------------------
error[E0599]: no method named `read` found for struct `Vec<u8>` in the current scope
##[error]  --> /checkout/tests/ui/typeck/dont-suggest-private-dependencies.rs:17:16
   |
LL |         self.0.read(buf)
   |                ^^^^ method not found in `Vec<u8>`

error[E0599]: no function or associated item named `cast_from_lossy` found for type `u8` in the current scope
##[error]  --> /checkout/tests/ui/typeck/dont-suggest-private-dependencies.rs:26:17
   |
LL |     let _ = u8::cast_from_lossy(9);
   |                 ^^^^^^^^^^^^^^^ function or associated item not found in `u8`

error[E0599]: no function or associated item named `foo` found for struct `B` in the current scope
##[error]  --> /checkout/tests/ui/typeck/dont-suggest-private-dependencies.rs:28:16
   |
LL |     let _ = B::foo();

@bors
Copy link
Collaborator

bors commented Jul 2, 2025

💔 Test failed - checks-actions

@bors bors 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 Jul 2, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 2, 2025
@jhpratt jhpratt deleted the rollup-55h4nj0 branch July 2, 2025 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc 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-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-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.