Skip to content

Commit 1729efb

Browse files
authored
Merge pull request #4567 from rust-lang/rustup-2025-09-05
Automatic Rustup
2 parents c479ac9 + 40d9da6 commit 1729efb

File tree

6 files changed

+52
-2
lines changed

6 files changed

+52
-2
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9385c64c95d971329e62917adc4349c8ccdbafe0
1+
b3cfb8faf84c5f3b7909479a9f9b6a3290d5f4d7
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)