Skip to content

Commit 9e32843

Browse files
author
sls_0x
committed
Declare Anchor cfg values explicitly
1 parent 9c48556 commit 9e32843

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ cpi = ["no-entrypoint"]
1616
default = []
1717
idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build"]
1818

19+
[lints.rust]
20+
unexpected_cfgs = { level = "warn", check-cfg = [
21+
'cfg(target_os, values("solana"))',
22+
'cfg(feature, values("anchor-debug", "custom-heap", "custom-panic", "no-idl", "no-log-ix-name"))',
23+
] }
24+
1925
[dependencies]
2026
anchor-lang = "0.30.1"
2127
anchor-spl = "0.30.1"

src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
#![allow(unexpected_cfgs)]
2-
// Anchor and Solana macros emit cfg values such as `custom-heap`, `custom-panic`,
3-
// `solana`, and `anchor-debug` during host builds. They are valid for the macro
4-
// expansion path but trigger noisy `unexpected_cfgs` warnings in normal local tests.
5-
61
use anchor_lang::prelude::*;
72
use anchor_spl::token::{self, Burn, Mint, Token, TokenAccount, Transfer};
83
use base64::{Engine as _, engine::general_purpose};

0 commit comments

Comments
 (0)