about summary refs log tree commit diff
path: root/src/test/ui/consts
diff options
context:
space:
mode:
authorBen Lewis <benlewisj@gmail.com>2020-01-11 15:22:36 +1300
committerBen Lewis <benlewisj@gmail.com>2020-01-14 07:47:45 +1300
commita6c4025fac3c3a60581af72998230d46aa6f5ade (patch)
treee1e162084cf9245c2b0419b4895fa9a84ca3865f /src/test/ui/consts
parentbf84eb538fd16743240434b3e837b36c35719fee (diff)
downloadrust-a6c4025fac3c3a60581af72998230d46aa6f5ade.tar.gz
rust-a6c4025fac3c3a60581af72998230d46aa6f5ade.zip
perf: eagerly convert literals to consts, this avoids creating loads on unevaluated consts
which requires a lot of unnecessary work to evaluate them further down the line.
Diffstat (limited to 'src/test/ui/consts')
-rw-r--r--src/test/ui/consts/const-eval/ub-nonnull.stderr2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/ui/consts/const-eval/ub-nonnull.stderr b/src/test/ui/consts/const-eval/ub-nonnull.stderr
index ea9fffa883e..c2446d14040 100644
--- a/src/test/ui/consts/const-eval/ub-nonnull.stderr
+++ b/src/test/ui/consts/const-eval/ub-nonnull.stderr
@@ -13,7 +13,7 @@ LL | / const OUT_OF_BOUNDS_PTR: NonNull<u8> = { unsafe {
 LL | |     let ptr: &[u8; 256] = mem::transmute(&0u8); // &0 gets promoted so it does not dangle
 LL | |     // Use address-of-element for pointer arithmetic. This could wrap around to NULL!
 LL | |     let out_of_bounds_ptr = &ptr[255];
-   | |                             ^^^^^^^^^ Memory access failed: pointer must be in-bounds at offset 256, but is outside bounds of allocation 9 which has size 1
+   | |                             ^^^^^^^^^ Memory access failed: pointer must be in-bounds at offset 256, but is outside bounds of allocation 8 which has size 1
 LL | |     mem::transmute(out_of_bounds_ptr)
 LL | | } };
    | |____-