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

Any and Any::get_type_id should not be stable #19222

Closed
reem opened this issue Nov 22, 2014 · 1 comment
Closed

Any and Any::get_type_id should not be stable #19222

reem opened this issue Nov 22, 2014 · 1 comment

Comments

@reem
Copy link
Contributor

reem commented Nov 22, 2014

The Any trait is not in release condition at all, considering that is still uses slow virtual calls that could be replaced with an associated static in the near future but stabilizing with get_type_id would mean that it could not be removed.

Normally, this isn't an issue, but since Any is almost exclusively used through trait objects this blocks possible optimizations to layout that could allow Box<Any> to be represented as *mut (), TypeId instead of containing a full vtable.

@huonw huonw added the A-libs label Nov 22, 2014
@huonw
Copy link
Member

huonw commented Nov 22, 2014

It would need to be (*mut (), *const (fn(*mut u8), TypeId)), where the fn is the destructor (btw).

@bors bors closed this as completed in 4705475 Nov 24, 2014
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

No branches or pull requests

2 participants