Uh oh!
There was an error while loading. Please reload this page.
Check for intrinsics before coercing to a function pointer - #84404
Conversation
Return an error if coercing function items / non-capturing closures to a common function pointer type would require reifying an intrinsic.
rust-highfive
commented
Apr 21, 2021
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
27637c0 to
75732ddCompareMark-Simulacrum
commented
Apr 22, 2021
@bors r+ Seems OK; we may eventually want to support this with a shim generated in-place, but doesn't seem worth the hassle right now and should be a good change otherwise. |
bors
commented
Apr 22, 2021
📌 Commit 75732dd has been approved by |
Rollup of 7 pull requests Successful merges: - rust-lang#84343 (Remove `ScopeTree::closure_tree`) - rust-lang#84376 (Uses flex to fix formatting of h1 at any width) - rust-lang#84377 (Followup to rust-lang#83944) - rust-lang#84396 (Update LLVM submodule) - rust-lang#84402 (Move `sys_common::rwlock::StaticRWLock` etc. to `sys::unix::rwlock`) - rust-lang#84404 (Check for intrinsics before coercing to a function pointer) - rust-lang#84413 (Remove `sys::args::Args::inner_debug` and use `Debug` instead) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
emilyalbini
commented
Apr 30, 2021
@rust-lang/compiler this PR fixes a beta regression, #84297. Sorry for the late ping, could the backport be approved before next week? |
Mark-Simulacrum
commented
Apr 30, 2021
Hm, this is actually not the right fix, upon further examination; or needs additional work. https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=01fb7cb94c3eda2cfffca68b09b6a709 compiles on stable, and this PR introduces an error rather than ICE, but we need to accept this code... |
I don't think this should be backported, I wrote more in #84297 (comment). |
Mark-Simulacrum
commented
Apr 30, 2021
RalfJung
commented
May 1, 2021
I replied in #84297. |
Mark-Simulacrum
commented
May 3, 2021
Dropping beta-nom here as we're going to end up reverting a different PR instead |
…pping`. Test was added in PR rust-lang#84404. The intent here is: The `copy`/`copy_overlapping` intrinsics are going through some flip-flopping now of "are they intrinsics or not". We can achieve the same effect that the test intended by using `likely`/`unlikely`.
…pping`. Test was added in PR rust-lang#84404. The intent here is: The `copy`/`copy_overlapping` intrinsics are going through some flip-flopping now of "are they intrinsics or not". We can achieve the same effect that the test intended by using `likely`/`unlikely`.
Return an error if coercing function items / non-capturing closures
to a common function pointer type would require reifying an intrinsic.
Turns ICE reported in #84297 into a proper error.