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

idl: Fix unexpected_cfgs build warning #2992

Conversation

acheroncrypto
Copy link
Collaborator

Problem

There is a new #[cfg] related lint with Rust 1.80 (nightly-2024-05-05):

warning: unexpected `cfg` condition name: `procmacro2_semver_exempt`
   --> ~/anchor/lang/syn/src/idl/defined.rs:493:19
    |
493 |             #[cfg(procmacro2_semver_exempt)]
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, `windows`
    = help: consider using a Cargo feature instead or adding `println!("cargo::rustc-check-cfg=cfg(procmacro2_semver_exempt)");` to the top of the `build.rs`
    = note: see <https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg> for more information about checking conditional configuration
    = note: `#[warn(unexpected_cfgs)]` on by default

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

Summary of changes

Allow #[cfg(procmacro2_semver_exempt)] in Cargo.toml's [lints.rust.unexpected_cfgs] section. This #[cfg] is necessary for resolving external types with the help of proc-macro2 crate.

Copy link

vercel bot commented May 28, 2024

@acheroncrypto is attempting to deploy a commit to the coral-xyz Team on Vercel.

A member of the Team first needs to authorize it.

@acheroncrypto acheroncrypto added the idl related to the IDL, either program or client side label May 28, 2024
@acheroncrypto acheroncrypto merged commit 700cedd into coral-xyz:master May 28, 2024
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idl related to the IDL, either program or client side
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant