-
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
Implement Unsized Rvalues #51131
Implement Unsized Rvalues #51131
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
f6f4804
to
4dc11f5
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☔ The latest upstream changes (presumably #51182) made this pull request unmergeable. Please resolve the merge conflicts. |
2c27df5
to
55a1e92
Compare
I found several missing sizedness checking, namely
As adding As these plans are going to be large (for me, at least), I want to have this PR merged for now and prepare different PRs. |
☔ The latest upstream changes (presumably #50338) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #51140) made this pull request unmergeable. Please resolve the merge conflicts. |
This PR seems to be missed, perhaps because it was initially |
Ping from triage @aturon! This PR needs your review. |
cc @rust-lang/compiler I'm not a suitable reviewer for this, can someone take it? |
Ah, r? @nikomatsakis based on a previous comment |
The paragraph described a case where we can't optimize away repetitive dynamic stack allocation. However, as arielb1 pointed out, it can actually optimizable by dynamically delaying the stack unwinding.
Rebased. r? @eddyb |
@bors r+ |
📌 Commit c488d59 has been approved by |
Implement Unsized Rvalues This PR is the first step to implement RFC1909: unsized rvalues (#48055). ## Implemented - `Sized` is removed for arguments and local bindings. (under `#![feature(unsized_locals)]`) - Unsized locations are allowed in MIR - Unsized places and operands are correctly translated at codegen ## Not implemented in this PR - Additional `Sized` checks: - tuple struct constructor (accidentally compiles now) - closure arguments at closure generation (accidentally compiles now) - upvars (ICEs now) - Generating vtable for `fn method(self)` (ICEs now) - VLAs: `[e; n]` where `n` isn't const - Reduce unnecessary allocations ## Current status - [x] Fix `__rust_probestack` (rust-lang/compiler-builtins#244) - [x] Get the fix merged - [x] `#![feature(unsized_locals)]` - [x] Give it a tracking issue number - [x] Lift sized checks in typeck and MIR-borrowck - [ ] <del>Forbid `A(unsized-expr)`</del> will be another PR - [x] Minimum working codegen - [x] Add more examples and fill in unimplemented codegen paths - [ ] <del>Loosen object-safety rules (will be another PR)</del> - [ ] <del>Implement `Box<FnOnce>` (will be another PR)</del> - [ ] <del>Reduce temporaries (will be another PR)</del>
☀️ Test successful - status-appveyor, status-travis |
This PR is the first step to implement RFC1909: unsized rvalues (#48055).
Implemented
Sized
is removed for arguments and local bindings. (under#![feature(unsized_locals)]
)Not implemented in this PR
Sized
checks:fn method(self)
(ICEs now)[e; n]
wheren
isn't constCurrent status
__rust_probestack
(Fix segfault on probestack with dynamic alloca. compiler-builtins#244)#![feature(unsized_locals)]
Forbidwill be another PRA(unsized-expr)
Loosen object-safety rules (will be another PR)ImplementBox<FnOnce>
(will be another PR)Reduce temporaries (will be another PR)