-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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_fn_params allows some unsized locals #111175
Labels
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
F-unsized_fn_params
`#![feature(unsized_fn_params)]`
requires-nightly
This issue requires a nightly compiler in some way.
Comments
I forgot how exactly #78152 works, but for some reason it lets this pass. Either the analysis should reject this, or MIR building needs to not create an unsized local here. |
The bad MIR builing is here:
Any unsized function call operand other than a |
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
F-unsized_fn_params
`#![feature(unsized_fn_params)]`
requires-nightly
This issue requires a nightly compiler in some way.
Found in rust-lang/miri#2872: this code
with
-Zmir-opt-level=0
generates this LLVM IRNotice the
alloca
. This is bad! Our alloca code path is unsound (it does not properly account for alignment); the point of theunsized_fn_params
feature gate (separate fromunsized_locals
) was to avoid hitting that code path.I repeat my stance that we should remove the unsound alloca code path (effectively de-imlementing unsized locals) to ensure this can never happen.
We don't have a MIR building ping group AFAIK, so Cc @rust-lang/wg-mir-opt I guess.
Here's a Miri testcase:
The text was updated successfully, but these errors were encountered: