Commit Graph

17 Commits

Author SHA1 Message Date
Ralf Jung
de78cb56b2 on a signed deref check, mention the right pointer in the error 2024-08-01 14:25:19 +02:00
Ralf Jung
f8ebe8d783 improve dangling/oob errors and make them more uniform 2024-07-27 21:12:54 +02:00
Zalathar
9aaa0c5867 Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
Ralf Jung
5c33a5690d offset, offset_from: allow zero-byte offset on arbitrary pointers 2024-05-13 07:59:16 +02:00
许杰友 Jieyou Xu (Joe)
ec2cc761bc
[AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
Ralf Jung
29c95e98e3 also print 'immutable' flag 2023-12-07 17:46:36 +01:00
Caleb Zulawski
4d9607869a Update std::simd usage and test outputs 2023-11-26 09:02:25 -05:00
Maybe Waffle
e36224118f Stabilize [const_]pointer_byte_offsets 2023-10-25 22:35:12 +00:00
Camille GILLOT
1f90d857d7 Stop trying to preserve pretty-printing. 2023-10-16 19:15:28 +00:00
Camille GILLOT
02424e4bc5 Normalize alloc-id in tests. 2023-10-16 16:29:35 +00:00
Ralf Jung
b1ebf002c3 don't UB on dangling ptr deref, instead check inbounds on projections 2023-10-15 18:12:46 +02:00
Ralf Jung
7767cbb3b0 const validation: point at where we found a pointer but expected an integer 2023-08-02 18:51:50 +02:00
Deadbeef
4f83717cf7 Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
bors
81c2459af6 Stabilize const_ptr_read 2023-05-05 20:36:21 +02:00
Scott McMurray
e1da77c76d Also use mir::Offset for pointer add 2023-04-27 22:44:42 -07:00
Scott McMurray
b2c717fa33 MaybeUninit::assume_init_read should have noundef load metadata
I was looking into `array::IntoIter` optimization, and noticed that it wasn't annotating the loads with `noundef` for simple things like `array::IntoIter<i32, N>`.

Turned out to be a more general problem as `MaybeUninit::assume_init_read` isn't marking the load as initialized (<https://rust.godbolt.org/z/Mxd8TPTnv>), which is unfortunate since that's basically its reason to exist.

This PR lowers `ptr::read(p)` to `copy *p` in MIR, which fortuitiously also improves the IR we give to LLVM for things like `mem::replace`.
2023-03-11 17:44:43 -08:00
Albert Larsan
cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00