Skip to content

Commit

Permalink
vfio_user: Workaround 'destructuring_assignment' for rust 1.56
Browse files Browse the repository at this point in the history
The 'destructuring_assignment' to tuples [1] was not stable with rust
toolchina 1.56.

[1] rust-lang/rust#71126

Signed-off-by: Bo Chen <chen.bo@intel.com>
  • Loading branch information
likebreath committed Apr 28, 2022
1 parent 51875de commit 726ec8e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vfio_user/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,14 @@ impl Client {
for index in 0..num_regions {
let (mut region_info, mut fd, mut sparse_areas) = self.get_region_info(index, None)?;
if region_info.argsz > std::mem::size_of::<vfio_region_info>() as u32 {
(region_info, fd, sparse_areas) = self.get_region_info(
// Note: workaround for https://github.com/rust-lang/rust/issues/71126 to compile with rust toolchian 1.56
let (_region_info, _fd, _sparse_areas) = self.get_region_info(
index,
Some(region_info.argsz - std::mem::size_of::<vfio_region_info>() as u32),
)?;
region_info = _region_info;
fd = _fd;
sparse_areas = _sparse_areas;
}
regions.push(Region {
flags: region_info.flags,
Expand Down

0 comments on commit 726ec8e

Please sign in to comment.