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 <https://github.com/rust-lang/rust/issues/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 <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2021-01-02 20:47:24 +00:00 committed by Sebastien Boeuf
parent 2aaf0540b6
commit faba6a3fb3

View File

@ -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,