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