Skip to content
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 <*const/mut T>::offset_from const fn #63810

Merged
merged 7 commits into from
Nov 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
adjust for missing spans on x86 test runner
  • Loading branch information
RalfJung committed Nov 2, 2019
commit b93f48f71a1764420978c6344acd5faf4c3f9a51
3 changes: 1 addition & 2 deletions src/test/ui/consts/offset_from_ub.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ingoring on musl because it's ui output hides libcore backtraces
// ignore-musl
// ignore-x86 FIXME: missing sysroot spans (#53081)

#![feature(const_raw_ptr_deref)]
#![feature(const_ptr_offset_from)]
Expand Down
12 changes: 6 additions & 6 deletions src/test/ui/consts/offset_from_ub.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ LL | intrinsics::ptr_offset_from(self, origin)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| ptr_offset_from cannot compute offset of pointers into different allocations.
| inside call to `std::ptr::<impl *const Struct>::offset_from` at $DIR/offset_from_ub.rs:20:27
| inside call to `std::ptr::<impl *const Struct>::offset_from` at $DIR/offset_from_ub.rs:19:27
|
::: $DIR/offset_from_ub.rs:14:1
::: $DIR/offset_from_ub.rs:13:1
|
LL | / pub const DIFFERENT_ALLOC: usize = {
LL | |
Expand All @@ -27,9 +27,9 @@ LL | intrinsics::ptr_offset_from(self, origin)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| a memory access tried to interpret some bytes as a pointer
| inside call to `std::ptr::<impl *const u8>::offset_from` at $DIR/offset_from_ub.rs:26:14
| inside call to `std::ptr::<impl *const u8>::offset_from` at $DIR/offset_from_ub.rs:25:14
|
::: $DIR/offset_from_ub.rs:24:1
::: $DIR/offset_from_ub.rs:23:1
|
LL | / pub const NOT_PTR: usize = {
LL | |
Expand All @@ -44,9 +44,9 @@ LL | intrinsics::ptr_offset_from(self, origin)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| exact_div: 1 cannot be divided by 2 without remainder
| inside call to `std::ptr::<impl *const u16>::offset_from` at $DIR/offset_from_ub.rs:34:27
| inside call to `std::ptr::<impl *const u16>::offset_from` at $DIR/offset_from_ub.rs:33:27
|
::: $DIR/offset_from_ub.rs:29:1
::: $DIR/offset_from_ub.rs:28:1
|
LL | / pub const NOT_MULTIPLE_OF_SIZE: usize = {
LL | |
Expand Down