-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
core: Inline From<AllocErr> for CollectionAllocErr
#49850
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @sfackler |
@bors r+ |
📌 Commit 9e73690 has been approved by |
I suspect this PR causes the failure of #49875 (comment). (The image is |
@bors: r- Yes this is the correct diagnosis. No idea how this would cause that issue, but I'll diagnose locally. |
@eddyb do you think you could help me debug this? I've minimized this without many dependencies which fails on today's nightly. If you run in the playground it panics when the program should exit successfully. I've bisected this historically in nightlies to this range which is most likely pointing to #45225. I'm having trouble pinning down precisely where the error is being introduced in trans or in the IR, and this may also be related somewhat to the funky In any case I'm curious if you can see anything "obviously wrong" in the codegen I may be missing |
If you look at the "can this call instruction write to this pointer" code, you can see this special-case: // If the CallSite is to malloc or calloc, we can assume that it doesn't
// modify any IR visible value. This is only valid because we assume these
// routines do not read values visible in the IR. TODO: Consider special
// casing realloc and strdup routines which access only their arguments as
// well. Or alternatively, replace all of this with inaccessiblememonly once
// that's implemented fully.
auto *Inst = CS.getInstruction();
if (isMallocOrCallocLikeFn(Inst, &TLI)) {
// Be conservative if the accessed pointer may alias the allocation -
// fallback to the generic handling below.
if (getBestAAResults().alias(MemoryLocation(Inst), Loc) == NoAlias)
return ModRefInfo::NoModRef;
} What this means in practice is that However, in @alexcrichton's examples it's not the |
☔ The latest upstream changes (presumably #49669) made this pull request unmergeable. Please resolve the merge conflicts. |
This shows up in allocations of vectors and such, so no need for it to not be inlined!
9e73690
to
2e73e76
Compare
@bors: r=sfackler rollup |
📌 Commit 2e73e76 has been approved by |
@bors rollup- This PR might still be too risky to rollup. See #49904 (comment). |
core: Inline `From<AllocErr> for CollectionAllocErr` This shows up in allocations of vectors and such, so no need for it to not be inlined!
☀️ Test successful - status-appveyor, status-travis |
This shows up in allocations of vectors and such, so no need for it to not be
inlined!