[go: up one dir, main page]

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

Add support for --check-cfg [Rust 1.80] #64

Closed
cuviper opened this issue May 6, 2024 · 1 comment
Closed

Add support for --check-cfg [Rust 1.80] #64

cuviper opened this issue May 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@cuviper
Copy link
Owner
cuviper commented May 6, 2024

Ref: https://blog.rust-lang.org/2024/05/06/check-cfg.html

Each cargo::rustc-cfg should have an accompanying unconditional cargo::rustc-check-cfg directive to avoid warnings like this: unexpected cfg condition name: has_foo.

We probably want something like fn emit_check(cfg: &str) to pair with the current emit. Then each AutoCfg::emit_* method should call emit_check unconditionally, while their probe still guards their emit.

Maybe a combined helper is appropriate too, like fn emit_checked(cfg: &str, cond: bool).

@cuviper cuviper added the enhancement New feature or request label May 6, 2024
Techcable added a commit to Techcable/autocfg that referenced this issue Sep 10, 2024
This avoids the `unexpected_cfgs` lint for any of the configs emitted by AutoCfg methods.
This lint is new in Rust 1.80: <https://blog.rust-lang.org/2024/05/06/check-cfg.html>

This adds a `emit_possibility` method to mirror the `emit` method.
Calling `emit` manually does not call `emit_possibility`.

Fixes issue cuviper#64
cuviper pushed a commit to Techcable/autocfg that referenced this issue Sep 27, 2024
This avoids the `unexpected_cfgs` lint for any of the configs emitted by AutoCfg methods.
This lint is new in Rust 1.80: <https://blog.rust-lang.org/2024/05/06/check-cfg.html>

This adds a `emit_possibility` method to mirror the `emit` method.
Calling `emit` manually does not call `emit_possibility`.

Fixes issue cuviper#64
@cuviper
Copy link
Owner Author
cuviper commented Sep 27, 2024

Fixed by #70, and published in autocfg v1.4.0.

@cuviper cuviper closed this as completed Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant