Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analyze: rewriter adds hypothetical lifetime args to mentions of non-rewritten structs #994

Closed
spernsteiner opened this issue Jul 17, 2023 · 2 comments · Fixed by #1015
Closed
Assignees

Comments

@spernsteiner
Copy link
Collaborator

extern "C" {
    fn epoll_wait(events: *mut epoll_event);
}

pub struct fdevents {
    pub epoll_events: *mut epoll_event,
}

pub struct epoll_event {
    pub ptr: *mut u8,
}

Rewritten output:

extern "C" {
    fn epoll_wait(events: *mut epoll_event);
}

pub struct fdevents<'h4,'h5> {
    pub epoll_events: &'h4 (epoll_event<'h5>),
}

pub struct epoll_event {
    pub ptr: *mut u8,
}

struct epoll_event can't be rewritten, since it's exposed to FFI via fn epoll_wait. But the field type in fdevents is rewritten as if a lifetime parameter was added to epoll_event.

@kkysen
Copy link
Contributor

kkysen commented Jul 17, 2023

struct epoll_event's fields are marked FIXED as per #960, right? This just needs to skip adding hypothetical lifetimes to FIXED fields/types, rights?

@spernsteiner
Copy link
Collaborator Author

Yes, something like that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment