-
Notifications
You must be signed in to change notification settings - Fork 745
rename TypeKind::Named to TypeKind::TypeParam #915
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
Conversation
Huh. Our CI is still passing, and I can run them locally just fine, so I suspect this is a build env issue. Do you have the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start! The changes that exist are perfect, but we missed a few more places :)
See comments below, and also:
Item::named_type
Type::is_named
Type::is_builtin_or_named
BindgenContext::add_named_type
BindgenContext::get_named_type
BindgenContext::named_types
Thanks!
src/ir/ty.rs
Outdated
@@ -97,10 +97,10 @@ impl Type { | |||
} | |||
} | |||
|
|||
/// Is this type of kind `TypeKind::Named`? | |||
/// Is this type of kind `TypeKind::TypeParam`? | |||
pub fn is_named(&self) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should rename is_named
to is_type_param
as well.
src/ir/ty.rs
Outdated
@@ -259,7 +259,7 @@ impl Type { | |||
/// tests/headers/381-decltype-alias.hpp | |||
pub fn is_invalid_named_type(&self) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should become is_invalid_type_param
.
src/ir/ty.rs
Outdated
@@ -464,14 +464,14 @@ impl DotAttributes for TypeKind { | |||
|
|||
#[test] | |||
fn is_invalid_named_type_valid() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests should replace named_type
with type_param
in their function names.
thanks for the review! I will update the pull request soon. Yup, I ran the tests with tests_expectations outputCompiling tests_expectations v0.1.0 (file:///Users/annaliao/repos/rust-bindgen/tests/expectations) error: unions are unstable and possibly buggy (see issue #32836) --> tests/layout_mbuf.rs:90:1 | 90 | / pub union rte_mbuf__bindgen_ty_1 { 91 | | /// < Atomically accessed refcnt 92 | | pub refcnt_atomic: rte_atomic16_t, 93 | | /// < Non-atomically accessed refcnt 94 | | pub refcnt: u16, 95 | | _bindgen_union_align: u16, 96 | | } | |_^error: unions are unstable and possibly buggy (see issue #32836) error: unions are unstable and possibly buggy (see issue #32836) error: unions are unstable and possibly buggy (see issue #32836) error: unions are unstable and possibly buggy (see issue #32836) error: unions are unstable and possibly buggy (see issue #32836) error: aborting due to 6 previous errors error: Could not compile |
Thanks for the guidance to fix the remaining "named" occurrences. I ran "rust fmt" and it flagged a bunch of line length issues, some in files that I didn't modify. |
Ok, that's (one of?) the issue(s?).
Have you run |
That's fine, don't worry about it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Can you squash these commits into a single commit?
Once that's done, we can land this!
Thanks again!
☔ The latest upstream changes (presumably #916) made this pull request unmergeable. Please resolve the merge conflicts. |
Thanks for the review @fitzgen! I squashed the commits, but I'm not sure if I handled the merge conflicts correctly. Regarding the |
☔ The latest upstream changes (presumably #922) made this pull request unmergeable. Please resolve the merge conflicts. |
Also renames a bunch of other things referring to named types to refer to type parameters. Fixes rust-lang#915
Rename `TypeKind::Named` to `TypeKind::TypeParam` Also renames a bunch of other things referring to named types to refer to type parameters. Fixes #915
Thanks @anna-liao ! I reworded the commit message to be a little more descriptive (you're still marked as author ;) ), and it is landing in #924 Thanks again! |
It is not clear what version of libclang these supported. Refer to rust-lang#1321, rust-lang#1304, rust-lang#916, rust-lang#915.
It is not clear what version of libclang these supported. Refer to rust-lang#1321, rust-lang#1304, rust-lang#916, rust-lang#915.
It is not clear what version of libclang these supported. Refer to rust-lang#1321, rust-lang#1304, rust-lang#916, rust-lang#915.
It is not clear what version of libclang these supported. Refer to rust-lang#1321, rust-lang#1304, rust-lang#916, rust-lang#915.
It is not clear what version of libclang these supported. Refer to rust-lang#1321, rust-lang#1304, rust-lang#916, rust-lang#915.
It is not clear what version of libclang these supported. Refer to rust-lang#1321, rust-lang#1304, rust-lang#916, rust-lang#915.
fixes #914. r? @fitzgen
I made the changes and
cargo build
andcargo test
run ok. However, "testing generated bindings" fails. I checked and it seems to be failing even before my changes?$ cd tests/expectations
$ cargo test