Update clippy settings and fix a few clippy warnings.

This commit is contained in:
Dan Gohman
2019-01-07 11:21:28 -08:00
parent a7aee246e9
commit 9eba81a8d9
40 changed files with 246 additions and 233 deletions

View File

@@ -89,7 +89,7 @@ impl<'a> CodeSink for MemoryCodeSink<'a> {
fn put2(&mut self, x: u16) {
unsafe {
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
write_unaligned(self.data.offset(self.offset) as *mut u16, x);
}
self.offset += 2;
@@ -97,7 +97,7 @@ impl<'a> CodeSink for MemoryCodeSink<'a> {
fn put4(&mut self, x: u32) {
unsafe {
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
write_unaligned(self.data.offset(self.offset) as *mut u32, x);
}
self.offset += 4;
@@ -105,7 +105,7 @@ impl<'a> CodeSink for MemoryCodeSink<'a> {
fn put8(&mut self, x: u64) {
unsafe {
#[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
write_unaligned(self.data.offset(self.offset) as *mut u64, x);
}
self.offset += 8;