From faba6a3fb3a6523e08143b29e39f8376117f5813 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Sat, 2 Jan 2021 20:47:24 +0000 Subject: [PATCH] vmm: memory_manager: Use workaround for conditional function arguments With Rust 1.49 using attributes on a function parameter is not allowed. The recommended workaround is to put it in a new block. error[E0658]: attributes on expressions are experimental --> vmm/src/memory_manager.rs:698:17 | 698 | #[cfg(target_arch = "x86_64")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #15701 for more information error: removing an expression is not supported in this position --> vmm/src/memory_manager.rs:698:17 | 698 | #[cfg(target_arch = "x86_64")] | Signed-off-by: Rob Bradford --- vmm/src/memory_manager.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vmm/src/memory_manager.rs b/vmm/src/memory_manager.rs index f7a640104..5f4b6462d 100644 --- a/vmm/src/memory_manager.rs +++ b/vmm/src/memory_manager.rs @@ -694,9 +694,13 @@ impl MemoryManager { let allocator = Arc::new(Mutex::new( SystemAllocator::new( #[cfg(target_arch = "x86_64")] - GuestAddress(0), + { + GuestAddress(0) + }, #[cfg(target_arch = "x86_64")] - (1 << 16 as GuestUsize), + { + 1 << 16 as GuestUsize + }, GuestAddress(0), mmio_address_space_size, layout::MEM_32BIT_DEVICES_START,