]> git.lizzy.rs Git - rust.git/commit
Auto merge of #51131 - qnighy:unsized-locals, r=eddyb
authorbors <bors@rust-lang.org>
Sun, 19 Aug 2018 12:21:56 +0000 (12:21 +0000)
committerbors <bors@rust-lang.org>
Sun, 19 Aug 2018 12:21:56 +0000 (12:21 +0000)
commitb355906919927ab3c879becd14392f023af883a1
treea66236f67a3ca25946b81f6306aa8f5368c83363
parent8928de74394f320d1109da6731b12638a2167945
parentc488d59addf6bc66725a2ca7314629ee0f92b4e5
Auto merge of #51131 - qnighy:unsized-locals, r=eddyb

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-nursery/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>
src/librustc/traits/error_reporting.rs
src/librustc_typeck/check/mod.rs