Skip to content

Commit 06c0b5c

Browse files
committed
Auto merge of #146192 - jhpratt:rollup-mam0bss, r=jhpratt
Rollup of 5 pull requests Successful merges: - rust-lang/rust#145682 (Promote aarch64-pc-windows-msvc to Tier 1) - rust-lang/rust#145690 (Implement Integer funnel shifts) - rust-lang/rust#146119 (compiletest: Implement an experimental `--new-output-capture` mode) - rust-lang/rust#146168 (Update bootstrap's dependencies to remove winapi and old windows-sys) - rust-lang/rust#146182 (Don't require next-solver `ProbeRef` to be `Copy`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents b2f690b + a2f9910 commit 06c0b5c

File tree

5 files changed

+51
-1
lines changed

5 files changed

+51
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#![feature(core_intrinsics, funnel_shifts)]
2+
3+
fn main() {
4+
unsafe {
5+
std::intrinsics::unchecked_funnel_shl(1_u32, 2, 32); //~ ERROR: Undefined Behavior
6+
}
7+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error: Undefined Behavior: `assume` called with `false`
2+
--> tests/fail/intrinsics/funnel_shl.rs:LL:CC
3+
|
4+
LL | std::intrinsics::unchecked_funnel_shl(1_u32, 2, 32);
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
6+
|
7+
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8+
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9+
= note: BACKTRACE:
10+
= note: inside `main` at tests/fail/intrinsics/funnel_shl.rs:LL:CC
11+
12+
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
13+
14+
error: aborting due to 1 previous error
15+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#![feature(core_intrinsics, funnel_shifts)]
2+
3+
fn main() {
4+
unsafe {
5+
std::intrinsics::unchecked_funnel_shr(1_u32, 2, 32); //~ ERROR: Undefined Behavior
6+
}
7+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error: Undefined Behavior: `assume` called with `false`
2+
--> tests/fail/intrinsics/funnel_shr.rs:LL:CC
3+
|
4+
LL | std::intrinsics::unchecked_funnel_shr(1_u32, 2, 32);
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here
6+
|
7+
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8+
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9+
= note: BACKTRACE:
10+
= note: inside `main` at tests/fail/intrinsics/funnel_shr.rs:LL:CC
11+
12+
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
13+
14+
error: aborting due to 1 previous error
15+

tests/pass/intrinsics/integer.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22
// SPDX-FileCopyrightText: The Rust Project Developers (see https://thanks.rust-lang.org)
33

4-
#![feature(core_intrinsics)]
4+
#![feature(core_intrinsics, funnel_shifts)]
55
use std::intrinsics::*;
66

77
pub fn main() {
@@ -143,5 +143,11 @@ pub fn main() {
143143

144144
assert_eq!(unchecked_mul(6u8, 7), 42);
145145
assert_eq!(unchecked_mul(13, -5), -65);
146+
147+
assert_eq!(unchecked_funnel_shl(1_u32, 2, 5), 32);
148+
assert_eq!(unchecked_funnel_shl(1_u32, 2, 31), 0x80000001);
149+
150+
assert_eq!(unchecked_funnel_shr(1_u32, 2, 5), 0x08000000);
151+
assert_eq!(unchecked_funnel_shr(1_u32, 2, 31), 2);
146152
}
147153
}

0 commit comments

Comments
 (0)