Skip to content

Commit 0f90620

Browse files
authored
Rollup merge of #150642 - hkBst:needless-maybe-sized-1, r=jhpratt
mutex.rs: remove needless-maybe-unsized bounds Fixes for: ```text warning: `?Sized` bound is ignored because of a `Sized` requirement --> library/std/src/sync/nonpoison/mutex.rs:425:9 | 425 | impl<T: ?Sized + Default> Default for Mutex<T> { | ^^^^^^ | note: `T` cannot be unsized because of the bound --> library/std/src/sync/nonpoison/mutex.rs:425:18 | 425 | impl<T: ?Sized + Default> Default for Mutex<T> { | ^^^^^^^ = note: ...because `Default` has the bound `Sized` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_maybe_sized = note: `-W clippy::needless-maybe-sized` implied by `-W clippy::suspicious` = help: to override `-W clippy::suspicious` add `#[allow(clippy::needless_maybe_sized)]` help: change the bounds that require `Sized`, or remove the `?Sized` bound | 425 - impl<T: ?Sized + Default> Default for Mutex<T> { 425 + impl<T: Default> Default for Mutex<T> { | warning: `?Sized` bound is ignored because of a `Sized` requirement --> library/std/src/sync/poison/mutex.rs:691:9 | 691 | impl<T: ?Sized + Default> Default for Mutex<T> { | ^^^^^^ | note: `T` cannot be unsized because of the bound --> library/std/src/sync/poison/mutex.rs:691:18 | 691 | impl<T: ?Sized + Default> Default for Mutex<T> { | ^^^^^^^ = note: ...because `Default` has the bound `Sized` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_maybe_sized help: change the bounds that require `Sized`, or remove the `?Sized` bound | 691 - impl<T: ?Sized + Default> Default for Mutex<T> { 691 + impl<T: Default> Default for Mutex<T> { ```
2 parents 336c665 + b2e6e03 commit 0f90620

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

library/std/src/sync/nonpoison/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ impl<T> From<T> for Mutex<T> {
422422
}
423423

424424
#[unstable(feature = "nonpoison_mutex", issue = "134645")]
425-
impl<T: ?Sized + Default> Default for Mutex<T> {
425+
impl<T: Default> Default for Mutex<T> {
426426
/// Creates a `Mutex<T>`, with the `Default` value for T.
427427
fn default() -> Mutex<T> {
428428
Mutex::new(Default::default())

library/std/src/sync/poison/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ impl<T> From<T> for Mutex<T> {
688688
}
689689

690690
#[stable(feature = "mutex_default", since = "1.10.0")]
691-
impl<T: ?Sized + Default> Default for Mutex<T> {
691+
impl<T: Default> Default for Mutex<T> {
692692
/// Creates a `Mutex<T>`, with the `Default` value for T.
693693
fn default() -> Mutex<T> {
694694
Mutex::new(Default::default())

0 commit comments

Comments
 (0)