a-mir-formality
a-mir-formality copied to clipboard
Convert issue-25860 Ruts into a formality test case, including MIR
Depends on #25
Convert
static UNIT: &'static &'static () = &&();
fn foo<'a, 'b, T>(_: &'a &'b (), v: &'b T) -> &'a T {
v
}
fn bad<'a, T>(x: &'a T) -> &'static T {
let f: fn(_, &'a T) -> &'static T = foo;
f(UNIT, x)
}
fn main() {
let value = {
let data = 22;
bad(&data)
};
let _ = *value;
}
into a representative test case, including MIR.
This requires extending the MIR layer with a bit of plumbing (it can be dummy plumbing).