-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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. |
jyn514
added
A-MIR
Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
requires-nightly
This issue requires a nightly compiler in some way.
F-unsized_fn_params
`#![feature(unsized_fn_params)]`
labels
May 4, 2023
The bad MIR builing is here:
Any unsized function call operand other than a |
rustbot
removed
the
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
label
May 23, 2023
RalfJung
changed the title
unsized_fn_params allows some unsized locals, hitting unsound alloca codegen path
unsized_fn_params allows some unsized locals
Aug 6, 2023
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: