Open
Description
NonNull
has two methods that take &self
even though the type is Copy
:
The raw pointer methods take self
so it is surprising NonNull
is different. Taking a reference is unnecessary here and the returned lifetime is unrelated to it.
If we ever get a good way to give methods edition-dependent signatures, this may be something worth considering. Inspired by @cuviper's comment at https://rust-lang.zulipchat.com/#narrow/channel/136281-t-opsem/topic/Completing.20our.20set.20of.20pointer-conversion.20methods/near/423274344