about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-07-25 16:48:22 +0200
committerGitHub <noreply@github.com>2024-07-25 16:48:22 +0200
commitc98d704c462b50ecffb12fea5bca0937034ea1b6 (patch)
treee2aa7aaf481d8a02f239b52414d6c49751c6d694
parent4cf41969078aabf060cbe69cf8628ef5edf92b71 (diff)
parent34819b72983af230c3e413371a096e94c684a5e5 (diff)
downloadrust-c98d704c462b50ecffb12fea5bca0937034ea1b6.tar.gz
rust-c98d704c462b50ecffb12fea5bca0937034ea1b6.zip
Rollup merge of #128173 - compiler-errors:misused-intrinsics, r=oli-obk
Remove crashes for misuses of intrinsics

All of these do not crash if the feature gate is removed. An ICE due *opting into* the intrinsics feature gate is not a bug that needs to be fixed, but instead a misuse of an internal-only API.

See https://github.com/rust-lang/compiler-team/issues/620

The last two issues are already closed anyways, but:
Fixes #97501
Fixes #111699
Fixes #101962
-rw-r--r--tests/crashes/101962.rs11
-rw-r--r--tests/crashes/111699.rs14
-rw-r--r--tests/crashes/97501.rs22
3 files changed, 0 insertions, 47 deletions
diff --git a/tests/crashes/101962.rs b/tests/crashes/101962.rs
deleted file mode 100644
index b6a78ce053a..00000000000
--- a/tests/crashes/101962.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-//@ known-bug: #101962
-
-#![feature(core_intrinsics)]
-
-pub fn wrapping<T: Copy>(a: T, b: T) {
-    let _z = core::intrinsics::wrapping_mul(a, b);
-}
-
-fn main() {
-    wrapping(1,2);
-}
diff --git a/tests/crashes/111699.rs b/tests/crashes/111699.rs
deleted file mode 100644
index 5ba17c2aa1a..00000000000
--- a/tests/crashes/111699.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-//@ known-bug: #111699
-//@ edition:2021
-//@ compile-flags: -Copt-level=0
-#![feature(core_intrinsics)]
-use std::intrinsics::offset;
-
-fn main() {
-    let a = [1u8, 2, 3];
-    let ptr: *const u8 = a.as_ptr();
-
-    unsafe {
-        assert_eq!(*offset(ptr, 0), 1);
-    }
-}
diff --git a/tests/crashes/97501.rs b/tests/crashes/97501.rs
deleted file mode 100644
index 51a83d8be16..00000000000
--- a/tests/crashes/97501.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-//@ known-bug: #97501
-
-#![feature(core_intrinsics)]
-use std::intrinsics::wrapping_add;
-
-#[derive(Clone, Copy)]
-struct WrapInt8 {
-    value: u8
-}
-
-impl std::ops::Add for WrapInt8 {
-    type Output = WrapInt8;
-    fn add(self, other: WrapInt8) -> WrapInt8 {
-        wrapping_add(self, other)
-    }
-}
-
-fn main() {
-    let p = WrapInt8 { value: 123 };
-    let q = WrapInt8 { value: 234 };
-    println!("{}", (p + q).value);
-}