Closed
Description
See the repo at https://github.com/khuey/rust-nightly-borrow-checker-failure
This repository builds on 1.34.2. It fails on 1.35.0-beta.8 with
error[E0597]: `global_lock` does not live long enough
--> src/lib.rs:24:26
|
24 | let locked = global_lock.as_ref().lock().unwrap();
| ^^^^^^^^^^^ borrowed value does not live long enough
25 | ptr::write(&mut self.global_lock, Some(locked));
| --------------------- cast requires that `global_lock` is borrowed for `'static`
26 | }
27 | }
| - `global_lock` dropped here while still borrowed
error: aborting due to previous error