You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which ends up being misleading, since the only bound shown on the page is T: ?Sized.
I hit a surprising
14 | if ptr.is_null() {
| ^^^^^^^ `T` does not have a constant size known at compile-time
|
= help: the trait `core::marker::Sized` is not implemented for `T`
= help: consider adding a `where T: core::marker::Sized` bound
because of that discrepancy (but didn't pick is_null above because it changed in beta/nightly, it doesn't have the T: Sized bound anymore ; offset still does)
The text was updated successfully, but these errors were encountered:
There are not a lot of those around, according to a quick grep. The vast majority are in core::ptr. Anyways, in e.g.
core::ptr
, there is:Note that the impl has a
T: ?Sized
bound, but the offset method has an additionalT: Sized
bound.But the corresponding doc says nothing about that bound:
https://doc.rust-lang.org/std/primitive.pointer.html#method.offset-1
which ends up being misleading, since the only bound shown on the page is
T: ?Sized
.I hit a surprising
because of that discrepancy (but didn't pick
is_null
above because it changed in beta/nightly, it doesn't have theT: Sized
bound anymore ; offset still does)The text was updated successfully, but these errors were encountered: