diff options
Diffstat (limited to 'tests/ui/consts/const-eval/heap')
6 files changed, 13 insertions, 9 deletions
diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr b/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr index 8f3b3d5f7..23ba2c2f5 100644 --- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr +++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr @@ -2,7 +2,7 @@ error[E0080]: evaluation of constant value failed --> $DIR/alloc_intrinsic_errors.rs:9:17 | LL | let _ = intrinsics::const_allocate(4, 3) as *mut i32; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ align has to be a power of 2, `3` is not a power of 2 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid align passed to `const_allocate`: 3 is not a power of 2 | note: inside `foo` --> $DIR/alloc_intrinsic_errors.rs:9:17 diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.rs b/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.rs index f746f2700..9ae906bbb 100644 --- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.rs +++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.rs @@ -4,11 +4,11 @@ use std::intrinsics; const FOO: *const i32 = foo(); -//~^ ERROR untyped pointers are not allowed in constant +//~^ ERROR unsupported untyped pointer in constant const fn foo() -> &'static i32 { let t = unsafe { - let i = intrinsics::const_allocate(4, 4) as * mut i32; + let i = intrinsics::const_allocate(4, 4) as *mut i32; *i = 20; i }; diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr b/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr index 00ab0dfc5..2103f842b 100644 --- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr +++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_nontransient_fail.stderr @@ -1,8 +1,10 @@ -error: untyped pointers are not allowed in constant +error: unsupported untyped pointer in constant --> $DIR/alloc_intrinsic_nontransient_fail.rs:6:1 | LL | const FOO: *const i32 = foo(); | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: memory only reachable via raw pointers is not supported error: aborting due to previous error diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs index 77871c394..1354b3c33 100644 --- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs +++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.rs @@ -3,7 +3,7 @@ #![feature(const_mut_refs)] use std::intrinsics; -const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32}; -//~^ error: untyped pointers are not allowed in constant +const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32 }; +//~^ error: unsupported untyped pointer in constant fn main() {} diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr index 36002b850..b62766473 100644 --- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr +++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_untyped.stderr @@ -1,8 +1,10 @@ -error: untyped pointers are not allowed in constant +error: unsupported untyped pointer in constant --> $DIR/alloc_intrinsic_untyped.rs:6:1 | -LL | const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32}; +LL | const BAR: *mut i32 = unsafe { intrinsics::const_allocate(4, 4) as *mut i32 }; | ^^^^^^^^^^^^^^^^^^^ + | + = note: memory only reachable via raw pointers is not supported error: aborting due to previous error diff --git a/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.stderr b/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.stderr index 650b409b1..4c23957a1 100644 --- a/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.stderr +++ b/tests/ui/consts/const-eval/heap/dealloc_intrinsic_incorrect_layout.stderr @@ -20,7 +20,7 @@ error[E0080]: evaluation of constant value failed --> $DIR/dealloc_intrinsic_incorrect_layout.rs:25:5 | LL | intrinsics::const_deallocate(ptr, 4, 3); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ align has to be a power of 2, `3` is not a power of 2 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid align passed to `const_deallocate`: 3 is not a power of 2 error: aborting due to 4 previous errors |