-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make pointer offset methods/intrinsics const #71500
Commits on May 25, 2020
-
librustc_mir: Add support for const fn offset/arith_offset
Miri's pointer_offset_inbounds implementation has been moved into librustc_mir as ptr_offset_inbounds (to avoid breaking miri on a nightly update). The comments have been slightly reworked to better match `offset`'s external documentation about what causes UB. The intrinsic implementations are taken directly from miri. Signed-off-by: Joe Richey <joerichey@google.com>
Configuration menu - View commit details
-
Copy full SHA for 08df311 - Browse repository at this point
Copy the full SHA 08df311View commit details -
core: Make pointer offset methods "const fn"
Signed-off-by: Joe Richey <joerichey@google.com>
Configuration menu - View commit details
-
Copy full SHA for 9b3dfd8 - Browse repository at this point
Copy the full SHA 9b3dfd8View commit details -
test/ui/consts: Add tests for const ptr offsets
Signed-off-by: Joe Richey <joerichey@google.com>
Configuration menu - View commit details
-
Copy full SHA for 88a37a2 - Browse repository at this point
Copy the full SHA 88a37a2View commit details -
miri_unleached: We now allow offset in const fn
Signed-off-by: Joe Richey <joerichey@google.com>
Configuration menu - View commit details
-
Copy full SHA for 6b20f58 - Browse repository at this point
Copy the full SHA 6b20f58View commit details -
librustc_mir: Add back use statement
Signed-off-by: Joe Richey <joerichey@google.com>
Configuration menu - View commit details
-
Copy full SHA for 55577b4 - Browse repository at this point
Copy the full SHA 55577b4View commit details
Commits on May 26, 2020
-
librustc_middle: Add function for computing unsigned abs
This is tricky to get right if we want to avoid panicking or wrapping. Signed-off-by: Joe Richey <joerichey@google.com>
Configuration menu - View commit details
-
Copy full SHA for 6367b54 - Browse repository at this point
Copy the full SHA 6367b54View commit details -
Add checks and tests for computing abs(offset_bytes)
The previous code paniced if offset_bytes == i64::MIN. This commit: - Properly computes the absoulte value to avoid this panic - Adds a test for this edge case Signed-off-by: Joe Richey <joerichey@google.com>
Configuration menu - View commit details
-
Copy full SHA for 71ef841 - Browse repository at this point
Copy the full SHA 71ef841View commit details
Commits on May 28, 2020
-
Add additional checks for isize overflow
We now perform the correct checks even if the pointer size differs between the host and target. Signed-off-by: Joe Richey <joerichey@google.com>
Configuration menu - View commit details
-
Copy full SHA for 7d5415b - Browse repository at this point
Copy the full SHA 7d5415bView commit details