Skip to content

fix unexpected tag#2499

Closed
yihau wants to merge 3 commits intoanza-xyz:masterfrom
yihau:fix-unexpected-tag
Closed

fix unexpected tag#2499
yihau wants to merge 3 commits intoanza-xyz:masterfrom
yihau:fix-unexpected-tag

Conversation

@yihau
Copy link
Copy Markdown
Member

@yihau yihau commented Aug 8, 2024

(part of #2487)

Problem

warning: unexpected `cfg` condition name: `RUSTC_WITH_SPECIALIZATION`
 --> short-vec/src/lib.rs:2:13
  |
2 | #![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))]
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = 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`, and `windows`
  = help: consider using a Cargo feature instead
  = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
           [lints.rust]
           unexpected_cfgs = { level = "warn", check-cfg = ['cfg(RUSTC_WITH_SPECIALIZATION)'] }
  = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(RUSTC_WITH_SPECIALIZATION)");` to the top of the `build.rs`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
  = note: `#[warn(unexpected_cfgs)]` on by default

#2386 (comment)

Summary of Changes

  • extract these values as global lints to Cargo.toml and apply them where needed
[workspace.lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
    'cfg(target_os, values("solana"))',
    'cfg(feature, values("frozen-abi"))',
    'cfg(RUSTC_WITH_SPECIALIZATION)',
    'cfg(RUSTC_WITHOUT_SPECIALIZATION)',
]
  • extract these values as global lints to programs/sbf/Cargo.toml and apply them where needed
[workspace.lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = ['cfg(target_os, values("solana"))']

there are two exceptions that have special config in them:

  • perf/Cargo.toml
[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = [
    'cfg(build_target_feature_avx)',
    'cfg(build_target_feature_avx2)',
    'cfg(RUSTC_WITH_SPECIALIZATION)',
    'cfg(RUSTC_WITHOUT_SPECIALIZATION)',
]
  • define-syscall/Cargo.toml
[workspace.lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = ['cfg(target_feature, values("static-syscalls"))']

@yihau yihau force-pushed the fix-unexpected-tag branch from 684e38a to 5e6cfba Compare August 9, 2024 11:35
@yihau
Copy link
Copy Markdown
Member Author

yihau commented Aug 11, 2024

need to happen in the bump PR itself

@yihau yihau closed this Aug 11, 2024
@yihau yihau deleted the fix-unexpected-tag branch August 11, 2024 10:47
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.

1 participant