-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
unsized_locals
fails to uphold alignment requirements
#71416
Comments
Given that libcore and liballoc enable this feature, I am rather concerned they could inadvertently use it in a way that is still unsound. Also, unless we can fix this, the feature should probably be added to |
rustc bootstraps successfully with #71417 applied, so at least right now that does not seem to be the case (modulo the part of libstd that rustc never monomorphizes). Of course, that could change any time, there is no check for this. |
Yes, thanks for opening this. To be specific, the issue here is centered on this line: let x = *mk(); and the fact that we have I think there may be a separate issue on that. (Link?) But: one thing we had discussed was separating out the "sound" part and the "unsound" part into distinct feature gates, so that we can enable only the former in libstd. Perhaps that's a good focus for this issue? |
cc @eddyb, who had discussed the separate feature gate, and @spastorino, who might be interested in doing the follow-up work to create that gate. |
Yes.
Oh, I didn't know that. Let's see if someone finds it.^^
Unlike the other unsound features, this is one where we don't even have a plan for how to soundly implement it. Not sure how much I like keeping that around. |
Yes, I see that argument. I'm reminded of #70193, which limits the max alignment to 4K because of limits in dynamic linkers, though there's no real connection. It's just that part of the challenge here is that the alignment of a |
If #70193 lands we could conservatively align to 4k here. 🤣 (no I am not serious) |
Assigning |
Can't we do something dynamic where we allocate |
This comment has been minimized.
This comment has been minimized.
I don't know -- in #68304 we mostly talked about how to mitigate the effect on stable Rust.
D'oh, I somehow forgot that one can manually implement "aligned" allocation on top of an unaligned allocator. Of course that would work. That's probably better than killing this part of codegen entirely.^^ |
We've discussed this in our last weekly meeting, leaving the nomination up for now as requested by @pnkfelix. He wants to open some fresh issues about this. |
Now that I've created more specific issues to track the important sub-tasks identified here, I think we can remove this from the nominated tickets. |
Given that this feature has been removed from core/alloc and is unstable, I'm going to downgrade this to P-medium. This should obviously block stabilization of |
This is a variant of #68304 that was not fixed by #71170:
still fails with
The text was updated successfully, but these errors were encountered: