-
Notifications
You must be signed in to change notification settings - Fork 9
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
Small boxes #35
Comments
Can you explain how this works? AFAICT, |
I suppose some inherent methods like As to how it'd work, all call sites that know the exact type must know that because it's smaller than a usize then they should expect a usize. In particular any In essence the rule becomes: optimize an immutable or owning refernece to a I gave an example of doing this for just the Anyways maybe this goes against Rust's explicitness goals and it should be some other |
I noticed in rust-lang/rust#48331 (comment) that types smaller than usize could often be "boxed" without any allocation. There are some array crates like Bytes that provide such functionality, but doing this with
Box
mostly requires the vtable accommodate. I suspect doing this could dramatically improve our error handling story for crates that work both with and without std.The text was updated successfully, but these errors were encountered: