12 ms·
I only skimmed through the article, but noticed it is complaining that `&mut function` is not `'static`. This is easily reproducible with: fn foo() { l
by afdbcreid 4y ago
I only skimmed through the article, but noticed it is complaining that `&mut function` is not `'static`. This is easily reproducible with:
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`.