summary refs log tree commit diff
path: root/src/librustc_mir/build/expr
AgeCommit message (Collapse)AuthorLines
2018-07-26Issue #51348: lower `match` so an ident gets a distinct temp *for each* ↵Felix S. Klock II-9/+6
candidate pat. This required a bit of plumbing to keep track of candidates. But I took advantage of the hack session to try to improve the docs for the relevant structs here. (I also tried to simplify some of the related code in passing.)
2018-07-23Promoteds are statics and statics have a place, not just a valueOliver Schneider-12/+7
2018-07-20MIR changes to improve NLL cannot mutate errorsMatthew Jasper-1/+116
Alway use unique instead of mutable borrows immutable upvars. Mark variables that are references for a match guard
2018-07-13Auto merge of #52046 - cramertj:fix-generator-mir, r=eddybbors-2/+6
Ensure StorageDead is created even if variable initialization fails Rebase and slight cleanup of https://github.com/rust-lang/rust/pull/51109 Fixes https://github.com/rust-lang/rust/issues/49232 r? @eddyb
2018-07-12Ensure StorageDead is created even if variable initialization failsTaylor Cramer-2/+6
2018-07-03Fix various nll unused mut errorsMatthew Jasper-4/+23
2018-06-27Generate a direct assignment in MIR for `let x = y;`Matthew Jasper-26/+34
2018-06-19Thread info about form of variable bindings, including spans of arg types, ↵Felix S. Klock II-1/+1
down into `mir::LocalDecls`. As a drive-by: the ref_for_guards created by `fn declare_binding` should not have been tagged as user_variables in the first place. These secret internal locals are *pointers* to user variables, but themselves are not such (IMO. For now at least.)
2018-05-30rustc: rename mir::LocalDecl's syntactic_source_info to source_info.Eduard-Mihai Burtescu-1/+1
2018-05-30rustc: turn mir::LocalDecl's visibility_source_info into a SourceScope.Eduard-Mihai Burtescu-1/+1
2018-05-30rustc: rename mir::LocalDecl's source_info to visibility_source_info.Eduard-Mihai Burtescu-1/+1
2018-05-30rustc: turn mir::LocalDecl's syntactic_scope into a SourceInfo.Eduard-Mihai Burtescu-1/+1
2018-05-29Expand two-phase-borrows so that a case like this still compiles:Felix S. Klock II-2/+3
```rust fn main() { fn reuse<X>(_: &mut X) {} let mut t = 2f64; match t { ref mut _b if { false } => { reuse(_b); } _ => {} } } ``` Note: The way this is currently written is confusing; when `autoref` is off, then the arm body bindings (introduced by `bind_matched_candidate_for_arm_body`) are *also* used for the guard. (Any attempt to fix this needs to still ensure that the bindings used by the guard are introduced before the guard is evaluated.) (Once we turn NLL on by default, we can presumably simplify all of that.)
2018-05-24`tcx.lift_to_global` > `tcx.global_tcx().lift`Oliver Schneider-6/+4
2018-05-24Get rid of `scalar_size`Oliver Schneider-5/+9
2018-05-24change `Value::Bytes` to `Value::Bits`Oliver Schneider-2/+2
2018-05-17Rename trans to codegen everywhere.Irina Popa-3/+3
2018-05-11Introduce ConstValue and use it instead of miri's Value for constant valuesJohn Kåre Alsaker-14/+7
2018-05-08Store the GeneratorInterior in the new GeneratorSubstsJohn Kåre Alsaker-18/+22
2018-05-08Store generator movability outside GeneratorInteriorJohn Kåre Alsaker-3/+4
2018-05-03When using NLL, implicitly borrow match bindings for any guard,Felix S. Klock II-2/+13
deref'ing such borrows within that guard. Review feedback: Add comment noting a point where we may or may not need to add a cast when we finish the work on rust-lang/rust#27282. Review feedback: Pass a newtype'd `ArmHasGuard` rather than a raw boolean. Review feedback: toggle "ref binding in guards" semantics via specific method. (This should ease a follow-up PR that just unconditionally adopts the new semantics.)
2018-04-30Unify MIR assert messages and const eval errorsOliver Schneider-6/+6
2018-04-30Merge ConstMathError into EvalErrorKindOliver Schneider-16/+7
2018-04-30Remove the `rustc_const_math` crateOliver Schneider-2/+1
2018-04-27Rename InternedString to LocalInternedString and introduce a new thread-safe ↵John Kåre Alsaker-1/+1
InternedString
2018-04-26rustc_target: move in syntax::abi and flip dependency.Irina Popa-1/+1
2018-03-14remove defaulting to unitAndrew Cann-1/+1
Types will no longer default to `()`, instead always defaulting to `!`. This disables the associated warning and removes the flag from TyTuple
2018-03-08Use clearer name for integer bit width helper functionOliver Schneider-2/+2
2018-03-08Don't use the undefined bytes of PrimVal::BytesOliver Schneider-27/+11
2018-03-08Nuke ConstInt and Const*sizeOliver Schneider-47/+16
2018-03-08Nuke the entire ctfe from orbit, it's the only way to be sureOliver Schneider-17/+5
2018-03-08Produce instead of pointersOliver Schneider-3/+18
2018-02-07[ci skip] Generate false edges from loop_blockbobtwinkles-24/+22
As opposed to using weirdness involving pretending the body block is the loop block. This does not pass tests This commit is [ci skip] because I know it doesn't pass tests yet. Somehow this commit introduces nondeterminism into the handling of loops.
2018-02-05mir: Add false edge cleanup out of infinite loopsbobtwinkles-5/+17
Fixes #46036
2018-02-05Fix comment in ExprKind::LogicalOpbobtwinkles-2/+2
The comment previously implied that the true branch would result in the false block. Fortunately the implementation is correct.
2018-01-25Fix never-type rvalue ICEvarkor-1/+1
2018-01-04rustc: use {U,I}size instead of {U,I}s shorthands.Eduard-Mihai Burtescu-2/+2
2017-12-21fix debuginfo scoping of let-statementsAriel Ben-Yehuda-1/+1
2017-12-05rustc_mir: don't move temporaries that are still used later.Eduard-Mihai Burtescu-4/+4
2017-12-03funnel all unwind paths through a single Resume blockAriel Ben-Yehuda-1/+1
This simplifies analysis and borrow-checking because liveness at the resume point can always be simply propagated. Later on, the "dead" Resumes are removed.
2017-12-03initialize the destination in unit statementsAriel Ben-Yehuda-1/+3
Fixes #46159.
2017-12-01MIR: s/lv(al(ue)?)?/place in function/variable/module names.Eduard-Mihai Burtescu-37/+37
2017-12-01MIR: s/Lvalue/Place in type names.Eduard-Mihai Burtescu-25/+25
2017-11-28MIR: split Operand::Consume into Copy and Move.Eduard-Mihai Burtescu-17/+17
2017-11-17MIR: hide .rodata constants vs by-ref ABI clash in trans.Eduard-Mihai Burtescu-7/+1
2017-10-26Add comments to clarify function argument ownershipBjörn Steinbrink-0/+2
2017-10-26Avoid unnecessary copies of arguments that are simple bindingsBjörn Steinbrink-1/+5
Initially MIR differentiated between arguments and locals, which introduced a need to add extra copies assigning the argument to a local, even for simple bindings. This differentiation no longer exists, but we're still creating those copies, bloating the MIR and LLVM IR we emit. Additionally, the current approach means that we create debug info for both the incoming argument (marking it as an argument), and then immediately shadow it a local that goes by the same name. This can be confusing when using e.g. "info args" in gdb, or when e.g. a debugger with a GUI displays the function arguments separately from the local variables, especially when the binding is mutable, because the argument doesn't change, while the local variable does.
2017-09-24move unsafety checking to MIRAriel Ben-Yehuda-3/+16
No functional changes intended.
2017-09-24add lint levels to VisibilityScopeAriel Ben-Yehuda-13/+15
2017-09-20address review commentsAriel Ben-Yehuda-1/+5