From 6895e634cc07c060db7c6ca141ffcbc2c86b7a46 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 11 May 2021 14:19:04 +0000 Subject: [PATCH] arch: Move crate to rust 2018 edition Signed-off-by: Rob Bradford --- arch/Cargo.toml | 1 + arch/src/aarch64/mod.rs | 2 +- arch/src/x86_64/mptable.rs | 4 ++-- arch/src/x86_64/regs.rs | 7 +++---- arch/src/x86_64/smbios.rs | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/Cargo.toml b/arch/Cargo.toml index ff60a5a4c..7e3e0b5ac 100644 --- a/arch/Cargo.toml +++ b/arch/Cargo.toml @@ -2,6 +2,7 @@ name = "arch" version = "0.1.0" authors = ["The Chromium OS Authors"] +edition = "2018" [features] default = [] diff --git a/arch/src/aarch64/mod.rs b/arch/src/aarch64/mod.rs index b7a0a2774..36719dde2 100644 --- a/arch/src/aarch64/mod.rs +++ b/arch/src/aarch64/mod.rs @@ -14,7 +14,7 @@ pub mod regs; pub use self::fdt::DeviceInfoForFdt; use crate::DeviceType; use crate::RegionType; -use aarch64::gic::GicDevice; +use gic::GicDevice; use std::collections::HashMap; use std::ffi::CStr; use std::fmt::Debug; diff --git a/arch/src/x86_64/mptable.rs b/arch/src/x86_64/mptable.rs index 244c4d53b..bfa654f65 100644 --- a/arch/src/x86_64/mptable.rs +++ b/arch/src/x86_64/mptable.rs @@ -5,8 +5,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-BSD-3-Clause file. +use crate::layout::{APIC_START, HIGH_RAM_START, IOAPIC_START}; use crate::x86_64::mpspec; -use layout::{APIC_START, HIGH_RAM_START, IOAPIC_START}; use libc::c_char; use std::io; use std::mem; @@ -285,7 +285,7 @@ pub fn setup_mptable(offset: GuestAddress, mem: &GuestMemoryMmap, num_cpus: u8) #[cfg(test)] mod tests { use super::*; - use layout::MPTABLE_START; + use crate::layout::MPTABLE_START; use vm_memory::{GuestAddress, GuestUsize}; fn table_entry_size(type_: u8) -> usize { diff --git a/arch/src/x86_64/regs.rs b/arch/src/x86_64/regs.rs index 47f3ff3fd..a9822cd43 100644 --- a/arch/src/x86_64/regs.rs +++ b/arch/src/x86_64/regs.rs @@ -6,13 +6,12 @@ // Portions Copyright 2017 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE-BSD-3-Clause file. -use std::sync::Arc; -use std::{mem, result}; - +use crate::layout::{BOOT_GDT_START, BOOT_IDT_START, PVH_INFO_START}; use hypervisor::arch::x86::gdt::{gdt_entry, segment_from_gdt}; use hypervisor::arch::x86::regs::*; use hypervisor::x86_64::{FpuState, SpecialRegisters, StandardRegisters}; -use layout::{BOOT_GDT_START, BOOT_IDT_START, PVH_INFO_START}; +use std::sync::Arc; +use std::{mem, result}; use vm_memory::{Address, Bytes, GuestMemory, GuestMemoryError, GuestMemoryMmap}; #[derive(Debug)] diff --git a/arch/src/x86_64/smbios.rs b/arch/src/x86_64/smbios.rs index f072d9725..b77d8c3ef 100644 --- a/arch/src/x86_64/smbios.rs +++ b/arch/src/x86_64/smbios.rs @@ -6,7 +6,7 @@ // // SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause -use layout::SMBIOS_START; +use crate::layout::SMBIOS_START; use std::fmt::{self, Display}; use std::mem; use std::result;