Skip to content

Rollup of 11 pull requests #141688

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 25 commits into from
Closed

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented May 28, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

beetrees and others added 25 commits March 9, 2025 19:03
It uses the file metadata on Unix with a fallback for files incorrectly
reported as zero-sized. It uses `GetFileSizeEx` on Windows.

This reduces the number of syscalls needed for determining the file size
of an open file from 3 to 1.
It can only describe the inner workings of the default implementation,
other implementations might not be implemented using seeks at all.
This adds running of cargo's tests to the aarch64-apple-darwin job. The
reason for this is that tier-1 targets are ostensibly supposed to run
tests for host tools, but we are not doing that here. We do have fairly
good coverage in Cargo's CI, but we don't have much coverage of beta or
stable. I think it would be good to have a fallback here.
Would otherwise fail on:

```
thread 'fs::tests::test_eq_windows_file_type' panicked at library/std/src/test_helpers.rs:53:20:
called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access is denied." }
```

This came from the read-only attribute set on the test file. In order to
fix this, instead of simply disabling the test, the attribute is reset
before the test's end so it may still run successfully.

Signed-off-by: Paul Mabileau <paul.mabileau@harfanglab.fr>
…nton

Optimize `Seek::stream_len` impl for `File`

It uses the file metadata on Unix with a fallback for files incorrectly reported as zero-sized. It uses `GetFileSizeEx` on Windows.

This reduces the number of syscalls needed for determining the file size of an open file from 3 to 1.
…ross,bjorn3

Stabilize `repr128`

## Stabilisation report

The `repr128` feature ([tracking issue](rust-lang#56071)) allows the use of `#[repr(u128)]` and `#[repr(i128)]` on enums in the same way that other primitive representations such as `#[repr(u64)]` can be used. For example:

```rust
#[repr(u128)]
enum Foo {
    One = 1,
    Two,
    Big = u128::MAX,
}

#[repr(i128)]
enum Bar {
    HasThing(u16) = 42,
    HasSomethingElse(i64) = u64::MAX as i128 + 1,
    HasNothing,
}
```

This is the final part of adding 128-bit integers to Rust ([RFC 1504](https://rust-lang.github.io/rfcs/1504-int128.html)); all other parts of 128-bit integer support were stabilised in rust-lang#49101 back in 2018.

From a design perspective, `#[repr(u128)]`/`#[repr(i128)]` function like `#[repr(u64)]`/`#[repr(i64)]` but for 128-bit integers instead of 64-bit integers. The only differences are:

- FFI safety: as `u128`/`i128` are not currently considered FFI safe, neither are `#[repr(u128)]`/`#[repr(i128)]` enums (I discovered this wasn't the case while drafting this stabilisation report, so I have submitted rust-lang#138282 to fix this).
- Debug info: while none of the major debuggers currently support 128-bit integers, as of LLVM 20 `rustc` will emit valid debuginfo for both DWARF and PDB (PDB makes use of the same natvis that is also used for all enums with fields, whereas DWARF has native support).

Tests for `#[repr(u128)]`/`#[repr(i128)]` enums include:
- [ui/enum-discriminant/repr128.rs](https://github.com/rust-lang/rust/blob/385970f0c1fd0c09bac426b02f38300c0b1ba9a2/tests/ui/enum-discriminant/repr128.rs): checks that 128-bit enum discriminants have the correct values.
- [debuginfo/msvc-pretty-enums.rs](https://github.com/rust-lang/rust/blob/385970f0c1fd0c09bac426b02f38300c0b1ba9a2/tests/debuginfo/msvc-pretty-enums.rs): checks the PDB debuginfo is correct.
- [run-make/repr128-dwarf](https://github.com/rust-lang/rust/blob/385970f0c1fd0c09bac426b02f38300c0b1ba9a2/tests/run-make/repr128-dwarf/rmake.rs): checks the DWARF debuginfo is correct.

Stabilising this feature does not require any changes to the Rust Reference as [the documentation on primitive representations](https://doc.rust-lang.org/nightly/reference/type-layout.html#r-layout.repr.primitive.intro) already includes `u128` and `i128`.

Closes rust-lang#56071
Closes rust-lang/reference#1368

r? lang

`@rustbot` label +I-lang-nominated +T-lang
…_file_type, r=ChrisDenton

Test(fs): Fix `test_eq_windows_file_type` for Windows 7

Would otherwise fail on:

```
thread 'fs::tests::test_eq_windows_file_type' panicked at library/std/src/test_helpers.rs:53:20:
called `Result::unwrap()` on an `Err` value: Os { code: 5, kind: PermissionDenied, message: "Access is denied." }
```

This came from the read-only attribute set on the test file. In order to fix this, instead of simply disabling the test, the attribute is reset before the test's end so it may still run successfully.

`@rustbot` label T-libs A-filesystem A-testsuite O-windows-7 O-windows-msvc
Path::with_extension: show that it adds an extension where one did no…

…t exist

I think the times I encountered this, I had to check first if files without extensions were added, since all examples only had files with existing extensions.

Also, this replaced example already has a similar example below.
clean up old rintf leftovers

As usual stdarch needed special treatment due to rust-lang/stdarch#1655, and apparently I forgot to clean up these leftovers here. They can be removed now.
coretests: extend and simplify float tests

Also de-duplicate tests by removing a ui test that duplicates the tests in core.
r? `@tgross35`
…=Kobzol

ci: move tests from x86_64-gnu-llvm-19 job to aarch64
Call out possibility of invariant result in variance markers

ref rust-lang#135806 (comment)
ci: verify that codebuild jobs use ghcr.io
…ieni,jieyouxu

CI: Add cargo tests to aarch64-apple-darwin

This adds running of cargo's tests to the aarch64-apple-darwin job. The reason for this is that tier-1 targets are ostensibly supposed to run tests for host tools, but we are not doing that here. We do have fairly good coverage in Cargo's CI, but we don't cover the beta or stable branches here. I think it would be good to have a fallback here.

I think this should only add about 7 minutes of CI time, but I have not measured it. The current job is about 1.5 hours.

In summary of the tier-1 targets:

| Target | rust-lang/cargo | rust-lang/rust |
|--------|-----------------|----------------|
| aarch64-apple-darwin | stable/nightly | ❌ (this PR) |
| aarch64-unknown-linux-gnu | stable/nightly | ✓ |
| x86_64-apple-darwin | nightly | ❌ |
| x86_64-pc-windows-gnu | nightly | ❌ |
| x86_64-pc-windows-msvc | stable | ✓ |
| x86_64-unknown-linux-gnu | stable/beta/nightly | ✓ |
| i686-pc-windows-msvc | ❌ | ❌ |
| i686-unknown-linux-gnu | ❌ | ❌ |

try-job: aarch64-apple
interpret/allocation: Fixup type for `alloc_bytes`

This can be `FnOnce`, which helps us avoid an extra clone in rust-lang/miri#4343

r? RalfJung
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool O-windows Operating system: Windows labels May 28, 2025
@rustbot rustbot added 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. rollup A PR which is a rollup labels May 28, 2025
@jieyouxu
Copy link
Member Author

@bors r+ rollup=never p=6 (includes a p=5)

@bors
Copy link
Collaborator

bors commented May 28, 2025

📌 Commit d39800b has been approved by jieyouxu

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 May 28, 2025
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
+    |            ^^^^^^^
+    |
+    = note: `#[warn(stable_features)]` on by default
+ 
1 error: `extern` block uses type `U`, which is not FFI-safe
2   --> $DIR/lint-ctypes-enum.rs:84:14
3    |

281    = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
282    = note: enum has no representation hint
283 
- error: aborting due to 29 previous errors
+ error: aborting due to 29 previous errors; 1 warning emitted
285 
286 
---
To only update this specific test, also pass `--test-args lint/lint-ctypes-enum.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/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/lint/lint-ctypes-enum.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/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--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/aarch64-unknown-linux-gnu/test/ui/lint/lint-ctypes-enum" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
warning: the feature `repr128` has been stable since 1.89.0-nightly and no longer requires an attribute to enable
##[warning]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:5:12
   |
LL | #![feature(repr128)]
   |            ^^^^^^^
   |
   = note: `#[warn(stable_features)]` on by default

error: `extern` block uses type `U`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:84:14
   |
LL |     fn uf(x: U); //~ ERROR `extern` block uses type `U`
   |              ^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint
note: the type is defined here
  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:11:1
   |
LL | enum U {
   | ^^^^^^
note: the lint level is defined here
  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:2:9
   |
LL | #![deny(improper_ctypes)]
   |         ^^^^^^^^^^^^^^^

error: `extern` block uses type `B`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:85:14
   |
LL |     fn bf(x: B); //~ ERROR `extern` block uses type `B`
   |              ^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint
note: the type is defined here
  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:14:1
   |
LL | enum B {
   | ^^^^^^

error: `extern` block uses type `T`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:86:14
   |
LL |     fn tf(x: T); //~ ERROR `extern` block uses type `T`
   |              ^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint
note: the type is defined here
  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:18:1
   |
LL | enum T {
   | ^^^^^^

error: `extern` block uses type `U128`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:90:21
   |
LL |     fn repr_u128(x: U128); //~ ERROR `extern` block uses type `U128`
   |                     ^^^^ not FFI-safe
   |
   = note: 128-bit integers don't currently have a known stable ABI
note: the type is defined here
  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:46:1
   |
LL | enum U128 {
   | ^^^^^^^^^

error: `extern` block uses type `I128`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:91:21
   |
LL |     fn repr_i128(x: I128); //~ ERROR `extern` block uses type `I128`
   |                     ^^^^ not FFI-safe
   |
   = note: 128-bit integers don't currently have a known stable ABI
note: the type is defined here
  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:53:1
   |
LL | enum I128 {
   | ^^^^^^^^^

error: `extern` block uses type `u128`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:100:31
   |
LL |     fn option_nonzero_u128(x: Option<num::NonZero<u128>>);
   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = note: 128-bit integers don't currently have a known stable ABI

error: `extern` block uses type `i128`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:107:31
   |
LL |     fn option_nonzero_i128(x: Option<num::NonZero<i128>>);
   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = note: 128-bit integers don't currently have a known stable ABI

error: `extern` block uses type `Option<TransparentUnion<NonZero<u8>>>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:112:36
   |
LL |     fn option_transparent_union(x: Option<TransparentUnion<num::NonZero<u8>>>);
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Option<Rust<NonZero<u8>>>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:114:28
   |
LL |     fn option_repr_rust(x: Option<Rust<num::NonZero<u8>>>); //~ ERROR `extern` block uses type
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Option<u8>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:115:21
   |
LL |     fn option_u8(x: Option<u8>); //~ ERROR `extern` block uses type
   |                     ^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `u128`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:125:33
   |
LL |     fn result_nonzero_u128_t(x: Result<num::NonZero<u128>, ()>);
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = note: 128-bit integers don't currently have a known stable ABI

error: `extern` block uses type `i128`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:132:33
   |
LL |     fn result_nonzero_i128_t(x: Result<num::NonZero<i128>, ()>);
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = note: 128-bit integers don't currently have a known stable ABI

error: `extern` block uses type `Result<TransparentUnion<NonZero<u8>>, ()>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:137:38
   |
LL |     fn result_transparent_union_t(x: Result<TransparentUnion<num::NonZero<u8>>, ()>);
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<Rust<NonZero<u8>>, ()>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:139:30
   |
LL |     fn result_repr_rust_t(x: Result<Rust<num::NonZero<u8>>, ()>);
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<NonZero<u8>, U>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:143:51
   |
LL |     fn result_1zst_exhaustive_single_variant_t(x: Result<num::NonZero<u8>, U>);
   |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<NonZero<u8>, B>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:145:53
   |
LL |     fn result_1zst_exhaustive_multiple_variant_t(x: Result<num::NonZero<u8>, B>);
   |                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<NonZero<u8>, NonExhaustive>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:147:51
   |
LL |     fn result_1zst_non_exhaustive_no_variant_t(x: Result<num::NonZero<u8>, NonExhaustive>);
   |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<NonZero<u8>, Field>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:150:49
   |
LL |     fn result_1zst_exhaustive_single_field_t(x: Result<num::NonZero<u8>, Field>);
   |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<Result<(), NonZero<u8>>, ()>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:152:30
   |
LL |     fn result_cascading_t(x: Result<Result<(), num::NonZero<u8>>, ()>);
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `u128`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:163:33
   |
LL |     fn result_nonzero_u128_e(x: Result<(), num::NonZero<u128>>);
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = note: 128-bit integers don't currently have a known stable ABI

error: `extern` block uses type `i128`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:170:33
   |
LL |     fn result_nonzero_i128_e(x: Result<(), num::NonZero<i128>>);
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = note: 128-bit integers don't currently have a known stable ABI

error: `extern` block uses type `Result<(), TransparentUnion<NonZero<u8>>>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:175:38
   |
LL |     fn result_transparent_union_e(x: Result<(), TransparentUnion<num::NonZero<u8>>>);
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<(), Rust<NonZero<u8>>>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:177:30
   |
LL |     fn result_repr_rust_e(x: Result<(), Rust<num::NonZero<u8>>>);
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<U, NonZero<u8>>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:181:51
   |
LL |     fn result_1zst_exhaustive_single_variant_e(x: Result<U, num::NonZero<u8>>);
   |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<B, NonZero<u8>>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:183:53
   |
LL |     fn result_1zst_exhaustive_multiple_variant_e(x: Result<B, num::NonZero<u8>>);
   |                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<NonExhaustive, NonZero<u8>>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:185:51
   |
LL |     fn result_1zst_non_exhaustive_no_variant_e(x: Result<NonExhaustive, num::NonZero<u8>>);
   |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<Field, NonZero<u8>>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:188:49
   |
LL |     fn result_1zst_exhaustive_single_field_e(x: Result<Field, num::NonZero<u8>>);
   |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<(), Result<(), NonZero<u8>>>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:190:30
   |
LL |     fn result_cascading_e(x: Result<(), Result<(), num::NonZero<u8>>>);
   |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: `extern` block uses type `Result<(), ()>`, which is not FFI-safe
##[error]  --> /checkout/tests/ui/lint/lint-ctypes-enum.rs:192:27
   |
LL |     fn result_unit_t_e(x: Result<(), ()>);
   |                           ^^^^^^^^^^^^^^ not FFI-safe
   |
   = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
   = note: enum has no representation hint

error: aborting due to 29 previous errors; 1 warning emitted
------------------------------------------


@jieyouxu
Copy link
Member Author

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 28, 2025
@jieyouxu jieyouxu mentioned this pull request May 28, 2025
@jieyouxu jieyouxu closed this May 28, 2025
@jieyouxu jieyouxu deleted the rollup-unafnwx branch May 28, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-json Area: Rustdoc JSON backend A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.