mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00
rust: use std::ffi instead of std::os::raw
This is allowed since Rust 1.64.0. Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e0b2b74f70
commit
e4fb0be1d1
12 changed files with 20 additions and 18 deletions
|
@ -74,8 +74,6 @@ Supported tools
|
|||
QEMU supports rustc version 1.63.0 and newer. Notably, the following features
|
||||
are missing:
|
||||
|
||||
* ``core::ffi`` (1.64.0). Use ``std::os::raw`` and ``std::ffi`` instead.
|
||||
|
||||
* ``cast_mut()``/``cast_const()`` (1.65.0). Use ``as`` instead.
|
||||
|
||||
* "let ... else" (1.65.0). Use ``if let`` instead. This is currently patched
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
use std::{
|
||||
os::raw::{c_int, c_void},
|
||||
ffi::{c_int, c_void},
|
||||
ptr::NonNull,
|
||||
};
|
||||
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
use std::{
|
||||
ffi::CStr,
|
||||
os::raw::{c_int, c_void},
|
||||
ffi::{c_int, c_void, CStr},
|
||||
pin::Pin,
|
||||
ptr::{addr_of_mut, null_mut, NonNull},
|
||||
slice::from_ref,
|
||||
|
|
|
@ -10,11 +10,10 @@
|
|||
//! called.
|
||||
|
||||
use std::{
|
||||
ffi::CStr,
|
||||
ffi::{c_int, c_void, CStr},
|
||||
fmt::{self, Debug},
|
||||
io::{self, ErrorKind, Write},
|
||||
marker::PhantomPinned,
|
||||
os::raw::{c_int, c_void},
|
||||
ptr::addr_of_mut,
|
||||
slice,
|
||||
};
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
|
||||
//! Bindings for interrupt sources
|
||||
|
||||
use std::{ffi::CStr, marker::PhantomData, os::raw::c_int, ptr};
|
||||
use std::{
|
||||
ffi::{c_int, CStr},
|
||||
marker::PhantomData,
|
||||
ptr,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
bindings::{self, qemu_set_irq},
|
||||
|
|
|
@ -33,7 +33,7 @@ pub mod zeroable;
|
|||
|
||||
use std::{
|
||||
alloc::{GlobalAlloc, Layout},
|
||||
os::raw::c_void,
|
||||
ffi::c_void,
|
||||
};
|
||||
|
||||
#[cfg(HAVE_GLIB_WITH_ALIGNED_ALLOC)]
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
//! Bindings for `MemoryRegion`, `MemoryRegionOps` and `MemTxAttrs`
|
||||
|
||||
use std::{
|
||||
ffi::{CStr, CString},
|
||||
ffi::{c_uint, c_void, CStr, CString},
|
||||
marker::PhantomData,
|
||||
os::raw::{c_uint, c_void},
|
||||
};
|
||||
|
||||
pub use bindings::{hwaddr, MemTxAttrs};
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
//! Bindings to create devices and access device functionality from Rust.
|
||||
|
||||
use std::{
|
||||
ffi::{CStr, CString},
|
||||
os::raw::{c_int, c_void},
|
||||
ffi::{c_int, c_void, CStr, CString},
|
||||
ptr::NonNull,
|
||||
};
|
||||
|
||||
|
|
|
@ -93,11 +93,10 @@
|
|||
//! without incurring into violations of orphan rules for traits.
|
||||
|
||||
use std::{
|
||||
ffi::CStr,
|
||||
ffi::{c_void, CStr},
|
||||
fmt,
|
||||
mem::ManuallyDrop,
|
||||
ops::{Deref, DerefMut},
|
||||
os::raw::c_void,
|
||||
ptr::NonNull,
|
||||
};
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
use std::{
|
||||
os::raw::{c_int, c_void},
|
||||
ffi::{c_int, c_void},
|
||||
pin::Pin,
|
||||
};
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
//! functionality that is missing from `vmstate_of!`.
|
||||
|
||||
use core::{marker::PhantomData, mem, ptr::NonNull};
|
||||
use std::os::raw::{c_int, c_void};
|
||||
use std::ffi::{c_int, c_void};
|
||||
|
||||
pub use crate::bindings::{VMStateDescription, VMStateField};
|
||||
use crate::{
|
||||
|
|
|
@ -2,7 +2,12 @@
|
|||
// Author(s): Zhao Liu <zhai1.liu@intel.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
use std::{ffi::CStr, mem::size_of, os::raw::c_void, ptr::NonNull, slice};
|
||||
use std::{
|
||||
ffi::{c_void, CStr},
|
||||
mem::size_of,
|
||||
ptr::NonNull,
|
||||
slice,
|
||||
};
|
||||
|
||||
use qemu_api::{
|
||||
bindings::{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue