Skip to content
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

Fix Formatter::Prettyplease #2505

Merged
merged 4 commits into from
Apr 17, 2023
Merged

Fix Formatter::Prettyplease #2505

merged 4 commits into from
Apr 17, 2023

Conversation

vorot93
Copy link
Contributor

@vorot93 vorot93 commented Apr 15, 2023

Broken by #2491 because this is not a feature anymore.

@pvdrz pvdrz merged commit 24d4be6 into rust-lang:main Apr 17, 2023
@pvdrz
Copy link
Contributor

pvdrz commented Apr 17, 2023

Thank you for this! I've opened #2506 so this never happens again.

pvdrz added a commit that referenced this pull request Apr 17, 2023
Add a new workflow that checks which features are being used in `#[cfg]` attributes or `cfg!` macros and errors if one of the features does not exists.

This should avoid any future issues like #2505 where a feature was removed and I forgot to remove the `#[cfg]` attributes in the Rust code.
pvdrz pushed a commit that referenced this pull request Jun 2, 2023
This is a partial revert of these two PRs:

- #2491
- #2505

Allow formatting of generated bindings and the inclusion of the
`prettyplease` dependency to be optional when depending on bindgen as a
library.

`prettyplease` remains required and enabled by bindgen-cli.

In a project I maintain, `bindgen` is used in a build script to generate
bindings for a native C library. Those bindings are written to `OUT_DIR`
and are `include!`'d into the crate sources; these bindings don't need
to be formatted.

See for additional context:

- #2491 (comment)
- #2491 (comment)
- #2491 (comment)

I tested all of the following locally:

```shell
cd bindgen
cargo check
cargo check --no-default-features
cargo check --no-default-features --features prettyplease
```

The CI steps added in #2506 should be sufficient
for maintaining the correctness of these conditional compilation features.
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