2015-10-04 04:57:32 -05:00
|
|
|
// Test to ensure we only report an error for the first issued loan that
|
|
|
|
// conflicts with a new loan, as opposed to every issued loan. This keeps us
|
|
|
|
// down to O(n) errors (for n problem lines), instead of O(n^2) errors.
|
|
|
|
|
2017-11-11 02:52:39 +05:30
|
|
|
// revisions: ast mir
|
2017-11-19 23:37:59 +01:00
|
|
|
//[mir]compile-flags: -Z borrowck=mir
|
2017-11-11 02:52:39 +05:30
|
|
|
|
2015-10-04 04:57:32 -05:00
|
|
|
fn main() {
|
|
|
|
let mut x = 1;
|
2018-04-09 05:28:00 -04:00
|
|
|
let mut addr = vec![];
|
2015-10-04 04:57:32 -05:00
|
|
|
loop {
|
|
|
|
match 1 {
|
2018-04-09 05:28:00 -04:00
|
|
|
1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
2017-11-19 23:37:59 +01:00
|
|
|
//[mir]~^ ERROR [E0499]
|
2018-04-09 05:28:00 -04:00
|
|
|
2 => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
2017-12-04 13:21:28 +02:00
|
|
|
//[mir]~^ ERROR [E0499]
|
2018-04-09 05:28:00 -04:00
|
|
|
_ => { addr.push(&mut x); } //[ast]~ ERROR [E0499]
|
2017-12-04 13:21:28 +02:00
|
|
|
//[mir]~^ ERROR [E0499]
|
2015-10-04 04:57:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|