Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMove fn safety out of the subtyping relationship and into coercions #23452
Conversation
rust-highfive
assigned
nrc
Mar 17, 2015
nikomatsakis
force-pushed the
nikomatsakis:unsafety-subtyping
branch
from
90f9a77
to
0947f40
Mar 17, 2015
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
Mar 18, 2015
This comment has been minimized.
This comment has been minimized.
eddyb
reviewed
Mar 18, 2015
| @@ -282,6 +282,7 @@ pub enum Variance { | |||
| #[derive(Clone, Debug)] | |||
| pub enum AutoAdjustment<'tcx> { | |||
| AdjustReifyFnPointer(ast::DefId), // go from a fn-item type to a fn-pointer type | |||
| AdjustUnsafeFnPointer, // go from a safe fn pointer to an unsafe fn pointer | |||
This comment has been minimized.
This comment has been minimized.
eddyb
Mar 18, 2015
Member
Whoa, you can match against this with ty::AdjustUnsafeFnPointer(..), that's an interesting... feature.
This comment has been minimized.
This comment has been minimized.
bors
merged commit 0947f40
into
rust-lang:master
Mar 18, 2015
theemathas
referenced this pull request
Mar 22, 2015
Closed
Unsafe comparison traits (PartialEq, Eq, PartialOrd, Ord) #956
lilyball
added a commit
to lilyball/rust-lua
that referenced
this pull request
Mar 23, 2015
nikomatsakis
deleted the
nikomatsakis:unsafety-subtyping
branch
Mar 30, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
nikomatsakis commentedMar 17, 2015
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
unsafeif the trait is declaredunsafe. In some rare cases, the subtyping change may also direct affect you, but no such cases were encountered in practice.Fixes #23449.
r? @nrc