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 4 commits into from Mar 25, 2021


Copy link

@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

@dtolnay dtolnay merged commit 64ac0c0 into master Mar 25, 2021
22 checks passed
@dtolnay dtolnay deleted the addrof branch Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

1 participant