From 22eac1abfc216c92bc704a0a7629714104c162e4 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 15 Apr 2019 15:35:28 -0700 Subject: [PATCH] msg_socket: Remove redundant supertrait bound We have: unsafe trait AlignedNew: Sized + DataInit {...} unsafe trait DataInit: Copy + Send + Sync {...} trait Copy: Clone {...} trait Clone: Sized {...} Since Sized is already indirectly a supertrait of DataInit, including it again as a supertrait of AlignedNew has no effect. This CL removes the redundant Sized bound. TEST=cargo check Change-Id: I8ee2a9ee8892c95e6b0dd4bac1b662cd97441984 Reviewed-on: https://chromium-review.googlesource.com/1568077 Commit-Ready: David Tolnay Tested-by: David Tolnay Tested-by: kokoro Reviewed-by: Daniel Verkamp --- msg_socket/src/msg_on_socket.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msg_socket/src/msg_on_socket.rs b/msg_socket/src/msg_on_socket.rs index 98976e837e..635820db76 100644 --- a/msg_socket/src/msg_on_socket.rs +++ b/msg_socket/src/msg_on_socket.rs @@ -209,7 +209,7 @@ rawfd_impl!(UnixDatagram); // This trait is unsafe as it use uninitialized memory. // Please only implement it for primitive types. -unsafe trait AlignedNew: Sized + DataInit { +unsafe trait AlignedNew: DataInit { unsafe fn from_unaligned(buffer: &[u8]) -> Option { let mut value = std::mem::uninitialized::(); let value_mem = value.as_mut_slice();