Skip to content

Commit

Permalink
Remove misleading ?Sized bound
Browse files Browse the repository at this point in the history
clippy output:

warning: `?Sized` bound is ignored because of a `Sized` requirement
  --> src/lib.rs:81:17
   |
81 | impl<T: Clone + ?Sized> Clone for AlignedBox<T> {
   |                 ^^^^^^
   |
note: `T` cannot be unsized because of the bound
  --> src/lib.rs:81:9
   |
81 | impl<T: Clone + ?Sized> Clone for AlignedBox<T> {
   |         ^^^^^
   = note: ...because `Clone` has the bound `Sized`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_maybe_sized
   = note: `#[warn(clippy::needless_maybe_sized)]` on by default
help: change the bounds that require `Sized`, or remove the `?Sized` bound
   |
81 - impl<T: Clone + ?Sized> Clone for AlignedBox<T> {
81 + impl<T: Clone> Clone for AlignedBox<T> {
   |
  • Loading branch information
michaellass committed Jul 28, 2024
1 parent 727c2fb commit 8046922
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl<T: ?Sized> Drop for AlignedBox<T> {
}
}

impl<T: Clone + ?Sized> Clone for AlignedBox<T> {
impl<T: Clone> Clone for AlignedBox<T> {
fn clone(&self) -> Self {
// SAFETY:
// layout is certainly valid as it has already been used to create self
Expand Down

0 comments on commit 8046922

Please sign in to comment.