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

#[cfg(coverage)] never worked? #5139

Closed
0x009922 opened this issue Oct 9, 2024 · 1 comment
Closed

#[cfg(coverage)] never worked? #5139

0x009922 opened this issue Oct 9, 2024 · 1 comment
Labels
Bug Something isn't working

Comments

@0x009922
Copy link
Contributor

0x009922 commented Oct 9, 2024

There are #![cfg(not(coverage))] across *_derive::ui tests. It caused compiler warnings (part of #4993).

warning: unexpected `cfg` condition name: `coverage`
 --> crates/iroha_config_base_derive/tests/ui.rs:1:12
  |
1 | #![cfg(not(coverage))]
  |            ^^^^^^^^
  |
  = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `fmt_debug`, `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

See #5135 (comment)

@0x009922 0x009922 added the Bug Something isn't working label Oct 9, 2024
@0x009922
Copy link
Contributor Author

0x009922 commented Oct 9, 2024

Actually I found this line in the logs:

info: cargo-llvm-cov currently setting cfg(coverage) and cfg(coverage_nightly); you can opt-out it by passing --no-cfg-coverage and --no-cfg-coverage-nightly

So this is okay to put cfg(coverage) in the lints and there is no issue with it.

@0x009922 0x009922 closed this as completed Oct 9, 2024
@mversic mversic moved this to Done in Iroha Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant