Skip to content

Commit

Permalink
Add [workspace.lints] to manifests
Browse files Browse the repository at this point in the history
From Rust 1.74 and onwards, this section enables opt-in lints for crates
of this workspace. Read more information at https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html

For a crate to opt-in, it needs to set

 [lints]
 workspace = true

In its Cargo.toml

Closes rust-vmm#518

Signed-off-by: Manos Pitsidianakis <[email protected]>
  • Loading branch information
epilys committed Sep 20, 2024
1 parent c1f9f3c commit 40af3a3
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,39 @@ members = [
"vhost-device-template",
"vhost-device-vsock",
]

[workspace.lints.rust]
unsafe_op_in_unsafe_fn = "deny"

[workspace.lints.rustdoc]
broken_intra_doc_links = "deny"
redundant_explicit_links = "deny"

[workspace.lints.clippy]
enum_glob_use = "deny"
# groups
correctness = { level = "deny", priority = -1 }
suspicious = { level = "deny", priority = -1 }
complexity = { level = "deny", priority = -1 }
perf = { level = "deny", priority = -1 }
style = { level = "deny", priority = -1 }
nursery = { level = "deny", priority = -1 }
# restriction
dbg_macro = "deny"
rc_buffer = "deny"
as_underscore = "deny"
assertions_on_result_states = "deny"
# pedantic
cast_lossless = "deny"
cast_possible_wrap = "deny"
cast_ptr_alignment = "deny"
naive_bytecount = "deny"
ptr_as_ptr = "deny"
bool_to_int_with_if = "deny"
borrow_as_ptr = "deny"
case_sensitive_file_extension_comparisons = "deny"
significant_drop_in_scrutinee = "allow"
significant_drop_tightening = "allow"
missing_safety_doc = "deny"
undocumented_unsafe_blocks = "deny"
option_if_let_else = "allow"
36 changes: 36 additions & 0 deletions staging/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,39 @@ members = [
"vhost-device-can",
"vhost-device-console",
]

[workspace.lints.rust]
unsafe_op_in_unsafe_fn = "deny"

[workspace.lints.rustdoc]
broken_intra_doc_links = "deny"
redundant_explicit_links = "deny"

[workspace.lints.clippy]
enum_glob_use = "deny"
# groups
correctness = { level = "deny", priority = -1 }
suspicious = { level = "deny", priority = -1 }
complexity = { level = "deny", priority = -1 }
perf = { level = "deny", priority = -1 }
style = { level = "deny", priority = -1 }
nursery = { level = "deny", priority = -1 }
# restriction
dbg_macro = "deny"
rc_buffer = "deny"
as_underscore = "deny"
assertions_on_result_states = "deny"
# pedantic
cast_lossless = "deny"
cast_possible_wrap = "deny"
cast_ptr_alignment = "deny"
naive_bytecount = "deny"
ptr_as_ptr = "deny"
bool_to_int_with_if = "deny"
borrow_as_ptr = "deny"
case_sensitive_file_extension_comparisons = "deny"
significant_drop_in_scrutinee = "allow"
significant_drop_tightening = "allow"
missing_safety_doc = "deny"
undocumented_unsafe_blocks = "deny"
option_if_let_else = "allow"
3 changes: 3 additions & 0 deletions vhost-device-sound/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ categories = ["multimedia::audio", "virtualization"]
license = "Apache-2.0 OR BSD-3-Clause"
edition = "2018"

[lints]
workspace = true

[features]
xen = ["vm-memory/xen", "vhost/xen", "vhost-user-backend/xen"]
default = ["alsa-backend", "pw-backend"]
Expand Down

0 comments on commit 40af3a3

Please sign in to comment.