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
Currently, fn is a subtype of unsafe fn. This should be a coercion relationship, pursuant to our strategy of limiting subtyping to region relationships. This also implies that one cannot implement an unsafe trait method with a safe fn, which is useful for solving the "trusted iterator length" problem.
The text was updated successfully, but these errors were encountered:
Safe fns are no longer subtypes of unsafe fns, but you can coerce from one to the other.
This is a [breaking-change] in that impl fns must now be declared `unsafe` if the trait is declared `unsafe`. In some rare cases, the subtyping change may also direct affect you, but no such cases were encountered in practice.
Fixes#23449.
r? @nrc
Currently,
fn
is a subtype ofunsafe fn
. This should be a coercion relationship, pursuant to our strategy of limiting subtyping to region relationships. This also implies that one cannot implement anunsafe
trait method with a safe fn, which is useful for solving the "trusted iterator length" problem.The text was updated successfully, but these errors were encountered: