Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify cast rules (tracking issue for RFC 1052) #26391

Closed
nikomatsakis opened this Issue Jun 18, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@nikomatsakis
Copy link
Contributor

nikomatsakis commented Jun 18, 2015

Much of the implementation work for rust-lang/rfcs#1052 has been done, but there remain some corner cases to fix:

  • Casts between raw pointers to different traits are accepted but should not be (e.g. http://is.gd/1jCOSz)
  • Double-check other cases, ensure adequate tests exist
@nikomatsakis

This comment has been minimized.

Copy link
Contributor Author

nikomatsakis commented Jun 18, 2015

triage: P-high -- I'm giving this high priority since accepting casts that we ought not to is a backwards compatibility risk, though it is mitigated by the fact that afaik the illegal casts yield an ICE (but I haven't done exhaustive testing)

@arielb1

This comment has been minimized.

Copy link
Contributor

arielb1 commented Jun 18, 2015

The newly-illegal casts shouldn't be ICE-s (I mean, on nightly). Casts on stable are just randomly ICE-ey.

arielb1 pushed a commit to arielb1/rust that referenced this issue Jun 18, 2015

Ariel Ben-Yehuda
Prohibit casts between fat pointers to different traits
This makes them compliant with the new version of RFC 401 (i.e.
    RFC 1052).

Fixes rust-lang#26391. I *hope* the tests I have are enough.

This is a [breaking-change]

bors added a commit that referenced this issue Jun 22, 2015

Auto merge of #26394 - arielb1:implement-rfc401-part2, r=nrc
This makes them compliant with the new version of RFC 401 (i.e.
    RFC 1052).

Fixes #26391. I *hope* the tests I have are enough.

This is a [breaking-change]

r? @nrc

@bors bors closed this in #26394 Jun 22, 2015

jroesch added a commit to jroesch/rust that referenced this issue Jul 21, 2015

Prohibit casts between fat pointers to different traits
This makes them compliant with the new version of RFC 401 (i.e.
    RFC 1052).

Fixes rust-lang#26391. I *hope* the tests I have are enough.

This is a [breaking-change]

thepowersgang added a commit to thepowersgang/rust that referenced this issue Jul 25, 2015

Prohibit casts between fat pointers to different traits
This makes them compliant with the new version of RFC 401 (i.e.
    RFC 1052).

Fixes rust-lang#26391. I *hope* the tests I have are enough.

This is a [breaking-change]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.