Skip to content

Conversation

@ahomescu
Copy link
Contributor

@ahomescu ahomescu commented Nov 25, 2025

Fixes one set of issues with curl (edit: and nginx) caused by a fake equivalence between core::ffi::c_void and libc::timezone:

error[E0308]: mismatched types
    --> src/src/tool_util.rs:15:70
     |
15   |     ::libc::gettimeofday(&mut now as *mut _ as *mut ::libc::timeval, crate::__stddef_null_h::NULL);
     |     -------------------- arguments to this function are incorrect    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*mut timezone`, found `*mut c_void`
     |
     = note: expected raw pointer `*mut timezone`
                found raw pointer `*mut c_void`
note: function defined here
    --> /home/ahomescu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.177/src/unix/linux_like/linux/gnu/mod.rs:1126:12
     |
1126 |     pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int;
     |            ^^^^^^^^^^^^
Som

@ahomescu
Copy link
Contributor Author

ahomescu commented Dec 4, 2025

This fixes #266, we should close that bug when this lands.

@kkysen kkysen changed the title c2rust-refactor: Implement deep structural comparison of ADTs by comparing all variants refactor: Implement deep structural comparison of ADTs by comparing all variants individually Dec 7, 2025
@kkysen kkysen force-pushed the ahomescu/fix_curl_reorganize branch from cfaeceb to b1e71ca Compare December 8, 2025 13:36
@kkysen kkysen merged commit db1b2c8 into master Dec 8, 2025
5 checks passed
@kkysen kkysen deleted the ahomescu/fix_curl_reorganize branch December 8, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

c2rust transpile produces gettimeofday call with wrong argument type when reorganizing definitions

3 participants