Skip to content

Honor cbindgen:ignore directives for associated functions and constants#949

Merged
emilio merged 3 commits intomozilla:masterfrom
scovich:ignore-associated-items
May 7, 2024
Merged

Honor cbindgen:ignore directives for associated functions and constants#949
emilio merged 3 commits intomozilla:masterfrom
scovich:ignore-associated-items

Conversation

@scovich
Copy link
Copy Markdown
Contributor

@scovich scovich commented May 2, 2024

Fix for #947

Add missing checks so that cbindgen honors cbindgen:ignore directives for associated functions and constants declared inside a struct impl.

@scovich scovich changed the title Expand ignored.rs test to cover associated items Honor cbindgen:ignore directives for associated functions and constants May 2, 2024
@scovich scovich marked this pull request as ready for review May 2, 2024 23:20
@scovich
Copy link
Copy Markdown
Contributor Author

scovich commented May 7, 2024

The clippy failures all seem to be in code this PR didn't touch, e.g.

error: assigning the result of `ToOwned::to_owned()` may be inefficient
   --> src/bindgen/ir/constant.rs:135:21
    |
135 |                     *export_name = self_ty.name().to_owned();
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `self_ty.name().clone_into(export_name)`

Is that expected?

@emilio emilio force-pushed the ignore-associated-items branch from 0fc4584 to e1f187e Compare May 7, 2024 08:21
@emilio
Copy link
Copy Markdown
Collaborator

emilio commented May 7, 2024

No, not your fault. I fixed those issues in master, should be good to go. Thanks for the fix!

@emilio emilio added this pull request to the merge queue May 7, 2024
Merged via the queue into mozilla:master with commit 10f32b0 May 7, 2024
Comment on lines +103 to +105
if content.value().contains("XXX") {
panic!("*** XXX *** {}", content.value());
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops! This was leftover debugging code that probably shouldn't have merged...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fix here: #951

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.

2 participants