diff options
| author | bors <bors@rust-lang.org> | 2024-03-06 02:18:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-06 02:18:22 +0000 |
| commit | b77e0184a95d60080f0d0605e2a3b337e904c21e (patch) | |
| tree | 02f234cb3efa0a393b0e72e8a688e6a3d57d68b4 /tests/codegen | |
| parent | 62415e2a95a3b0f137636f86f6a904b8ed85798e (diff) | |
| parent | 4f73d2a53c74428bd6e4fdda63b1dcc9fdf18353 (diff) | |
Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #121065 (Add basic i18n guidance for `Display`) - #121744 (Stop using Bubble in coherence and instead emulate it with an intercrate check) - #121829 (Dummy tweaks (attempt 2)) - #121857 (Implement async closure signature deduction) - #121894 (const_eval_select: make it safe but be careful with what we expose on stable for now) - #122014 (Change some attributes to only_local.) - #122016 (will_wake tests fail on Miri and that is expected) - #122018 (only set noalias on Box with the global allocator) - #122028 (Remove some dead code) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'tests/codegen')
| -rw-r--r-- | tests/codegen/function-arguments.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/codegen/function-arguments.rs b/tests/codegen/function-arguments.rs index b75c188f51a..e6e2f645714 100644 --- a/tests/codegen/function-arguments.rs +++ b/tests/codegen/function-arguments.rs @@ -2,6 +2,7 @@ #![crate_type = "lib"] #![feature(dyn_star)] #![feature(generic_nonzero)] +#![feature(allocator_api)] use std::mem::MaybeUninit; use std::num::NonZero; @@ -182,6 +183,15 @@ pub fn _box(x: Box<i32>) -> Box<i32> { x } +// With a custom allocator, it should *not* have `noalias`. (See +// <https://github.com/rust-lang/miri/issues/3341> for why.) The second argument is the allocator, +// which is a reference here that still carries `noalias` as usual. +// CHECK: @_box_custom(ptr noundef nonnull align 4 %x.0, ptr noalias noundef nonnull readonly align 1 %x.1) +#[no_mangle] +pub fn _box_custom(x: Box<i32, &std::alloc::Global>) { + drop(x) +} + // CHECK: noundef nonnull align 4 ptr @notunpin_box(ptr noundef nonnull align 4 %x) #[no_mangle] pub fn notunpin_box(x: Box<NotUnpin>) -> Box<NotUnpin> { |
