immunant / c2rust

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

analyze: hypothetical lifetime params aren't added to union defs #995

Closed spernsteiner closed 11 months ago

spernsteiner commented 1 year ago
pub union Foo {
    x: usize,
    y: *mut u8,
}

struct UseFoo {
    foo: *mut Foo,
}

Rewritten output:

pub union Foo {
    x: usize,
    y: *mut u8,
}

struct UseFoo<'h1,'h0> {
    foo: &'h1 (Foo<'h0>),
}

A lifetime argument is added to the use of Foo in the type of the UseFoo::foo field, but no matching parameter declaration is added to the definition of union Foo.

This might be related to #994.