]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/regions-pattern-typing-issue-19997.rs
New upstream version 1.22.1+dfsg1
[rustc.git] / src / test / compile-fail / regions-pattern-typing-issue-19997.rs
CommitLineData
1a4d82fc 1// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
223e47cc
LB
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
ea8adc8c
XL
11// revisions: ast mir
12//[mir]compile-flags: -Z emit-end-regions -Z borrowck-mir
13
223e47cc 14fn main() {
c34b1796
AL
15 let a0 = 0;
16 let f = 1;
1a4d82fc
JJ
17 let mut a1 = &a0;
18 match (&a1,) {
19 (&ref b0,) => {
ea8adc8c
XL
20 a1 = &f; //[ast]~ ERROR cannot assign
21 //[mir]~^ ERROR cannot assign to `a1` because it is borrowed (Ast)
22 //[mir]~| ERROR cannot assign to `a1` because it is borrowed (Mir)
223e47cc
LB
23 }
24 }
25}