@@ -5,7 +5,7 @@ fn size_of() {
5
5
check_number (
6
6
r#"
7
7
#[rustc_intrinsic]
8
- pub unsafe fn size_of<T>() -> usize;
8
+ pub fn size_of<T>() -> usize;
9
9
10
10
const GOAL: usize = size_of::<i32>();
11
11
"# ,
@@ -19,7 +19,7 @@ fn size_of_val() {
19
19
r#"
20
20
//- minicore: coerce_unsized
21
21
#[rustc_intrinsic]
22
- pub unsafe fn size_of_val<T: ?Sized>(_: *const T) -> usize;
22
+ pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
23
23
24
24
struct X(i32, u8);
25
25
@@ -31,7 +31,7 @@ fn size_of_val() {
31
31
r#"
32
32
//- minicore: coerce_unsized
33
33
#[rustc_intrinsic]
34
- pub unsafe fn size_of_val<T: ?Sized>(_: *const T) -> usize;
34
+ pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
35
35
36
36
const GOAL: usize = {
37
37
let it: &[i32] = &[1, 2, 3];
@@ -46,7 +46,7 @@ fn size_of_val() {
46
46
use core::mem::transmute;
47
47
48
48
#[rustc_intrinsic]
49
- pub unsafe fn size_of_val<T: ?Sized>(_: *const T) -> usize;
49
+ pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
50
50
51
51
struct X {
52
52
x: i64,
@@ -67,7 +67,7 @@ fn size_of_val() {
67
67
use core::mem::transmute;
68
68
69
69
#[rustc_intrinsic]
70
- pub unsafe fn size_of_val<T: ?Sized>(_: *const T) -> usize;
70
+ pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
71
71
72
72
struct X {
73
73
x: i32,
@@ -86,7 +86,7 @@ fn size_of_val() {
86
86
r#"
87
87
//- minicore: coerce_unsized, fmt, builtin_impls, dispatch_from_dyn
88
88
#[rustc_intrinsic]
89
- pub unsafe fn size_of_val<T: ?Sized>(_: *const T) -> usize;
89
+ pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
90
90
91
91
const GOAL: usize = {
92
92
let x: &i16 = &5;
@@ -101,7 +101,7 @@ fn size_of_val() {
101
101
r#"
102
102
//- minicore: coerce_unsized
103
103
#[rustc_intrinsic]
104
- pub unsafe fn size_of_val<T: ?Sized>(_: *const T) -> usize;
104
+ pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
105
105
106
106
const GOAL: usize = {
107
107
size_of_val("salam")
@@ -117,7 +117,7 @@ fn min_align_of_val() {
117
117
r#"
118
118
//- minicore: coerce_unsized
119
119
#[rustc_intrinsic]
120
- pub unsafe fn min_align_of_val<T: ?Sized>(_: *const T) -> usize;
120
+ pub fn min_align_of_val<T: ?Sized>(_: *const T) -> usize;
121
121
122
122
struct X(i32, u8);
123
123
@@ -129,7 +129,7 @@ fn min_align_of_val() {
129
129
r#"
130
130
//- minicore: coerce_unsized
131
131
#[rustc_intrinsic]
132
- pub unsafe fn min_align_of_val<T: ?Sized>(_: *const T) -> usize;
132
+ pub fn min_align_of_val<T: ?Sized>(_: *const T) -> usize;
133
133
134
134
const GOAL: usize = {
135
135
let x: &[i32] = &[1, 2, 3];
@@ -145,7 +145,7 @@ fn type_name() {
145
145
check_str (
146
146
r#"
147
147
#[rustc_intrinsic]
148
- pub unsafe fn type_name<T: ?Sized>() -> &'static str;
148
+ pub fn type_name<T: ?Sized>() -> &'static str;
149
149
150
150
const GOAL: &str = type_name::<i32>();
151
151
"# ,
@@ -154,7 +154,7 @@ fn type_name() {
154
154
check_str (
155
155
r#"
156
156
#[rustc_intrinsic]
157
- pub unsafe fn type_name<T: ?Sized>() -> &'static str;
157
+ pub fn type_name<T: ?Sized>() -> &'static str;
158
158
159
159
mod mod1 {
160
160
pub mod mod2 {
@@ -173,7 +173,7 @@ fn transmute() {
173
173
check_number (
174
174
r#"
175
175
#[rustc_intrinsic]
176
- pub unsafe fn transmute<T, U>(e: T) -> U;
176
+ pub fn transmute<T, U>(e: T) -> U;
177
177
178
178
const GOAL: i32 = transmute((1i16, 1i16));
179
179
"# ,
@@ -186,9 +186,9 @@ fn read_via_copy() {
186
186
check_number (
187
187
r#"
188
188
#[rustc_intrinsic]
189
- pub unsafe fn read_via_copy<T>(e: *const T) -> T;
189
+ pub fn read_via_copy<T>(e: *const T) -> T;
190
190
#[rustc_intrinsic]
191
- pub unsafe fn volatile_load<T>(e: *const T) -> T;
191
+ pub fn volatile_load<T>(e: *const T) -> T;
192
192
193
193
const GOAL: i32 = {
194
194
let x = 2;
@@ -385,12 +385,12 @@ fn likely() {
385
385
check_number (
386
386
r#"
387
387
#[rustc_intrinsic]
388
- pub const unsafe fn likely(b: bool) -> bool {
388
+ pub const fn likely(b: bool) -> bool {
389
389
b
390
390
}
391
391
392
392
#[rustc_intrinsic]
393
- pub const unsafe fn unlikely(b: bool) -> bool {
393
+ pub const fn unlikely(b: bool) -> bool {
394
394
b
395
395
}
396
396
@@ -719,7 +719,7 @@ fn rotate() {
719
719
check_number (
720
720
r#"
721
721
#[rustc_intrinsic]
722
- pub unsafe fn rotate_right<T: Copy>(x: T, y: T) -> T;
722
+ pub fn rotate_right<T: Copy>(x: T, y: T) -> T;
723
723
724
724
const GOAL: i32 = rotate_right(10006016, 1020315);
725
725
"# ,
@@ -735,7 +735,7 @@ fn simd() {
735
735
i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,
736
736
);
737
737
#[rustc_intrinsic]
738
- pub unsafe fn simd_bitmask<T, U>(x: T) -> U;
738
+ pub fn simd_bitmask<T, U>(x: T) -> U;
739
739
const GOAL: u16 = simd_bitmask(i8x16(
740
740
0, 1, 0, 0, 2, 255, 100, 0, 50, 0, 1, 1, 0, 0, 0, 0
741
741
));
@@ -748,9 +748,9 @@ fn simd() {
748
748
i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,
749
749
);
750
750
#[rustc_intrinsic]
751
- pub unsafe fn simd_lt<T, U>(x: T, y: T) -> U;
751
+ pub fn simd_lt<T, U>(x: T, y: T) -> U;
752
752
#[rustc_intrinsic]
753
- pub unsafe fn simd_bitmask<T, U>(x: T) -> U;
753
+ pub fn simd_bitmask<T, U>(x: T) -> U;
754
754
const GOAL: u16 = simd_bitmask(simd_lt::<i8x16, i8x16>(
755
755
i8x16(
756
756
-105, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
0 commit comments