Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 7dd57f0

Browse files
committed
update/bless tests
1 parent 6dfb296 commit 7dd57f0

File tree

59 files changed

+550
-742
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+550
-742
lines changed

compiler/rustc_error_codes/src/error_codes/E0622.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ Erroneous code example:
66
#![feature(intrinsics)]
77
#![allow(internal_features)]
88
9-
extern "rust-intrinsic" {
10-
pub static atomic_singlethreadfence_seqcst: fn();
9+
extern "C" {
10+
#[rustc_intrinsic]
11+
pub static atomic_singlethreadfence_seqcst: unsafe fn();
1112
// error: intrinsic must be a function
1213
}
1314
@@ -22,9 +23,8 @@ error, just declare a function. Example:
2223
#![feature(intrinsics)]
2324
#![allow(internal_features)]
2425
25-
extern "rust-intrinsic" {
26-
pub fn atomic_singlethreadfence_seqcst(); // ok!
27-
}
26+
#[rustc_intrinsic]
27+
pub unsafe fn atomic_singlethreadfence_seqcst(); // ok!
2828
2929
fn main() { unsafe { atomic_singlethreadfence_seqcst(); } }
3030
```

tests/assembly/simd-bitmask.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ pub struct m64x2([i64; 2]);
3535
#[repr(simd)]
3636
pub struct m64x4([i64; 4]);
3737

38-
extern "rust-intrinsic" {
39-
fn simd_bitmask<V, B>(mask: V) -> B;
40-
}
38+
#[rustc_intrinsic]
39+
unsafe fn simd_bitmask<V, B>(mask: V) -> B;
4140

4241
// CHECK-LABEL: bitmask_m8x16
4342
#[no_mangle]

tests/assembly/simd-intrinsic-gather.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ pub struct m64x4([i64; 4]);
2222
#[repr(simd)]
2323
pub struct pf64x4([*const f64; 4]);
2424

25-
extern "rust-intrinsic" {
26-
fn simd_gather<V, M, P>(values: V, mask: M, pointer: P) -> V;
27-
}
25+
#[rustc_intrinsic]
26+
unsafe fn simd_gather<V, M, P>(values: V, mask: M, pointer: P) -> V;
2827

2928
// CHECK-LABEL: gather_f64x4
3029
#[no_mangle]

tests/assembly/simd-intrinsic-mask-load.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ pub struct f64x4([f64; 4]);
3434
#[repr(simd)]
3535
pub struct m64x4([i64; 4]);
3636

37-
extern "rust-intrinsic" {
38-
fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
39-
}
37+
#[rustc_intrinsic]
38+
unsafe fn simd_masked_load<M, P, T>(mask: M, pointer: P, values: T) -> T;
4039

4140
// CHECK-LABEL: load_i8x16
4241
#[no_mangle]

tests/assembly/simd-intrinsic-mask-reduce.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ use minicore::*;
2020
#[repr(simd)]
2121
pub struct mask8x16([i8; 16]);
2222

23-
extern "rust-intrinsic" {
24-
fn simd_reduce_all<T>(x: T) -> bool;
25-
fn simd_reduce_any<T>(x: T) -> bool;
26-
}
23+
#[rustc_intrinsic]
24+
unsafe fn simd_reduce_all<T>(x: T) -> bool;
25+
#[rustc_intrinsic]
26+
unsafe fn simd_reduce_any<T>(x: T) -> bool;
2727

2828
// CHECK-LABEL: mask_reduce_all:
2929
#[no_mangle]

tests/assembly/simd-intrinsic-mask-store.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ pub struct f64x4([f64; 4]);
3434
#[repr(simd)]
3535
pub struct m64x4([i64; 4]);
3636

37-
extern "rust-intrinsic" {
38-
fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T);
39-
}
37+
#[rustc_intrinsic]
38+
unsafe fn simd_masked_store<M, P, T>(mask: M, pointer: P, values: T);
4039

4140
// CHECK-LABEL: store_i8x16
4241
#[no_mangle]

tests/assembly/simd-intrinsic-scatter.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ pub struct m64x4([i64; 4]);
2222
#[repr(simd)]
2323
pub struct pf64x4([*mut f64; 4]);
2424

25-
extern "rust-intrinsic" {
26-
fn simd_scatter<V, P, M>(values: V, pointer: P, mask: M);
27-
}
25+
#[rustc_intrinsic]
26+
unsafe fn simd_scatter<V, P, M>(values: V, pointer: P, mask: M);
2827

2928
// CHECK-LABEL: scatter_f64x4
3029
#[no_mangle]

tests/assembly/simd-intrinsic-select.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ pub struct f64x8([f64; 8]);
4848
#[repr(simd)]
4949
pub struct m64x8([i64; 8]);
5050

51-
extern "rust-intrinsic" {
52-
fn simd_select<M, V>(mask: M, a: V, b: V) -> V;
53-
}
51+
#[rustc_intrinsic]
52+
unsafe fn simd_select<M, V>(mask: M, a: V, b: V) -> V;
5453

5554
// CHECK-LABEL: select_i8x16
5655
#[no_mangle]

tests/codegen/avr/avr-func-addrspace.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
extern crate minicore;
1818
use minicore::*;
1919

20-
extern "rust-intrinsic" {
21-
pub fn transmute<Src, Dst>(src: Src) -> Dst;
22-
}
20+
#[rustc_intrinsic]
21+
pub unsafe fn transmute<Src, Dst>(src: Src) -> Dst;
2322

2423
pub static mut STORAGE_FOO: fn(&usize, &mut u32) -> Result<(), ()> = arbitrary_black_box;
2524
pub static mut STORAGE_BAR: u32 = 12;

tests/codegen/emscripten-catch-unwind-js-eh.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@ fn size_of<T>() -> usize {
2323
loop {}
2424
}
2525

26-
extern "rust-intrinsic" {
27-
fn catch_unwind(
28-
try_fn: fn(_: *mut u8),
29-
data: *mut u8,
30-
catch_fn: fn(_: *mut u8, _: *mut u8),
31-
) -> i32;
32-
}
26+
#[rustc_intrinsic]
27+
unsafe fn catch_unwind(
28+
try_fn: fn(_: *mut u8),
29+
data: *mut u8,
30+
catch_fn: fn(_: *mut u8, _: *mut u8),
31+
) -> i32;
3332

3433
// CHECK-LABEL: @ptr_size
3534
#[no_mangle]

0 commit comments

Comments
 (0)