An Unfortunate Experience with Rust
blog.polybdenum.com
blog.polybdenum.com
fn foo() {
let _: &'static mut _ = &mut foo;
}
And it is because while `foo` is definitely `'static`, `&mut foo` needs to be able to mutate something. The hidden secret is that `&mut foo` is desugared into something like let mut __temp = foo;
&mut __temp
And so it is not `'static`.