Skip to content

Commit bd1d5bc

Browse files
committed
stabilize min_const_unsafe_fn --bless tests.
1 parent b42a3ac commit bd1d5bc

4 files changed

+12
-16
lines changed

src/test/ui/consts/const-size_of-cycle.stderr

-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ LL | bytes: [u8; std::mem::size_of::<Foo>()]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
note: ...which requires const-evaluating `Foo::bytes::{{constant}}`...
8-
--> $SRC_DIR/libcore/mem.rs:LL:COL
9-
|
10-
LL | intrinsics::size_of::<T>()
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
128
note: ...which requires computing layout of `Foo`...
139
note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: [u8; _] }`...
1410
note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}`...

src/test/ui/consts/min_const_fn/min_const_fn_unsafe.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
error[E0658]: dereferencing raw pointers in constant functions is unstable (see issue #51911)
2-
--> $DIR/min_const_fn_unsafe.rs:54:77
2+
--> $DIR/min_const_fn_unsafe.rs:60:77
33
|
44
LL | const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } } //~ is unsafe
55
| ^^^
66
|
77
= help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
88

99
error[E0658]: dereferencing raw pointers in constant functions is unstable (see issue #51911)
10-
--> $DIR/min_const_fn_unsafe.rs:57:70
10+
--> $DIR/min_const_fn_unsafe.rs:63:70
1111
|
1212
LL | const unsafe fn bad_const_unsafe_deref_raw(x: *mut usize) -> usize { *x }
1313
| ^^
1414
|
1515
= help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
1616

1717
error[E0658]: dereferencing raw pointers in constant functions is unstable (see issue #51911)
18-
--> $DIR/min_const_fn_unsafe.rs:60:83
18+
--> $DIR/min_const_fn_unsafe.rs:66:83
1919
|
2020
LL | const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static usize { &*x }
2121
| ^^^
2222
|
2323
= help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
2424

2525
error[E0658]: unions in const fn are unstable (see issue #51909)
26-
--> $DIR/min_const_fn_unsafe.rs:67:5
26+
--> $DIR/min_const_fn_unsafe.rs:73:5
2727
|
2828
LL | Foo { x: () }.y
2929
| ^^^^^^^^^^^^^^^
3030
|
3131
= help: add #![feature(const_fn_union)] to the crate attributes to enable
3232

3333
error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
34-
--> $DIR/min_const_fn_unsafe.rs:54:77
34+
--> $DIR/min_const_fn_unsafe.rs:60:77
3535
|
3636
LL | const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } } //~ is unsafe
3737
| ^^^ dereference of raw pointer

src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error: can only call other `min_const_fn` within a `min_const_fn`
2-
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:26:41
2+
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:25:41
33
|
44
LL | const unsafe fn bar() -> u32 { unsafe { foo() } } //~ ERROR can only call other `min_const_fn`
55
| ^^^^^
66

77
error: can only call other `min_const_fn` within a `min_const_fn`
8-
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:33:42
8+
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:32:42
99
|
1010
LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } } //~ ERROR can only call other `min_const_fn`
1111
| ^^^^^^
1212

1313
error: only int, `bool` and `char` operations are stable in const fn
14-
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:37:33
14+
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:36:33
1515
|
1616
LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 } //~ ERROR only int, `bool` and `char` op
1717
| ^^^^^^^^^^^^^
1818

1919
error: can only call other `min_const_fn` within a `min_const_fn`
20-
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:45:48
20+
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:44:48
2121
|
2222
LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } } //~ ERROR can only call other
2323
| ^^^^^^^^^^^^

src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error: can only call other `min_const_fn` within a `min_const_fn`
2-
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:26:32
2+
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:25:32
33
|
44
LL | const unsafe fn bar() -> u32 { foo() } //~ ERROR can only call other `min_const_fn`
55
| ^^^^^
66

77
error: can only call other `min_const_fn` within a `min_const_fn`
8-
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:33:33
8+
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:32:33
99
|
1010
LL | const unsafe fn bar2() -> u32 { foo2() } //~ ERROR can only call other `min_const_fn`
1111
| ^^^^^^
1212

1313
error: can only call other `min_const_fn` within a `min_const_fn`
14-
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:41:39
14+
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:40:39
1515
|
1616
LL | const unsafe fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR can only call other `min_const_fn`
1717
| ^^^^^^^^^^^^

0 commit comments

Comments
 (0)