about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2018-05-11 23:32:13 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2018-05-29 23:02:40 +0200
commit3bc5073dbb9e284a64ae8815bdb54d3b1d6c484a (patch)
tree0e32581b8efd03bb5ccb8255c9a11c6e1e0d29ec /src/rustllvm/RustWrapper.cpp
parent638acd300fa42a2d0128378a37bffae2c11315ad (diff)
downloadrust-3bc5073dbb9e284a64ae8815bdb54d3b1d6c484a.tar.gz
rust-3bc5073dbb9e284a64ae8815bdb54d3b1d6c484a.zip
Expand two-phase-borrows so that a case like this still compiles:
```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.)
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions