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
Auto merge of #143629 - oli-obk:limited-nonzero-coercion, r=<try>
Limited nonzero coercion
coercing `NonZero<T>` to `T` if all the types are available at the cast site.
This is fairly limited, as (as the tests show), this does not allow "reborrowing" `&NonZero<T>` as `&T`. It also fails quickly if the types aren't fully clear at the coercion site, but only resolved later.
Also cannot aid in trait selection or similar, even if there is clearly only one option.
Related:
* #143594
* rust-lang/rfcs#3786
cc `@traviscross`
0 commit comments