CFI: Fix fn items, closures, and Fn trait objects, and more by rcvalle · Pull Request #116404 · rust-lang/rust

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Oct 3, 2023

@rustbot rustbot added the T-bootstrap

Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

label

Oct 24, 2023

compiler-errors

@rustbot rustbot added S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Oct 25, 2023

compiler-errors

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Oct 26, 2023
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.

@rcvalle

@rcvalle

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 referenced

Mar 26, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Mar 27, 2024
…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`

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Mar 28, 2024
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`

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 28, 2024
…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`

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 29, 2024
…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`

This was referenced

Mar 29, 2024

@rcvalle rcvalle deleted the rust-cfi-fix-115199-3 branch

April 22, 2024 23:07

@rcvalle rcvalle restored the rust-cfi-fix-115199-3 branch

April 22, 2024 23:07