-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
unsized_fn_params allows some unsized locals #111175
Copy link
Copy link
Open
Labels
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlF-unsized_fn_params`#![feature(unsized_fn_params)]``#![feature(unsized_fn_params)]`requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Metadata
Metadata
Assignees
Labels
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlF-unsized_fn_params`#![feature(unsized_fn_params)]``#![feature(unsized_fn_params)]`requires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Found in rust-lang/miri#2872: this code
with
-Zmir-opt-level=0generates 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_paramsfeature 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: