Skip to content

Rollup of 7 pull requests #143211

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

Closed
wants to merge 15 commits into from

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Jun 29, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

compiler-errors and others added 15 commits June 27, 2025 16:29
- Update ui.md
- Update type-alias-impl-trait.md
- Update README.md
`tests/ui`: A New Order [13/N]

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang#133895.

r? `@jieyouxu`
…r=lcnr

Use let chains in the new solver

Self-explanatory

Let chains are stable as of today

r? lcnr
…rait, r=workingjubilee

inherit `#[align]` from trait method prototypes

`@workingjubilee` this seems straightforward enough. Now that we're planning to make `-Cmin-function-alignment` a target modifier, I don't think there are any cross-crate complications here?

`@Jules-Bertholet` is this the behavior you had in mind? In particular the inheritance of the attribute of a default impl is maybe a bit unintuitive at first? (but I think it's ok if that behavior is explicitly documented).

r? ghost
fix typos and improve clarity in documentation

```
Description:

This pull request corrects minor typos and improves wording for clarity across several documentation files, including:

- Correcting instrinsics → intrinsics
- Correcting preferrably → preferably
- Correcting Orginally → Originally
-  Correcting resiliant → resilient

```
…-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`
Re-disable `tests/run-make/short-ice` on Windows MSVC again

We tried to re-enable this for MSVC in rust-lang#142844.

Unfortunately, this test still sometimes fails on Windows MSVC.
Tracked in rust-lang#143198.

FYI `@dpaoliello` (I couldn't reproduce this easily locally either)
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-tidy Area: The tidy tool 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Jun 29, 2025
@GuillaumeGomez
Copy link
Member Author

@bors r+ p=5 rollup=never

@bors
Copy link
Collaborator

bors commented Jun 29, 2025

📌 Commit e28298e has been approved by GuillaumeGomez

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

bors commented Jun 29, 2025

⌛ Testing commit e28298e with merge 012c38d...

bors added a commit that referenced this pull request Jun 29, 2025
Rollup of 7 pull requests

Successful merges:

 - #142429 (`tests/ui`: A New Order [13/N])
 - #143066 (Use let chains in the new solver)
 - #143156 (inherit `#[align]` from trait method prototypes)
 - #143176 (fix typos and improve clarity in documentation)
 - #143187 (Add my work email to mailmap)
 - #143194 (fix bitcast of single-element SIMD vectors)
 - #143199 (Re-disable `tests/run-make/short-ice` on Windows MSVC again)

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

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

Click to see the possible cause of the failure (guessed by this bot)
---- [codegen] tests/codegen/transmute-scalar.rs stdout ----

error: compilation failed!
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/codegen/transmute-scalar.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)" "-O" "-Cdebug-assertions=no" "--emit" "llvm-ir" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/transmute-scalar/transmute-scalar.ll" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-C" "opt-level=0" "-C" "no-prepopulate-passes"
stdout: none
--- stderr -------------------------------
warning: type `S` is more private than the item `single_element_simd_to_scalar`
##[warning]   --> /checkout/tests/codegen/transmute-scalar.rs:113:1
    |
113 | pub extern "C" fn single_element_simd_to_scalar(b: S) -> i64 {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `single_element_simd_to_scalar` is reachable at visibility `pub`
    |
note: but type `S` is only usable at visibility `pub(crate)`
   --> /checkout/tests/codegen/transmute-scalar.rs:107:1
    |
107 | struct S([i64; 1]);
    | ^^^^^^^^
    = note: `#[warn(private_interfaces)]` on by default

warning: type `S` is more private than the item `scalar_to_single_element_simd`
##[warning]   --> /checkout/tests/codegen/transmute-scalar.rs:121:1
    |
121 | pub extern "C" fn scalar_to_single_element_simd(b: i64) -> S {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `scalar_to_single_element_simd` is reachable at visibility `pub`
    |
note: but type `S` is only usable at visibility `pub(crate)`
   --> /checkout/tests/codegen/transmute-scalar.rs:107:1
    |
107 | struct S([i64; 1]);
    | ^^^^^^^^

---
   |              -------------------^^^
   |              |
   |              help: replace this with: `u8::from`

warning: `extern` fn uses type `S`, which is not FFI-safe
##[warning]   --> /checkout/tests/codegen/transmute-scalar.rs:113:52
    |
113 | pub extern "C" fn single_element_simd_to_scalar(b: S) -> i64 {
    |                                                    ^ not FFI-safe
    |
    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
    = note: this struct has unspecified layout
note: the type is defined here
   --> /checkout/tests/codegen/transmute-scalar.rs:107:1
    |
107 | struct S([i64; 1]);
    | ^^^^^^^^
    = note: `#[warn(improper_ctypes_definitions)]` on by default

warning: `extern` fn uses type `S`, which is not FFI-safe
##[warning]   --> /checkout/tests/codegen/transmute-scalar.rs:121:60
    |
121 | pub extern "C" fn scalar_to_single_element_simd(b: i64) -> S {
    |                                                            ^ not FFI-safe
    |
    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
    = note: this struct has unspecified layout
note: the type is defined here
   --> /checkout/tests/codegen/transmute-scalar.rs:107:1
    |
107 | struct S([i64; 1]);
    | ^^^^^^^^

error: this function definition uses SIMD vector type `S` which (with the chosen ABI) requires the `simd128` target feature, which is not enabled
##[error]   --> /checkout/tests/codegen/transmute-scalar.rs:113:1
    |
113 | pub extern "C" fn single_element_simd_to_scalar(b: S) -> i64 {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
    |
    = help: consider enabling it globally (`-C target-feature=+simd128`) or locally (`#[target_feature(enable="simd128")]`)

error: this function definition uses SIMD vector type `S` which (with the chosen ABI) requires the `simd128` target feature, which is not enabled
##[error]   --> /checkout/tests/codegen/transmute-scalar.rs:121:1
    |
121 | pub extern "C" fn scalar_to_single_element_simd(b: i64) -> S {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
    |
    = help: consider enabling it globally (`-C target-feature=+simd128`) or locally (`#[target_feature(enable="simd128")]`)

error: aborting due to 2 previous errors; 6 warnings emitted
------------------------------------------


@bors
Copy link
Collaborator

bors commented Jun 29, 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 Jun 29, 2025
@GuillaumeGomez GuillaumeGomez deleted the rollup-ug242zk branch June 30, 2025 09:07
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-tidy Area: The tidy tool rollup A PR which is a rollup 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. 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.