Incoming breakage: Remove unnecessary ?Sized
bounds
#14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello there 👋
?Sized
bounds in associated type bounds don't have any effect.Deref<Target: ?Sized>
can simply be replaced withDeref
without any change in semantics.If you look at the definition of trait
Deref
, you can seetype Target: ?Sized
which states that<T as Deref>::Target
is not necessarilySized
by default for all typesT
. Therefore a bound likeC: Deref
implies thatTarget
is maybe-Sized. EvenC: Deref<Target: >
(sic!) doesn't meanC: Deref<Target: Sized>
just aswhere <C as Deref>::Target:
(sic!) doesn't meanwhere <C as Deref>::Target: Sized
.It's a bug in the current version of the Rust compiler that writing
Trait<Assoc: ?Sized>
is allowed, it should've been forbidden all along. See also rust-lang/rust#135229.The compiler bug will likely be fixed soon. To avoid your crate from breaking in the future, I've removed the offending bounds.