fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

1.41.1
622 B16 linesraw
1error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access
2  --> $DIR/yield-while-ref-reborrowed.rs:36:20
3   |
4LL |     let mut b = || {
5   |                 -- generator construction occurs here
6LL |         let a = &mut *x;
7   |                       - first borrow occurs due to use of `x` in generator
8...
9LL |     println!("{}", x);
10   |                    ^ second borrow occurs here
11LL |     Pin::new(&mut b).resume();
12   |              ------ first borrow later used here
13
14error: aborting due to previous error
15
16For more information about this error, try `rustc --explain E0501`.