Skip to content

Don't pretend that TreeWalkCbData is transparent.#989

Merged
ehuss merged 1 commit intorust-lang:masterfrom
ehuss:fix-tree-walk-cb
Sep 18, 2023
Merged

Don't pretend that TreeWalkCbData is transparent.#989
ehuss merged 1 commit intorust-lang:masterfrom
ehuss:fix-tree-walk-cb

Conversation

@ehuss
Copy link
Copy Markdown
Contributor

@ehuss ehuss commented Sep 16, 2023

This is doing some pointer casts that make the assumption that TreeWalkCbData is transparent, when it is not declared as such. Although this is unlikely to be an issue in practice, it breaks the rules about repr(rust) type layout. This reworks it to avoid that assumption. I think it could potentially be repr(transparent), but I'm not sure that is really necessary. There's probably a better way to avoid the wrapper, but I'm not inclined to try to find it.

@ehuss ehuss added this pull request to the merge queue Sep 18, 2023
Merged via the queue into rust-lang:master with commit a66496a Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant