about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-08-01 16:01:04 +0000
committerbors <bors@rust-lang.org>2014-08-01 16:01:04 +0000
commitf2fa55903e378368ed9173560f03a0ef16e371c2 (patch)
treed4cae634ace46a5b37a50362b42adff727c87177 /src/rustllvm/PassWrapper.cpp
parent624885810344184f7040892637250c35ceaf8db7 (diff)
parent5b85c8cbe70abb914f9ba66116192667b8235cfb (diff)
downloadrust-f2fa55903e378368ed9173560f03a0ef16e371c2.tar.gz
rust-f2fa55903e378368ed9173560f03a0ef16e371c2.zip
auto merge of #16053 : pcwalton/rust/at-pattern-bindings, r=pnkfelix
This is an alternative to upgrading the way rvalues are handled in the
borrow check. Making rvalues handled more like lvalues in the borrow
check caused numerous problems related to double mutable borrows and
rvalue scopes. Rather than come up with more borrow check rules to try
to solve these problems, I decided to just forbid pattern bindings after
`@`. This affected fewer than 10 lines of code in the compiler and
libraries.

This breaks code like:

    match x {
        y @ z => { ... }
    }

    match a {
        b @ Some(c) => { ... }
    }

Change this code to use nested `match` or `let` expressions. For
example:

    match x {
        y => {
            let z = y;
            ...
        }
    }

    match a {
        Some(c) => {
            let b = Some(c);
            ...
        }
    }

Closes #14587.

[breaking-change]

May need discussion at the meeting, but r? @nikomatsakis anyway
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions