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.

}

def1.all_fields().count() == def2.all_fields().count()
def1.variants().len() == def2.variants().len()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.all_fields() does a flat map over .variants() and then .fields(), which is what we're doing here. Is the issue that the flattened iterator may have the same elements, but the boundaries of each variant are different?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, plus that it doesn't account correctly for empty variants. For example, it considers the following two enums equivalent:

enum Foo {
  One,
}
enum Bar {
  One,
  Two,
}

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.

3 participants