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