-
Notifications
You must be signed in to change notification settings - Fork 748
loops in the name graph #839
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
Comments
Thanks again! As I said in the other bug, the best way to help us fix this issue is by providing a reduced test case: https://github.com/servo/rust-bindgen/blob/master/CONTRIBUTING.md#using-creduce-to-minimize-test-cases |
Agreed, but I would rather file it without a testcase and forget to revisit the issue than not file it at all. |
Yeah, that's fair :) Also sometimes it just rings a bell and we immediately know what's wrong, like in #840. Without a reduced test-case we usually can't afford the time to investigate it in depth, but it's good that we can track it somewhere anyway, so thanks for it! |
AFAICT this is gnutls, which does: // gnutls.h
typedef enum gnutls_cipher_algorithm {
GNUTLS_CIPHER_UNKNOWN = 0,
// ...
} gnutls_cipher_algorithm_t; And then: // compat.h
/* Stuff deprected in 2.x */
typedef gnutls_cipher_algorithm_t gnutls_cipher_algorithm
_GNUTLS_GCC_ATTR_DEPRECATED; |
And thus a reduced test-case could be: typedef enum foo {
BAR,
BAZ,
} foo_t;
typedef foo_t foo; |
Which is quite annoying if you ask me. |
If you run this test case with the current version of bindgen, you get: pub const foo_BAR: foo = 0;
pub const foo_BAZ: foo = 1;
pub type foo = ::std::os::raw::c_uint;
pub use self::foo as foo_t; if you mar #[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum foo {
BAR = 0,
BAZ = 1,
}
pub use self::foo as foo_t; So I think we can close this. |
Input C/C++ Header
I don't have a minimal test case, and the whole thing is multiple megabytes. Perhaps I can revisit this soon and minimize one.
Bindgen Invocation
Actual Results
Expected Results
The first
pub use
is fine, because many of the nearby function declarations usegnutls_cipher_algorithm_t
. The second one is just silly, so it should be pruned.The text was updated successfully, but these errors were encountered: