Promoteds also need param envs.

This also allows us to use the `const_eval` query again without causing cycles
This commit is contained in:
Oliver Scherer 2020-01-08 20:50:59 +01:00
parent 36b1756711
commit 6e1bbff2c6
4 changed files with 18 additions and 16 deletions

View file

@ -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 8 which has size 1
| | ^^^^^^^^^ Memory access failed: pointer must be in-bounds at offset 256, but is outside bounds of allocation 9 which has size 1
LL | | mem::transmute(out_of_bounds_ptr)
LL | | } };
| |____-