b355906919
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> |
||
---|---|---|
.. | ||
back | ||
debuginfo | ||
llvm | ||
mir | ||
abi.rs | ||
allocator.rs | ||
asm.rs | ||
attributes.rs | ||
base.rs | ||
build.rs | ||
builder.rs | ||
callee.rs | ||
Cargo.toml | ||
common.rs | ||
consts.rs | ||
context.rs | ||
declare.rs | ||
diagnostics.rs | ||
glue.rs | ||
intrinsic.rs | ||
lib.rs | ||
llvm_util.rs | ||
metadata.rs | ||
meth.rs | ||
mono_item.rs | ||
README.md | ||
type_.rs | ||
type_of.rs | ||
value.rs |
The codegen
crate contains the code to convert from MIR into LLVM IR,
and then from LLVM IR into machine code. In general it contains code
that runs towards the end of the compilation process.
For more information about how codegen works, see the rustc guide.