Skip to content
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

Eliminate functionally duplicate vtable methods on rustc 1.51+ #145

Merged
merged 4 commits into from Mar 25, 2021

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Mar 25, 2021

Using the raw pointer addr_of macro, it's possible for the vtable methods to avoid instantiating any & or &mut and operate only in terms of pointers, allowing Deref and DerefMut to reuse a single piece of vtable logic, and downcast_ref and downcast_mut to reuse a single piece.

Closes #62.
FYI @thomcc

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.

Consider using pointers and &raw operator in object_downcast implementation
1 participant