immunant / c2rust

Migrate C code to Rust
https://c2rust.com/
Other
3.95k stars 234 forks source link

analyze: missing lifetime args for structs with no pre-existing lifetimes #949

Closed spernsteiner closed 1 year ago

spernsteiner commented 1 year ago
struct Foo {
    ptr: *mut u8,
}

struct Bar {
    foo: *mut Foo,
}

struct Foo gains a hypothetical lifetime argument to use on ptr. This means the foo field should get rewritten to something like foo: &'h1 Foo<'h2>, but instead it gets rewritten to foo: &'h1 Foo, which is missing the lifetime argument.