xref: /qemu/rust/Cargo.toml (revision 68df8c8dba57f539d24f1a92a8699a179d9bb6fb)
1[workspace]
2resolver = "2"
3members = [
4    "qemu-api-macros",
5    "qemu-api",
6    "hw/char/pl011",
7]
8
9[workspace.lints.rust]
10unexpected_cfgs = { level = "deny", check-cfg = [
11    'cfg(MESON)', 'cfg(HAVE_GLIB_WITH_ALIGNED_ALLOC)',
12    'cfg(has_offset_of)'] }
13
14# Occasionally, we may need to silence warnings and clippy lints that
15# were only introduced in newer Rust compiler versions.  Do not croak
16# in that case; a CI job with rust_strict_lints == true disables this
17# and ensures that we do not have misspelled allow() attributes.
18unknown_lints = "allow"
19
20# Prohibit code that is forbidden in Rust 2024
21unsafe_op_in_unsafe_fn = "deny"
22
23[workspace.lints.rustdoc]
24private_intra_doc_links = "allow"
25
26broken_intra_doc_links = "deny"
27invalid_html_tags = "deny"
28invalid_rust_codeblocks = "deny"
29bare_urls = "deny"
30unescaped_backticks = "deny"
31redundant_explicit_links = "deny"
32
33[workspace.lints.clippy]
34# default-warn lints
35result_unit_err = "allow"
36should_implement_trait = "deny"
37# can be for a reason, e.g. in callbacks
38unused_self = "allow"
39
40# default-allow lints
41as_underscore = "deny"
42assertions_on_result_states = "deny"
43bool_to_int_with_if = "deny"
44borrow_as_ptr = "deny"
45cast_lossless = "deny"
46dbg_macro = "deny"
47debug_assert_with_mut_call = "deny"
48derive_partial_eq_without_eq = "deny"
49doc_markdown = "deny"
50empty_structs_with_brackets = "deny"
51ignored_unit_patterns = "deny"
52implicit_clone = "deny"
53macro_use_imports = "deny"
54missing_const_for_fn = "deny"
55missing_safety_doc = "deny"
56multiple_crate_versions = "deny"
57mut_mut = "deny"
58needless_bitwise_bool = "deny"
59needless_pass_by_ref_mut = "deny"
60no_effect_underscore_binding = "deny"
61option_option = "deny"
62or_fun_call = "deny"
63ptr_as_ptr = "deny"
64pub_underscore_fields = "deny"
65redundant_clone = "deny"
66redundant_closure_for_method_calls = "deny"
67redundant_else = "deny"
68redundant_pub_crate = "deny"
69ref_binding_to_reference = "deny"
70ref_option_ref = "deny"
71return_self_not_must_use = "deny"
72same_name_method = "deny"
73semicolon_inside_block = "deny"
74shadow_unrelated = "deny"
75significant_drop_in_scrutinee = "deny"
76significant_drop_tightening = "deny"
77suspicious_operation_groupings = "deny"
78transmute_ptr_to_ptr = "deny"
79transmute_undefined_repr = "deny"
80type_repetition_in_bounds = "deny"
81used_underscore_binding = "deny"
82
83# nice to have, but cannot be enabled yet
84#wildcard_imports = "deny"   # still have many bindings::* imports
85#ptr_cast_constness = "deny" # needs 1.65.0 for cast_mut()/cast_const()
86
87# these may have false positives
88#option_if_let_else = "deny"
89cognitive_complexity = "deny"
90