mirror of
https://github.com/qemu/qemu.git
synced 2026-07-08 17:56:38 +00:00
@@ -4,18 +4,7 @@ _common_cfg = run_command(rustc_args,
|
||||
|
||||
_common_rs = static_library(
|
||||
'common',
|
||||
structured_sources(
|
||||
[
|
||||
'src/lib.rs',
|
||||
'src/assertions.rs',
|
||||
'src/bitops.rs',
|
||||
'src/callbacks.rs',
|
||||
'src/errno.rs',
|
||||
'src/opaque.rs',
|
||||
'src/uninit.rs',
|
||||
'src/zeroable.rs',
|
||||
],
|
||||
),
|
||||
'src/lib.rs',
|
||||
rust_args: _common_cfg,
|
||||
dependencies: [libc_rs, qemu_macros],
|
||||
)
|
||||
|
||||
@@ -15,6 +15,11 @@ pub use errno::Errno;
|
||||
pub mod opaque;
|
||||
pub use opaque::{Opaque, Wrapper};
|
||||
|
||||
// preserve one-item-per-"use" syntax, it is clearer
|
||||
// for prelude-like modules
|
||||
#[rustfmt::skip]
|
||||
pub mod prelude;
|
||||
|
||||
pub mod uninit;
|
||||
pub use uninit::MaybeUninitField;
|
||||
|
||||
|
||||
9
rust/common/src/prelude.rs
Normal file
9
rust/common/src/prelude.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
//! Essential types and traits intended for blanket imports.
|
||||
|
||||
pub use crate::bitops::IntegerExt;
|
||||
pub use crate::uninit::MaybeUninitField;
|
||||
|
||||
// Re-export commonly used macros
|
||||
pub use crate::static_assert;
|
||||
pub use crate::uninit_field_mut;
|
||||
pub use qemu_macros::TryInto;
|
||||
@@ -6,7 +6,7 @@ use std::{ffi::CStr, mem::size_of};
|
||||
|
||||
use bql::BqlRefCell;
|
||||
use chardev::{CharFrontend, Chardev, Event};
|
||||
use common::{static_assert, uninit_field_mut};
|
||||
use common::prelude::*;
|
||||
use hwcore::{
|
||||
Clock, ClockEvent, DeviceImpl, DeviceMethods, DeviceState, IRQState, InterruptSource,
|
||||
ResetType, ResettablePhasesImpl, SysBusDevice, SysBusDeviceImpl, SysBusDeviceMethods,
|
||||
|
||||
@@ -11,7 +11,7 @@ use std::{
|
||||
};
|
||||
|
||||
use bql::{BqlCell, BqlRefCell};
|
||||
use common::{bitops::IntegerExt, uninit_field_mut};
|
||||
use common::prelude::*;
|
||||
use hwcore::{
|
||||
DeviceImpl, DeviceMethods, DeviceState, InterruptSource, ResetType, ResettablePhasesImpl,
|
||||
SysBusDevice, SysBusDeviceImpl, SysBusDeviceMethods,
|
||||
|
||||
Reference in New Issue
Block a user