We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4504df7 commit 0379493Copy full SHA for 0379493
src/test/run-pass/issue-25579.rs renamed to src/test/compile-fail/issue-25579.rs
@@ -9,19 +9,19 @@
9
// except according to those terms.
10
11
enum Sexpression {
12
- Num(()),
13
- Cons(&'static mut Sexpression)
+ Num(()),
+ Cons(&'static mut Sexpression)
14
}
15
16
-fn causes_ice(mut l: &mut Sexpression)
17
-{
+fn causes_ice(mut l: &mut Sexpression) {
18
loop { match l {
19
&mut Sexpression::Num(ref mut n) => {},
20
- &mut Sexpression::Cons(ref mut expr) => {
21
- l = &mut **expr;
+ &mut Sexpression::Cons(ref mut expr) => { //~ ERROR cannot borrow `l.0` as mutable more than once at a time [E0499]
+ //~| ERROR cannot borrow `l.0` as mutable more than once at a time [E0499]
+ l = &mut **expr; //~ ERROR cannot assign to `l` because it is borrowed [E0506]
22
23
}}
24
25
26
fn main() {
27
-}
+}
0 commit comments