mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
rust: cargo: store desired warning levels in workspace Cargo.toml
An extra benefit of workspaces is that they allow to place lint level settings in a single Cargo.toml; the settings are then inherited by packages in the workspace. Correspondingly, teach rustc_args.py to get the unexpected_cfgs configuration from the workspace Cargo.toml. Note that it is still possible to allow or deny warnings per crate or module, via the #![] attribute syntax. The rust/qemu-api/src/bindings.rs file is an example. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
97ed1e9c8e
commit
90868c3dce
7 changed files with 53 additions and 13 deletions
|
@ -23,6 +23,5 @@ version_check = "~0.9"
|
|||
default = []
|
||||
allocator = []
|
||||
|
||||
[lints.rust]
|
||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(MESON)', 'cfg(HAVE_GLIB_WITH_ALIGNED_ALLOC)',
|
||||
'cfg(has_offset_of)'] }
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
_qemu_api_cfg = run_command(rustc_args,
|
||||
'--config-headers', config_host_h, '--features', '--lints', files('Cargo.toml'),
|
||||
'--config-headers', config_host_h, '--features', files('Cargo.toml'),
|
||||
capture: true, check: true).stdout().strip().splitlines()
|
||||
|
||||
# _qemu_api_cfg += ['--cfg', 'feature="allocator"']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue