rust-lang / miri

An interpreter for Rust's mid-level intermediate representation
Apache License 2.0
4.17k stars 320 forks source link

Adjust Allocation Bytes used by Miri to custom MiriAllocBytes #3526

Closed Strophox closed 1 month ago

Strophox commented 2 months ago

Previously, the MiriMachine used type Bytes = Box<[u8]> for its allocations. This PR swaps this out for a custom MiriAllocBytes type implemented in alloc_bytes.rs. This is in anticipation of an extension to Miri's FFI, which will require its allocations to take care of alignment (the methods in impl AllocBytes for Box<[u8]> ignore this _align: Align argument).

Needs https://github.com/rust-lang/rust/pull/124492

RalfJung commented 2 months ago

r? @RalfJung

RalfJung commented 2 months ago

If you rebase over the latest Miri master, you should get the updated rustc that includes your PR, so that this one can finally build. :)

rustbot commented 1 month ago

There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

You can start a rebase with the following commands:

$ # rebase
$ git pull --rebase https://github.com/rust-lang/miri.git master
$ git push --force-with-lease

The following commits are merge commits:

RalfJung commented 1 month ago

Looks good, thanks!

Please squash this into a single commit.

RalfJung commented 1 month ago

Thanks!

Force-pushes do not always trigger a notification on github, so you have to let the reviewer know that the PR is ready again. In Rust we have the @rustbot ready command for that.

@bors r+

bors commented 1 month ago

:pushpin: Commit cf6330c67593874edd79f6005efd7322c7668def has been approved by RalfJung

It is now in the queue for this repository.

bors commented 1 month ago

:hourglass: Testing commit cf6330c67593874edd79f6005efd7322c7668def with merge fef104380a39474b8a88f8e273a312eedeabb42d...

bors commented 1 month ago

:sunny: Test successful - checks-actions Approved by: RalfJung Pushing fef104380a39474b8a88f8e273a312eedeabb42d to master...