Skip to content

Commit

Permalink
add tests to ensure foreign-mentioned structs do not have lifetime pa… (
Browse files Browse the repository at this point in the history
#1018)

Extra tests given that #1015 works and #1013 is overcome by #1015
  • Loading branch information
aneksteind authored and spernsteiner committed Aug 23, 2023
2 parents 22daf11 + fef7517 commit 9267e55
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions c2rust-analyze/tests/filecheck/foreign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,23 @@ extern "C" {
// CHECK-DAG: fn f(bin: *mut Bin)
fn f(bin: *mut Bin);
}

extern "C" {
// CHECK-DAG: fn epoll_wait(events: *mut epoll_event);
fn epoll_wait(events: *mut epoll_event);
}

// CHECK-DAG: pub struct fdevents<'h0> {
pub struct fdevents {
// CHECK-DAG: pub epoll_events: &'h0 (epoll_event),
pub epoll_events: *mut epoll_event,
}

// CHECK-DAG: pub struct epoll_event {
pub struct epoll_event {
// CHECK-DAG: pub ptr: *mut u8,
pub ptr: *mut u8,
}

// CHECK-DAG: fn events<'h0>(f: fdevents<'h0>) {}
fn events(f: fdevents) {}

0 comments on commit 9267e55

Please sign in to comment.