diff options
author | Dylan Reid <dgreid@chromium.org> | 2019-03-05 19:55:16 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-09 22:14:45 -0800 |
commit | e54188bf3171b0daf049ba77e12bf6f6eeef689d (patch) | |
tree | 46a3d9fad9d5121604edd33d55ecd6e04f102785 /data_model | |
parent | 99d3f08dc5d4ad63d8596c349f9d207144e2c949 (diff) | |
download | crosvm-e54188bf3171b0daf049ba77e12bf6f6eeef689d.tar crosvm-e54188bf3171b0daf049ba77e12bf6f6eeef689d.tar.gz crosvm-e54188bf3171b0daf049ba77e12bf6f6eeef689d.tar.bz2 crosvm-e54188bf3171b0daf049ba77e12bf6f6eeef689d.tar.lz crosvm-e54188bf3171b0daf049ba77e12bf6f6eeef689d.tar.xz crosvm-e54188bf3171b0daf049ba77e12bf6f6eeef689d.tar.zst crosvm-e54188bf3171b0daf049ba77e12bf6f6eeef689d.zip |
data_model: ignore clippy error for mut from non-mut
A bug has been filed to fix this differently. Until then, add a TODO and a clippy disable so that clippy can be used to test for other issues without stopping on this error. BUG=928767 TEST=cargo clippy Signed-off-by: Dylan Reid <dgreid@chromium.org> Change-Id: Ic264bc9101653c30354415c913e9ee3752985706 Reviewed-on: https://chromium-review.googlesource.com/1506308 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'data_model')
-rw-r--r-- | data_model/src/volatile_memory.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/data_model/src/volatile_memory.rs b/data_model/src/volatile_memory.rs index 5a2c80a..f7a83cd 100644 --- a/data_model/src/volatile_memory.rs +++ b/data_model/src/volatile_memory.rs @@ -382,6 +382,9 @@ impl<'a> VolatileSlice<'a> { unsafe fn as_slice(&self) -> &[u8] { from_raw_parts(self.addr, self.size as usize) } + + // TODO(zachr) - refactor this so the mut from non-mut isn't necessary (bug: 938767) + #[allow(clippy::mut_from_ref)] unsafe fn as_mut_slice(&self) -> &mut [u8] { from_raw_parts_mut(self.addr, self.size as usize) } |