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