-
Notifications
You must be signed in to change notification settings - Fork 13k
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
&[T, ..N] casts to *T instead of *[T, ..N] in structs #14893
Milestone
Comments
There's a comment seeming to imply that Nominating. |
I'm pretty sure this was caused by #14856. |
1.0, P-backcompat-lang |
This is related to how we do coercions. Right now we must do this "eagerly", I'd prefer to leverage a lazy approach like trait matching does. I'm going to try and write this up somewhere, perhaps an RFC. |
pcwalton
added a commit
to pcwalton/rust
that referenced
this issue
Jun 25, 2014
vector-reference-to-unsafe-pointer-to-element cast if the type to be casted to is not fully specified. This is a conservative change to fix the user-visible symptoms of the issue. A more flexible treatment would delay cast checks to after function typechecking. This can break code that did: let x: *u8 = &([0, 0]) as *_; Change this code to: let x: *u8 = &([0, 0]) as *u8; Closes rust-lang#14893. [breaking-change]
bors
added a commit
that referenced
this issue
Jun 25, 2014
…chton vector-reference-to-unsafe-pointer-to-element cast if the type to be casted to is not fully specified. This is a conservative change to fix the user-visible symptoms of the issue. A more flexible treatment would delay cast checks to after function typechecking. This can break code that did: let x: *u8 = &([0, 0]) as *_; Change this code to: let x: *u8 = &([0, 0]) as *u8; Closes #14893. [breaking-change] r? @alexcrichton
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jun 5, 2023
Fix `need-mut` false positive in closure capture of match scrutinee Fix `need-mut` false positive on self.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following code:
The second cast is an error. The other casts work.
Consider the following code:
The first cast is an error. The other casts work.
The text was updated successfully, but these errors were encountered: