Skip to content

Rollup of 6 pull requests#154347

Closed
jhpratt wants to merge 23 commits intorust-lang:mainfrom
jhpratt:rollup-IoYtkt9
Closed

Rollup of 6 pull requests#154347
jhpratt wants to merge 23 commits intorust-lang:mainfrom
jhpratt:rollup-IoYtkt9

Conversation

@jhpratt
Copy link
Member

@jhpratt jhpratt commented Mar 25, 2026

Successful merges:

r? @ghost

Create a similar rollup

Darksonn and others added 23 commits March 17, 2026 20:23
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
* tests(ui): migrate issues/issue-17546 to ui/resolve
* tests(ui): add gh issue link
* tests(ui/issues): move tests to variants dir
…usize, r=scottmcm

`Alignment`: move from `ptr` to `mem` and rename `as_nonzero` to `as_nonzero_usize`

- tracking issue: rust-lang#102070
- split off from rust-lang#153261
Add `-Zsanitize=kernel-hwaddress`

The Linux kernel has a config option called `CONFIG_KASAN_SW_TAGS`  that enables `-fsanitize=kernel-hwaddress`. This is not supported by Rust.

One slightly awkward detail is that `#[sanitize(address = "off")]` applies to both `-Zsanitize=address` and `-Zsanitize=kernel-address`. Probably it was done this way because both are the same LLVM pass. I replicated this logic here for hwaddress, but it might be undesirable.

Note that `#[sanitize(kernel_hwaddress = "off")]` could be supported as an annotation on statics, but since it's also missing for `#[sanitize(hwaddress = "off")]`, I did not add it.

MCP: rust-lang/compiler-team#975
Tracking issue: rust-lang#154171

cc @rcvalle @maurer @ojeda
…=saethlin

miri recursive validation: only check one layer deep

As has been proposed in rust-lang/unsafe-code-guidelines#414, let's see what happens if we make recursive checking in Miri shallow: we treat whatever is behind a reference as if it was inside `MaybeDangling`, which means nested references do not have to be dereferenceable.

This changes the meaning of the original flag -- I don't think it is worth supporting multiple variants of recursive checking (it'd require a bunch of new plumbing), and this seems to be the strictest variant that still has any traction in the discussion.
some `tests/ui/macros` cleanup

Move most tests that do not run any code from `//@ run-pass` to `//@ check-pass` and merge the (outdated) `die-macro-*` tests into one file.
begin `tests/ui/structs-enums` cleanup

Nearly all tests in this directory are heavily outdated, poorly formatted and have a lot of duplication. This PR is the first of a planned series of PRs to combinine this, `ui/structs` and `ui/enum` into a better structure (`ui/adt` maybe?).
…r=Kivooeo

Move ui/issues tests to relevant subdirectories

Related to rust-lang#133895 and [Reorganisation of tests/ui/issues for GSOC](https://github.com/rust-lang/google-summer-of-code?tab=readme-ov-file#reorganisation-of-testsuiissues)

This is the first PR in a batch of PRs.

Moves `ui/issues/issue-17546.rs‎`  ‎-> `ui/variants/variant-result-noresult-used-as-type.rs`

Approach:
1. Check linked issue and test contents, determine new target directory
2. Move / rename tests to reflect purpose.
3. Add issue link / comments in separate commit.
4. Rebless if necessary and remove obsolete stderr.

r? @Kivooeo
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Mar 25, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner 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 PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 25, 2026
@rustbot rustbot added 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. labels Mar 25, 2026
@jhpratt
Copy link
Member Author

jhpratt commented Mar 25, 2026

@bors r+ rollup=never p=5

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 25, 2026

📌 Commit b26a1df has been approved by jhpratt

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

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 25, 2026
Rollup of 6 pull requests

Successful merges:

 - #154004 (`Alignment`: move from `ptr` to `mem` and rename `as_nonzero` to `as_nonzero_usize`)
 - #153049 (Add `-Zsanitize=kernel-hwaddress`)
 - #154269 (miri recursive validation: only check one layer deep)
 - #154112 (some `tests/ui/macros` cleanup)
 - #154131 (begin `tests/ui/structs-enums` cleanup)
 - #154233 (Move ui/issues tests to relevant subdirectories)
@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)

---- [mir-opt] tests/mir-opt/dont_reset_cast_kind_without_updating_operand.rs stdout ----
51           StorageLive(_12);
52           StorageLive(_13);
53 -         _13 = boxed::box_new_uninit(const <() as std::mem::SizedTypeProperties>::LAYOUT) -> [return: bb2, unwind unreachable];
- +         _13 = boxed::box_new_uninit(const Layout {{ size: 0_usize, align: std::mem::Alignment {{ _inner_repr_trick: std::ptr::alignment::AlignmentEnum::_Align1Shl0 }} }}) -> [return: bb2, unwind unreachable];
+ +         _13 = boxed::box_new_uninit(const Layout {{ size: 0_usize, align: std::mem::Alignment {{ _inner_repr_trick: mem::alignment::AlignmentEnum::_Align1Shl0 }} }}) -> [return: bb2, unwind unreachable];
55       }
56   
57       bb1: {


thread '[mir-opt] tests/mir-opt/dont_reset_cast_kind_without_updating_operand.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/dont_reset_cast_kind_without_updating_operand.test.GVN.32bit.panic-abort.diff
stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:689:5
   6: core::panicking::panic_fmt
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/core/src/panicking.rs:80:14
   7: <compiletest::runtest::TestCx>::run_revision
   8: compiletest::runtest::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---- [mir-opt] tests/mir-opt/dont_reset_cast_kind_without_updating_operand.rs stdout end ----
---- [mir-opt] tests/mir-opt/pre-codegen/drop_box_of_sized.rs stdout ----
69         StorageLive(_3);
70         _2 = copy (((*_1).0: std::ptr::Unique<[u8; 1024]>).0: std::ptr::NonNull<[u8; 1024]>);
71         _3 = copy _2 as std::ptr::NonNull<u8> (Transmute);
-         _4 = alloc::alloc::__rust_dealloc(move _3, const 1024_usize, const std::mem::Alignment {{ _inner_repr_trick: std::ptr::alignment::AlignmentEnum::_Align1Shl0 }}) -> [return: bb1, unwind unreachable];
+         _4 = alloc::alloc::__rust_dealloc(move _3, const 1024_usize, const std::mem::Alignment {{ _inner_repr_trick: mem::alignment::AlignmentEnum::_Align1Shl0 }}) -> [return: bb1, unwind unreachable];
73     }
74 
75     bb1: {


thread '[mir-opt] tests/mir-opt/pre-codegen/drop_box_of_sized.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/pre-codegen/drop_box_of_sized.drop_bytes.PreCodegen.after.panic-abort.mir
stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:689:5
   6: core::panicking::panic_fmt
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/core/src/panicking.rs:80:14
   7: <compiletest::runtest::TestCx>::run_revision
   8: compiletest::runtest::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---- [mir-opt] tests/mir-opt/pre-codegen/drop_box_of_sized.rs stdout end ----
---- [mir-opt] tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.rs stdout ----
63   
64       bb3: {
65 -         _1 = move ((_2 as Some).0: std::alloc::Layout);
- +         _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::mem::Alignment {{ _inner_repr_trick: Scalar(0x00000000): std::ptr::alignment::AlignmentEnum }} }};
+ +         _1 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::mem::Alignment {{ _inner_repr_trick: Scalar(0x00000000): mem::alignment::AlignmentEnum }} }};
67           StorageDead(_8);
68           StorageDead(_2);
69           StorageLive(_3);

73           StorageLive(_7);
74 -         _7 = copy _1;
75 -         _6 = std::alloc::Global::alloc_impl_runtime(move _7, const false) -> [return: bb4, unwind unreachable];
- +         _7 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::mem::Alignment {{ _inner_repr_trick: Scalar(0x00000000): std::ptr::alignment::AlignmentEnum }} }};
- +         _6 = std::alloc::Global::alloc_impl_runtime(const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::mem::Alignment {{ _inner_repr_trick: Scalar(0x00000000): std::ptr::alignment::AlignmentEnum }} }}, const false) -> [return: bb4, unwind unreachable];
+ +         _7 = const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::mem::Alignment {{ _inner_repr_trick: Scalar(0x00000000): mem::alignment::AlignmentEnum }} }};
+ +         _6 = std::alloc::Global::alloc_impl_runtime(const Layout {{ size: Indirect { alloc_id: ALLOC0, offset: Size(4 bytes) }: usize, align: std::mem::Alignment {{ _inner_repr_trick: Scalar(0x00000000): mem::alignment::AlignmentEnum }} }}, const false) -> [return: bb4, unwind unreachable];
78       }
79   
80       bb4: {


thread '[mir-opt] tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/pre-codegen/issue_117368_print_invalid_constant.main.GVN.32bit.panic-abort.diff
stack backtrace:
   5: __rustc::rust_begin_unwind
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/std/src/panicking.rs:689:5
   6: core::panicking::panic_fmt
             at /rustc/ad726b5063362ec9897ef3d67452fc5606ee70fa/library/core/src/panicking.rs:80:14

@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 Mar 25, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 25, 2026

💔 Test for f774118 failed: CI. Failed job:

@rust-bors rust-bors bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 25, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 25, 2026

PR #154004, which is a member of this rollup, was unapproved.

@rust-bors rust-bors bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 25, 2026
@jhpratt jhpratt closed this Mar 25, 2026
@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 Mar 25, 2026
@jhpratt jhpratt deleted the rollup-IoYtkt9 branch March 25, 2026 05:59
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-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 PG-exploit-mitigations Project group: Exploit mitigations 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-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants