Use libcore's align_offset#945
Conversation
|
I think it should be possible to remove that whole if block, as that would fallback to std impl, which now works. |
which if block? do you mean this one?: if this.tcx.lang_items().align_offset_fn() == Some(instance.def.def_id()) { ... }Edit: Ohhh... I think I understand now, so if we remove that block, miri will just load the same code from |
|
@bjorn3 I removed the whole block and ran the test suite. However, one of the tests failed This didn't happen with the changes i did in this branch (and tbh I'm not sure why). Edit: In fact all the tests pass in local with the current branch. I'm not sure why this |
|
I don't have time to review this (and likely won't until I am done traveling, which is in about a month), but I think this needs careful testing before landing. In particular, I think https://github.com/RalfJung/miri-test-libstd should be run with this before r+'ing. I am worried that making EDIT: Ah I see, the code tries to handle this by only doing something smart for sufficiently aligned allocations. That should work. It needs careful testing though. |
76fba09 to
c673492
Compare
So basically this happens because we're running the libcore code without checking that the current alignment is at least the required one? EDIT: I think this is ready for testing, I ran the all the miri tests I had in local (it's still failing in travis and at this point I'm not even sure why) and I think we can test this against stdlib |
c673492 to
b73b668
Compare
|
CI is failing on master, I'll investigate |
b73b668 to
8f72164
Compare
8f72164 to
62280b4
Compare
|
After rebasing to use the most recent |
a90a530 to
fa20338
Compare
|
@bors r+ |
|
📌 Commit 55863cb has been approved by |
Use libcore's align_offset Related issue: #873
|
☀️ Test successful - checks-travis, status-appveyor |
Related issue: #873