Skip to content

Bug: missing lifetime information about upvars #1040

@Nadrieril

Description

@Nadrieril

This:

fn foo(s: &u8) {
    let _ = || &*s;
}

gives the following LLBC:

struct closure<'_0> {
  &'_0 u8,
}
fn call_mut<'_0, '_1, '_2>(_1: &'_2 mut closure<'_0>, _2: ()) -> &'_1 u8 {
  ...
}

_1 and _0 should be the same.

In practice I don't know how to solve this: rustc doesn't seem to encode this information where I expect it; the lifetimes of borrowed upvars are erased.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugA bug in charon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions