stabilize min_const_unsafe_fn --bless tests.

This commit is contained in:
Mazdak Farrokhzad 2018-12-22 18:58:06 +01:00
parent b42a3acaec
commit bd1d5bc629
4 changed files with 12 additions and 16 deletions

View file

@ -5,10 +5,6 @@ LL | bytes: [u8; std::mem::size_of::<Foo>()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating `Foo::bytes::{{constant}}`...
--> $SRC_DIR/libcore/mem.rs:LL:COL
|
LL | intrinsics::size_of::<T>()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires computing layout of `Foo`...
note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: [u8; _] }`...
note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}`...

View file

@ -1,5 +1,5 @@
error[E0658]: dereferencing raw pointers in constant functions is unstable (see issue #51911)
--> $DIR/min_const_fn_unsafe.rs:54:77
--> $DIR/min_const_fn_unsafe.rs:60:77
|
LL | const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } } //~ is unsafe
| ^^^
@ -7,7 +7,7 @@ LL | const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe {
= help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
error[E0658]: dereferencing raw pointers in constant functions is unstable (see issue #51911)
--> $DIR/min_const_fn_unsafe.rs:57:70
--> $DIR/min_const_fn_unsafe.rs:63:70
|
LL | const unsafe fn bad_const_unsafe_deref_raw(x: *mut usize) -> usize { *x }
| ^^
@ -15,7 +15,7 @@ LL | const unsafe fn bad_const_unsafe_deref_raw(x: *mut usize) -> usize { *x }
= help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
error[E0658]: dereferencing raw pointers in constant functions is unstable (see issue #51911)
--> $DIR/min_const_fn_unsafe.rs:60:83
--> $DIR/min_const_fn_unsafe.rs:66:83
|
LL | const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static usize { &*x }
| ^^^
@ -23,7 +23,7 @@ LL | const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static u
= help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
error[E0658]: unions in const fn are unstable (see issue #51909)
--> $DIR/min_const_fn_unsafe.rs:67:5
--> $DIR/min_const_fn_unsafe.rs:73:5
|
LL | Foo { x: () }.y
| ^^^^^^^^^^^^^^^
@ -31,7 +31,7 @@ LL | Foo { x: () }.y
= help: add #![feature(const_fn_union)] to the crate attributes to enable
error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
--> $DIR/min_const_fn_unsafe.rs:54:77
--> $DIR/min_const_fn_unsafe.rs:60:77
|
LL | const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } } //~ is unsafe
| ^^^ dereference of raw pointer

View file

@ -1,23 +1,23 @@
error: can only call other `min_const_fn` within a `min_const_fn`
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:26:41
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:25:41
|
LL | const unsafe fn bar() -> u32 { unsafe { foo() } } //~ ERROR can only call other `min_const_fn`
| ^^^^^
error: can only call other `min_const_fn` within a `min_const_fn`
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:33:42
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:32:42
|
LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } } //~ ERROR can only call other `min_const_fn`
| ^^^^^^
error: only int, `bool` and `char` operations are stable in const fn
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:37:33
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:36:33
|
LL | const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 } //~ ERROR only int, `bool` and `char` op
| ^^^^^^^^^^^^^
error: can only call other `min_const_fn` within a `min_const_fn`
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:45:48
--> $DIR/min_const_unsafe_fn_libstd_stability.rs:44:48
|
LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } } //~ ERROR can only call other
| ^^^^^^^^^^^^

View file

@ -1,17 +1,17 @@
error: can only call other `min_const_fn` within a `min_const_fn`
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:26:32
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:25:32
|
LL | const unsafe fn bar() -> u32 { foo() } //~ ERROR can only call other `min_const_fn`
| ^^^^^
error: can only call other `min_const_fn` within a `min_const_fn`
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:33:33
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:32:33
|
LL | const unsafe fn bar2() -> u32 { foo2() } //~ ERROR can only call other `min_const_fn`
| ^^^^^^
error: can only call other `min_const_fn` within a `min_const_fn`
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:41:39
--> $DIR/min_const_unsafe_fn_libstd_stability2.rs:40:39
|
LL | const unsafe fn bar2_gated() -> u32 { foo2_gated() } //~ ERROR can only call other `min_const_fn`
| ^^^^^^^^^^^^