-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
CFI: Fix fn items, closures, and Fn trait objects, and more #116404
Conversation
r? @oli-obk (rustbot has picked a reviewer for you, use r? to override) |
5157709
to
256cab2
Compare
This comment has been minimized.
This comment has been minimized.
256cab2
to
a25171b
Compare
☔ The latest upstream changes (presumably #115948) made this pull request unmergeable. Please resolve the merge conflicts. |
a25171b
to
d676343
Compare
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
d676343
to
df8c3a8
Compare
One nit @rustbot author |
df8c3a8
to
dd04959
Compare
d5b79c1
to
3e28128
Compare
@rustbot label -S-waiting-on-author +S-waiting-on-review |
☔ The latest upstream changes (presumably #117875) made this pull request unmergeable. Please resolve the merge conflicts. |
bc7ae20
to
6f146f5
Compare
This comment has been minimized.
This comment has been minimized.
4abea48
to
f28ac45
Compare
Fix casting between function items, closures, and Fn trait objects by transforming function items, closures, and Fn trait objects into function pointers for encoding.
Fix drop and drop_in_place by transforming self of drop and drop_in_place methods into a Drop trait object and handling drop method calls separatedly (and also transforming self into a Drop trait object). This has the same effect of what CFI does for impl methods by transforming self into trait objects that match the trait objects in the calls after type erasure.
Fix rust-lang#122705 by adding support for encoding `ty:CoroutineClosure`.
This reverts commit f2f0d25.
Fix casting between methods and function pointers by assigning a secondary type id to methods with their concrete self so they can be used as function pointers.
f28ac45
to
66b2708
Compare
☔ The latest upstream changes (presumably #122980) made this pull request unmergeable. Please resolve the merge conflicts. |
Given that this PR is doing like 5+ different things, I'd like to see this broken up into several different PRs to be honest. Like, there's no reason why the PR which changes coroutine encoding needs to go into the same PR which changes the way we encode the receiver for |
Sure. I'll split it into smaller self-contained PRs. |
…place, r=compiler-errors CFI: Fix drop and drop_in_place Fix drop and drop_in_place by transforming self of drop and drop_in_place methods into a Drop trait objects. This was split off from rust-lang#116404. cc `@compiler-errors` `@workingjubilee`
Rollup merge of rust-lang#123075 - rcvalle:rust-cfi-fix-drop-drop-in-place, r=compiler-errors CFI: Fix drop and drop_in_place Fix drop and drop_in_place by transforming self of drop and drop_in_place methods into a Drop trait objects. This was split off from rust-lang#116404. cc `@compiler-errors` `@workingjubilee`
…ast, r=compiler-errors CFI: Fix methods as function pointer cast Fix casting between methods and function pointers by assigning a secondary type id to methods with their concrete self so they can be used as function pointers. This was split off from rust-lang#116404. cc `@compiler-errors` `@workingjubilee`
…ast, r=compiler-errors CFI: Fix methods as function pointer cast Fix casting between methods and function pointers by assigning a secondary type id to methods with their concrete self so they can be used as function pointers. This was split off from rust-lang#116404. cc `@compiler-errors` `@workingjubilee`
@rustbot label A-sanitizers |
Closing this as it's being split into multiple prs |
This PR:
encode_ty: unexpected 'CoroutineWitness'
#122705 by adding support for encodingty:CoroutineClosure
.This is a zero cost solution for both the Rust compiler and compiled programs (i.e., without generating any shims/trampolines or changing the compiler code generation at all) for the issues described and solutions proposed in #121962 and #122573.