2016-06-07 11:38:32 +01:00
|
|
|
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
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
|
|
|
|
2016-06-07 11:38:32 +01:00
|
|
|
enum Sexpression {
|
2016-06-07 12:35:41 +01:00
|
|
|
Num(()),
|
|
|
|
Cons(&'static mut Sexpression)
|
2016-06-07 11:38:32 +01:00
|
|
|
}
|
|
|
|
|
2016-06-07 12:35:41 +01:00
|
|
|
fn causes_ice(mut l: &mut Sexpression) {
|
2016-06-07 11:38:32 +01:00
|
|
|
loop { match l {
|
2017-11-15 12:30:30 +03:00
|
|
|
&mut Sexpression::Num(ref mut n) => {},
|
2017-11-11 02:52:39 +05:30
|
|
|
&mut Sexpression::Cons(ref mut expr) => { //[ast]~ ERROR [E0499]
|
2017-12-04 13:21:28 +02:00
|
|
|
//[mir]~^ ERROR [E0499]
|
2017-11-11 02:52:39 +05:30
|
|
|
l = &mut **expr; //[ast]~ ERROR [E0506]
|
2017-11-19 23:37:59 +01:00
|
|
|
//[mir]~^ ERROR [E0506]
|
2016-06-07 11:38:32 +01:00
|
|
|
}
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2016-06-08 13:26:18 +01:00
|
|
|
}
|