-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Unimplement unsized_locals #141811
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
base: master
Are you sure you want to change the base?
Unimplement unsized_locals #141811
Conversation
r? @SparrowLii rustbot has assigned @SparrowLii. Use |
The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes. cc @BoxyUwU, @jieyouxu, @Kobzol The Miri subtree was changed cc @rust-lang/miri Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in src/tools/clippy cc @rust-lang/clippy This PR changes a file inside Some changes occurred in compiler/rustc_codegen_gcc This PR changes MIR |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -1951,7 +1950,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { | |||
); | |||
} | |||
|
|||
// When `unsized_fn_params` and `unsized_locals` are both not enabled, | |||
// When `unsized_fn_params` is both not enabled, |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
50c26a1
to
8f1e09e
Compare
That's 2 years ago and so it's not indicative of the team position today. Some stuff happened since then since some people want to preserve the feature. This will need a new MCP I think. |
This comment has been minimized.
This comment has been minimized.
I don't think anything changed about the biggest issues (MIR support being lacking), the unsoundness around alignment was just one small factor I'd say. No one has stepped up to actually resolve any of these issues in two years, which doesn't indicate a lot of interest in the feature to me. That said, if you think a re-MCP should be done, I'd be happy to help drafting that up (I imagine it would mostly just copy from the old MCP). |
The MIR representation of unsized locals still needs to be re-done from scratch, that is true. |
@@ -247,6 +247,8 @@ declare_features! ( | |||
/// Allows unnamed fields of struct and union type | |||
(removed, unnamed_fields, "1.83.0", Some(49804), Some("feature needs redesign")), | |||
(removed, unsafe_no_drop_flag, "1.0.0", None, None), | |||
/// Allows unsized rvalues at arguments and parameters. | |||
(removed, unsized_locals, "CURRENT_RUSTC_VERSION", Some(48055), Some("removed due to soundness issues; see https://github.com/rust-lang/rust/issues/111942")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(removed, unsized_locals, "CURRENT_RUSTC_VERSION", Some(48055), Some("removed due to soundness issues; see https://github.com/rust-lang/rust/issues/111942")), | |
(removed, unsized_locals, "CURRENT_RUSTC_VERSION", Some(48055), Some("removed due to implementation concerns; see https://github.com/rust-lang/rust/issues/111942")), |
As pointed out by Ralf, it should be sound, just not sufficiently implemented
Maybe a dumb question, but why not remove the implementation? If the implementation is going to be there anyway, feels like having the feature is fine. (My preference would be to remove the implementation too.) |
The implementation should be removed too but not in this PR^^ |
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove all those newlines and run x.py test src/tools/clippy --bless
once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The blank lines are intentional for now, I will address them later. I wanted to check that CI got green but that command is broken and I didn't have the time to debug clippy at the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change makes sense. I know little about unsized locals, so I'd like to have someone more experienced take a look. |
Implements rust-lang/compiler-team#630
Tracking issue here: #111942
Note that this just removes the feature, not the implementation, and does not touch
unsized_fn_params
. This is because it is required to supportBox<dyn FnOnce()>: FnOnce()
.There may be more that should be removed (possibly in follow up prs)
forget_unsized
function andforget
intrinsic.unsized_locals
test directory; I've just fixed up the tests for nowcc @JakobDegen @oli-obk @Noratrieb @programmerjake @bjorn3
@rustbot label F-unsized_locals
Fixes #79409