Skip to content

Commit

Permalink
doc: CodeReview.md: Clarify cfg usage
Browse files Browse the repository at this point in the history
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
  • Loading branch information
alistair23 committed Jun 3, 2024
1 parent 79cc869 commit 397c443
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions chips/lowrisc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ edition.workspace = true
[dependencies]
rv32i = { path = "../../arch/rv32i" }
kernel = { path = "../../kernel" }

[lints.rust]
# These are unused and unsupported
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(aon_wkup_timer)'] }
6 changes: 6 additions & 0 deletions doc/CodeReview.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ Generally, this means `cfg` directives should be an explicit list of chips or'd
together. Rarely, if ever, is a `cfg(not ...)` the correct approach for anything
outside of unit tests.

Rust `cfg` features can also be used to disable code that isn't used in upstream
Tock but might be used in private or public forks. Rust custom configs can also
be used, but generally require changes to the lint configuration. See
https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html#check-cfg-in-lintsrust-table
for more details.

#### Boards

Changes to boards are generally left to the maintainer or original contributor
Expand Down

0 comments on commit 397c443

Please sign in to comment.