Closed
Description
This is currently valid and it shouldn't be.
The issue is in borrowck::gather_loans::mod::
specifically in the gather_loans_for_static_initializer
function. This should be fixed by implementing a small Visitor
that will walk the passed expr and look for cases like the one in the example below:
struct Wrap<T> { value: T }
static UNSAFE: Unsafe<int> = Unsafe{value: 1, marker1: marker::InvariantType};
static WRAPPED_UNSAFE: Wrap<&'static Unsafe<int>> = Wrap { value: &UNSAFE };
fn main() {}
Metadata
Metadata
Assignees
Labels
No labels