Skip to content

Rip out rustc_layout_scalar_valid_range_* attribute support#155433

Open
oli-obk wants to merge 6 commits intorust-lang:mainfrom
oli-obk:bye-bye-long-attribute
Open

Rip out rustc_layout_scalar_valid_range_* attribute support#155433
oli-obk wants to merge 6 commits intorust-lang:mainfrom
oli-obk:bye-bye-long-attribute

Conversation

@oli-obk
Copy link
Copy Markdown
Contributor

@oli-obk oli-obk commented Apr 17, 2026

View all comments

And either removes tests for it or replaces the uses with pattern types.

primarily fixes #135996

fixes #147761
fixes #133652

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 17, 2026

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred to the CTFE machinery

cc @RalfJung, @lcnr

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

Some changes occurred in compiler/rustc_passes/src/check_attr.rs

cc @jdonszelmann, @JonathanBrouwer

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred in compiler/rustc_hir/src/attrs

cc @jdonszelmann, @JonathanBrouwer

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. labels Apr 17, 2026
@rustbot rustbot added T-compiler Relevant to the compiler 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. labels Apr 17, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 17, 2026

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 72 candidates
  • Random selection from 18 candidates

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Happy to review this
Love the branch name 🤣

r? me

Copy link
Copy Markdown
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert the rust-analyzer changes. r-a needs to support old compilers, and also it doesn't even properly support pattern types yet.

View changes since this review

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 17, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 17, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 17, 2026
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the bye-bye-long-attribute branch from c6053aa to cc13e2c Compare April 17, 2026 19:20
@mejrs
Copy link
Copy Markdown
Contributor

mejrs commented Apr 17, 2026

There is some prose in the dev guide that will no longer apply.

The other complicated safety check is for writes to fields of layout constrained structs (such as NonNull). These are found by looking for the borrow or assignment expression and then visiting the subexpression being borrowed or assigned with a separate visitor.

https://rustc-dev-guide.rust-lang.org/unsafety-checking.html?other-checks-involving-unsafe

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@oli-obk oli-obk force-pushed the bye-bye-long-attribute branch from cc13e2c to 663f77e Compare April 21, 2026 07:08
@rustbot

This comment has been minimized.

@oli-obk oli-obk force-pushed the bye-bye-long-attribute branch from 663f77e to c01a244 Compare April 21, 2026 07:09
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 21, 2026

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @tshepang

@rustbot rustbot added the A-rustc-dev-guide Area: rustc-dev-guide label Apr 21, 2026
@oli-obk oli-obk force-pushed the bye-bye-long-attribute branch from c01a244 to 07e6d54 Compare April 21, 2026 07:18
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the bye-bye-long-attribute branch from 07e6d54 to cbd6780 Compare April 21, 2026 09:42
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the bye-bye-long-attribute branch from cbd6780 to 4fb465f Compare April 21, 2026 12:16
@ShoyuVanilla
Copy link
Copy Markdown
Member

@bors r=RalfJung,ShoyuVanilla

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 27, 2026

📌 Commit e993ad9 has been approved by RalfJung,ShoyuVanilla

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 27, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 27, 2026
…RalfJung,ShoyuVanilla

Rip out rustc_layout_scalar_valid_range_* attribute support

And either removes tests for it or replaces the uses with pattern types.

primarily fixes rust-lang#135996

fixes rust-lang#147761
fixes rust-lang#133652
rust-bors Bot pushed a commit that referenced this pull request Apr 27, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #155760 (Remove `AttributeLintKind`)
 - #154510 (Partially stabilize LoongArch target features)
 - #155137 (Allow trailing `self` in more contexts)
 - #155433 (Rip out rustc_layout_scalar_valid_range_* attribute support)
 - #155702 (Change `ItemKind::Trait` to a field variant.)
 - #154896 (Fix ICE: Scalar layout for non-primitive non-enum type unsafe binder)
 - #155675 (Disallow non_exhaustive structs and enums with non_exhaustive variants from implementing `ConstParamTy`)
 - #155874 (Avoid misleading closure return type note)
 - #155876 (CI: rfl: move job forward to Linux v7.1-rc1)
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors r-
#155885 (comment)

@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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 27, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 27, 2026

This pull request was unapproved.

This PR was contained in a rollup (#155885), which was unapproved.

View changes since this unapproval

@oli-obk

This comment was marked as outdated.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
Rip out rustc_layout_scalar_valid_range_* attribute support


try-job: aarch64-msvc-1
@oli-obk

This comment was marked as outdated.

@rust-bors

This comment was marked as outdated.

@oli-obk oli-obk force-pushed the bye-bye-long-attribute branch from e993ad9 to 797b484 Compare April 29, 2026 09:57
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 29, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@oli-obk
Copy link
Copy Markdown
Contributor Author

oli-obk commented Apr 29, 2026

@bors try jobs=aarch64-msvc-1

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
Rip out rustc_layout_scalar_valid_range_* attribute support


try-job: aarch64-msvc-1
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 29, 2026

☔ The latest upstream changes (presumably #155775) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 29, 2026

💔 Test for 27ef644 failed: CI. Failed job:

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)

---- [debuginfo-cdb] tests\debuginfo\msvc-pretty-enums.rs stdout ----
------rustc.exe stdout------------------------------

------rustc.exe stderr------------------------------
error: only signed integer base types are allowed for or-pattern pattern types at present

warning: unnecessary `unsafe` block
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:328:38
    |
328 |     let wrapping_niche128_untagged = unsafe {
---
    |
330 |             std::mem::transmute(340282366920938463463374607431768211454)
    |             ^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `i32` (32 bits)
    = note: target type: `(u128) is (340282366920938463463374607431768211454.. | 0..=1)` (the type has an unknown layout)

warning: unused variable: `a`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:313:9
    |
313 |     let a = Some(CStyleEnum::Low);
    |         ^ help: if this is intentional, prefix it with an underscore: `_a`
    |
    = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default

warning: unused variable: `b`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:314:9
    |
314 |     let b = Option::<CStyleEnum>::None;
    |         ^ help: if this is intentional, prefix it with an underscore: `_b`

warning: unused variable: `c`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:315:9
    |
315 |     let c = NicheLayoutEnum::Tag1;
    |         ^ help: if this is intentional, prefix it with an underscore: `_c`

warning: unused variable: `d`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:316:9
    |
316 |     let d = NicheLayoutEnum::Data { my_data: CStyleEnum::High };
    |         ^ help: if this is intentional, prefix it with an underscore: `_d`

warning: unused variable: `e`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:317:9
    |
317 |     let e = NicheLayoutEnum::Tag2;
    |         ^ help: if this is intentional, prefix it with an underscore: `_e`

warning: unused variable: `f`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:318:9
    |
318 |     let f = Some(&1u32);
    |         ^ help: if this is intentional, prefix it with an underscore: `_f`

warning: unused variable: `g`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:319:9
    |
319 |     let g = Option::<&'static u32>::None;
    |         ^ help: if this is intentional, prefix it with an underscore: `_g`

warning: unused variable: `h`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:320:9
    |
320 |     let h = Some(12u32);
---

warning: unused variable: `j`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:322:9
    |
322 |     let j = CStyleEnum::High;
    |         ^ help: if this is intentional, prefix it with an underscore: `_j`

warning: unused variable: `k`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:323:9
    |
323 |     let k = Some("IAMA optional string!".to_string());
    |         ^ help: if this is intentional, prefix it with an underscore: `_k`

warning: unused variable: `l`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:324:9
    |
324 |     let l = Result::<u32, Empty>::Ok(42);
    |         ^ help: if this is intentional, prefix it with an underscore: `_l`

warning: unused variable: `niche128_some`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:325:9
    |
325 |     let niche128_some = NonZero::new(123456i128);
    |         ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche128_some`

warning: unused variable: `niche128_none`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:326:9
    |
326 |     let niche128_none: Option<NonZero<i128>> = None;
    |         ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche128_none`

warning: unused variable: `wrapping_niche128_untagged`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:328:9
    |
328 |     let wrapping_niche128_untagged = unsafe {
---

warning: unused variable: `direct_tag_128_a`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:336:9
    |
336 |     let direct_tag_128_a = DirectTag128::A(42);
    |         ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_direct_tag_128_a`

warning: unused variable: `direct_tag_128_b`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:337:9
    |
337 |     let direct_tag_128_b = DirectTag128::B(137);
    |         ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_direct_tag_128_b`

warning: unused variable: `niche_w_fields_1_some`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:339:9
    |
339 |     let niche_w_fields_1_some = NicheLayoutWithFields1::A(&77, 7);
    |         ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_1_some`

warning: unused variable: `niche_w_fields_1_none`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:340:9
    |
340 |     let niche_w_fields_1_none = NicheLayoutWithFields1::B(99);
    |         ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_1_none`

warning: unused variable: `niche_w_fields_2_some`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:342:9
    |
342 |     let niche_w_fields_2_some = NicheLayoutWithFields2::A(NonZero::new(800).unwrap(), 900);
    |         ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_2_some`

warning: unused variable: `niche_w_fields_2_none`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:343:9
    |
343 |     let niche_w_fields_2_none = NicheLayoutWithFields2::B(1000);
    |         ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_2_none`

warning: unused variable: `niche_w_fields_3_some`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:345:9
    |
345 |     let niche_w_fields_3_some = NicheLayoutWithFields3::A(137, true);
    |         ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_3_some`

warning: unused variable: `niche_w_fields_3_niche1`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:346:9
    |
346 |     let niche_w_fields_3_niche1 = NicheLayoutWithFields3::B(12);
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_3_niche1`

warning: unused variable: `niche_w_fields_3_niche2`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:347:9
    |
347 |     let niche_w_fields_3_niche2 = NicheLayoutWithFields3::C(false);
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_3_niche2`

warning: unused variable: `niche_w_fields_3_niche3`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:348:9
    |
348 |     let niche_w_fields_3_niche3 = NicheLayoutWithFields3::D(34);
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_3_niche3`

warning: unused variable: `niche_w_fields_3_niche4`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:349:9
    |
349 |     let niche_w_fields_3_niche4 = NicheLayoutWithFields3::E(56);
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_3_niche4`

warning: unused variable: `niche_w_fields_3_niche5`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:350:9
    |
350 |     let niche_w_fields_3_niche5 = NicheLayoutWithFields3::F;
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_3_niche5`

warning: unused variable: `niche_w_fields_std_result_ok`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:352:9
    |
352 |     let niche_w_fields_std_result_ok: Result<Box<[u8]>, u64> = Ok(vec![1, 2, 3].into());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_std_result_ok`

warning: unused variable: `niche_w_fields_std_result_err`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:353:9
    |
353 |     let niche_w_fields_std_result_err: Result<Box<[u8]>, u64> = Err(789);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_std_result_err`

warning: unused variable: `arbitrary_discr1`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:355:9
    |
355 |     let arbitrary_discr1 = ArbitraryDiscr::Abc(1234);
    |         ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_arbitrary_discr1`

warning: unused variable: `arbitrary_discr2`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:356:9
    |
356 |     let arbitrary_discr2 = ArbitraryDiscr::Def(5678);
    |         ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_arbitrary_discr2`

warning: unused variable: `c_style_u128_a`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:358:9
    |
358 |     let c_style_u128_a = CStyleU128::A;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_u128_a`

warning: unused variable: `c_style_u128_b`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:359:9
    |
359 |     let c_style_u128_b = CStyleU128::B;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_u128_b`

warning: unused variable: `c_style_u128_c`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:360:9
    |
360 |     let c_style_u128_c = CStyleU128::C;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_u128_c`

warning: unused variable: `c_style_u128_d`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:361:9
    |
361 |     let c_style_u128_d = CStyleU128::D;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_u128_d`

warning: unused variable: `c_style_i128_a`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:363:9
    |
363 |     let c_style_i128_a = CStyleI128::A;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_i128_a`

warning: unused variable: `c_style_i128_b`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:364:9
    |
364 |     let c_style_i128_b = CStyleI128::B;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_i128_b`

warning: unused variable: `c_style_i128_c`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:365:9
    |
365 |     let c_style_i128_c = CStyleI128::C;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_i128_c`

warning: unused variable: `c_style_i128_d`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:366:9
    |
366 |     let c_style_i128_d = CStyleI128::D;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_i128_d`

error: aborting due to 2 previous errors; 42 warnings emitted

For more information about this error, try `rustc --explain E0512`.

------------------------------------------

error: compilation failed!
status: exit code: 1
command: PATH="C:\a\rust\rust\build\aarch64-pc-windows-msvc\stage2\bin;C:\Program Files (x86)\Windows Kits\10\bin\arm64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\arm64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\HostARM64\arm64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\bin\HostARM64\arm64;C:\a\rust\rust\build\aarch64-pc-windows-msvc\bootstrap-tools\aarch64-pc-windows-msvc\release\deps;C:\Program Files\Git\clangarm64\bin;C:\Program Files\Git\usr\bin;C:\Users\runneradmin\bin;C:\a\rust\rust\ninja;C:\a\rust\rust\citools\clang-rust\bin;C:\a\rust\rust\sccache;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.9.3\x64;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files (x86)\R\R-4.5.3\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\usr\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.24.13\arm64\bin;C:\hostedtoolcache\windows\Python\3.13.13\arm64\Scripts;C:\hostedtoolcache\windows\Python\3.13.13\arm64;C:\hostedtoolcache\windows\Ruby\3.4.9\aarch64\bin;C:\Program Files\LLVM\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\21.0.10-7.0\aarch64\bin;C:\Tools\Ninja;C:\Program Files (x86)\ImageMagick-7.1.2-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\dotnet;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\130\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Microsoft SQL Server\160\DTS\Binn;C:\Program Files\Microsoft SQL Server\170\DTS\Binn;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.15\bin;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\clangarm64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps" "C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\stage2\\bin\\rustc.exe" "C:\\a\\rust\\rust\\tests\\debuginfo\\msvc-pretty-enums.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=C:\\Users\\runneradmin\\.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=C:\\a\\rust\\rust\\vendor" "--sysroot" "C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\stage2" "--target=aarch64-pc-windows-msvc" "--check-cfg" "cfg(test,FALSE)" "-C" "prefer-dynamic" "-o" "C:\\a\\rust\\rust\\build\\aarch64-pc-windows-msvc\\test\\debuginfo\\msvc-pretty-enums.cdb\\a.exe" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-g"
stdout: none
--- stderr -------------------------------
error: only signed integer base types are allowed for or-pattern pattern types at present

warning: unnecessary `unsafe` block
---
    |
330 |             std::mem::transmute(340282366920938463463374607431768211454)
    |             ^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `i32` (32 bits)
    = note: target type: `(u128) is (340282366920938463463374607431768211454.. | 0..=1)` (the type has an unknown layout)

warning: unused variable: `a`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:313:9
    |
313 |     let a = Some(CStyleEnum::Low);
    |         ^ help: if this is intentional, prefix it with an underscore: `_a`
    |
    = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default

warning: unused variable: `b`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:314:9
    |
314 |     let b = Option::<CStyleEnum>::None;
    |         ^ help: if this is intentional, prefix it with an underscore: `_b`

warning: unused variable: `c`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:315:9
    |
315 |     let c = NicheLayoutEnum::Tag1;
    |         ^ help: if this is intentional, prefix it with an underscore: `_c`

warning: unused variable: `d`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:316:9
    |
316 |     let d = NicheLayoutEnum::Data { my_data: CStyleEnum::High };
    |         ^ help: if this is intentional, prefix it with an underscore: `_d`

warning: unused variable: `e`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:317:9
    |
317 |     let e = NicheLayoutEnum::Tag2;
    |         ^ help: if this is intentional, prefix it with an underscore: `_e`

warning: unused variable: `f`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:318:9
    |
318 |     let f = Some(&1u32);
    |         ^ help: if this is intentional, prefix it with an underscore: `_f`

warning: unused variable: `g`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:319:9
    |
319 |     let g = Option::<&'static u32>::None;
    |         ^ help: if this is intentional, prefix it with an underscore: `_g`

warning: unused variable: `h`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:320:9
    |
320 |     let h = Some(12u32);
---

warning: unused variable: `j`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:322:9
    |
322 |     let j = CStyleEnum::High;
    |         ^ help: if this is intentional, prefix it with an underscore: `_j`

warning: unused variable: `k`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:323:9
    |
323 |     let k = Some("IAMA optional string!".to_string());
    |         ^ help: if this is intentional, prefix it with an underscore: `_k`

warning: unused variable: `l`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:324:9
    |
324 |     let l = Result::<u32, Empty>::Ok(42);
    |         ^ help: if this is intentional, prefix it with an underscore: `_l`

warning: unused variable: `niche128_some`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:325:9
    |
325 |     let niche128_some = NonZero::new(123456i128);
    |         ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche128_some`

warning: unused variable: `niche128_none`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:326:9
    |
326 |     let niche128_none: Option<NonZero<i128>> = None;
    |         ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche128_none`

warning: unused variable: `wrapping_niche128_untagged`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:328:9
    |
328 |     let wrapping_niche128_untagged = unsafe {
---

warning: unused variable: `direct_tag_128_a`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:336:9
    |
336 |     let direct_tag_128_a = DirectTag128::A(42);
    |         ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_direct_tag_128_a`

warning: unused variable: `direct_tag_128_b`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:337:9
    |
337 |     let direct_tag_128_b = DirectTag128::B(137);
    |         ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_direct_tag_128_b`

warning: unused variable: `niche_w_fields_1_some`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:339:9
    |
339 |     let niche_w_fields_1_some = NicheLayoutWithFields1::A(&77, 7);
    |         ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_1_some`

warning: unused variable: `niche_w_fields_1_none`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:340:9
    |
340 |     let niche_w_fields_1_none = NicheLayoutWithFields1::B(99);
    |         ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_1_none`

warning: unused variable: `niche_w_fields_2_some`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:342:9
    |
342 |     let niche_w_fields_2_some = NicheLayoutWithFields2::A(NonZero::new(800).unwrap(), 900);
    |         ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_2_some`

warning: unused variable: `niche_w_fields_2_none`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:343:9
    |
343 |     let niche_w_fields_2_none = NicheLayoutWithFields2::B(1000);
    |         ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_2_none`

warning: unused variable: `niche_w_fields_3_some`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:345:9
    |
345 |     let niche_w_fields_3_some = NicheLayoutWithFields3::A(137, true);
    |         ^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_3_some`

warning: unused variable: `niche_w_fields_3_niche1`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:346:9
    |
346 |     let niche_w_fields_3_niche1 = NicheLayoutWithFields3::B(12);
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_3_niche1`

warning: unused variable: `niche_w_fields_3_niche2`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:347:9
    |
347 |     let niche_w_fields_3_niche2 = NicheLayoutWithFields3::C(false);
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_3_niche2`

warning: unused variable: `niche_w_fields_3_niche3`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:348:9
    |
348 |     let niche_w_fields_3_niche3 = NicheLayoutWithFields3::D(34);
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_3_niche3`

warning: unused variable: `niche_w_fields_3_niche4`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:349:9
    |
349 |     let niche_w_fields_3_niche4 = NicheLayoutWithFields3::E(56);
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_3_niche4`

warning: unused variable: `niche_w_fields_3_niche5`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:350:9
    |
350 |     let niche_w_fields_3_niche5 = NicheLayoutWithFields3::F;
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_3_niche5`

warning: unused variable: `niche_w_fields_std_result_ok`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:352:9
    |
352 |     let niche_w_fields_std_result_ok: Result<Box<[u8]>, u64> = Ok(vec![1, 2, 3].into());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_std_result_ok`

warning: unused variable: `niche_w_fields_std_result_err`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:353:9
    |
353 |     let niche_w_fields_std_result_err: Result<Box<[u8]>, u64> = Err(789);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_niche_w_fields_std_result_err`

warning: unused variable: `arbitrary_discr1`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:355:9
    |
355 |     let arbitrary_discr1 = ArbitraryDiscr::Abc(1234);
    |         ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_arbitrary_discr1`

warning: unused variable: `arbitrary_discr2`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:356:9
    |
356 |     let arbitrary_discr2 = ArbitraryDiscr::Def(5678);
    |         ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_arbitrary_discr2`

warning: unused variable: `c_style_u128_a`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:358:9
    |
358 |     let c_style_u128_a = CStyleU128::A;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_u128_a`

warning: unused variable: `c_style_u128_b`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:359:9
    |
359 |     let c_style_u128_b = CStyleU128::B;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_u128_b`

warning: unused variable: `c_style_u128_c`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:360:9
    |
360 |     let c_style_u128_c = CStyleU128::C;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_u128_c`

warning: unused variable: `c_style_u128_d`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:361:9
    |
361 |     let c_style_u128_d = CStyleU128::D;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_u128_d`

warning: unused variable: `c_style_i128_a`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:363:9
    |
363 |     let c_style_i128_a = CStyleI128::A;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_i128_a`

warning: unused variable: `c_style_i128_b`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:364:9
    |
364 |     let c_style_i128_b = CStyleI128::B;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_i128_b`

warning: unused variable: `c_style_i128_c`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:365:9
    |
365 |     let c_style_i128_c = CStyleI128::C;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_i128_c`

warning: unused variable: `c_style_i128_d`
##[warning]   --> C:\a\rust\rust\tests\debuginfo\msvc-pretty-enums.rs:366:9
    |
366 |     let c_style_i128_d = CStyleI128::D;
    |         ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_c_style_i128_d`

error: aborting due to 2 previous errors; 42 warnings emitted

For more information about this error, try `rustc --explain E0512`.
------------------------------------------
---

Some tests failed in compiletest suite=debuginfo mode=debuginfo host=aarch64-pc-windows-msvc target=aarch64-pc-windows-msvc
Bootstrap failed while executing `test --stage 2 --skip=compiler --skip=src`
Build completed unsuccessfully in 1:28:55
make: *** [Makefile:115: ci-msvc-py] Error 1
  local time: Wed Apr 29 11:38:32 CUT 2026
  network time: Wed, 29 Apr 2026 11:38:32 GMT
##[error]Process completed with exit code 2.
##[group]Run echo "disk usage:"
echo "disk usage:"

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-rustc-dev-guide Area: rustc-dev-guide S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler 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.

Projects

None yet

10 participants