2023-04-28 16:50:28 +00:00
|
|
|
// edition:2021
|
|
|
|
// compile-flags: -Zdrop-tracking-mir=yes
|
|
|
|
#![feature(generators)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = &mut ();
|
|
|
|
|| {
|
|
|
|
let _c = || yield *&mut *x;
|
|
|
|
|| _ = &mut *x;
|
2023-04-28 17:37:56 +00:00
|
|
|
//~^ cannot borrow `*x` as mutable more than once at a time
|
2023-04-28 16:50:28 +00:00
|
|
|
};
|
|
|
|
}
|