JohnTitor / ctest2

Automatic testing of FFI bindings for Rust
https://crates.io/crates/ctest2
Apache License 2.0
22 stars 20 forks source link

Replace references of static externs to addr_of!. We need to do this … #56

Closed safinaskar closed 3 months ago

safinaskar commented 6 months ago

…because of https://github.com/rust-lang/rust/issues/114447 .

I need this, because I plan to send PR to crate libc, which will add environ static extern for UNIX. Unfortunately, environ generates annoying warning during testing due to https://github.com/rust-lang/rust/issues/114447 , so I'm sending this PR to ctest2 first.

I tested this ctest2 PR with my fork of crate libc, which adds environ, and all works great.

Also, even if you opposed to proposed crate libc change, this ctest2 PR is of general usefulness anyway.

Also, this ctest2 PR always unconditionally generates addr_of! invocation. This is okay, because ctest2's MSRV is 1.56.0, and addr_of! was added in 1.51.0.

Please, make ctest2 release after this PR is applied

safinaskar commented 6 months ago

CI is failing. But I think this is not because of this PR. If you want, I can try to fix CI anyway

safinaskar commented 5 months ago

@JohnTitor , I fixed CI!!!

I added two commits (second and third), and now CI works. First commit (i. e. introducing addr_of!) is needed for CI, too. So, all 3 commits are needed for CI. Please, review and apply this PR