a-mir-formality icon indicating copy to clipboard operation
a-mir-formality copied to clipboard

issue-25860 spike

Open nikomatsakis opened this issue 3 years ago • 0 comments

The goal of this spike is to get this program checking completely within a-mir-formality:

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;
}

Subgoals:

  • [ ] #25
  • [ ] #23
  • [ ] #54
  • [x] #24
  • [ ] #55
  • [ ] #26
  • [ ] #28
  • [ ] #30
  • [ ] #29

nikomatsakis avatar May 17 '22 21:05 nikomatsakis