-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Add more array references to raw pointer casts. #31418
Closed
Closed
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
7bedd3a
Added casting from `&mut [T; n]` to `*mut T`.
Jexell 08001bc
Added casting from `&mut [T; n]` to `*const T`.
Jexell d73b7ef
Improved comments again.
Jexell 899c074
Update cast.rs
Jexell 177802b
Update cast.rs
Jexell d0060f4
Improved indention.
Jexell e8e9c79
Update cast.rs
Jexell 9024d5b
Removed an unnecessary space.
Jexell 43b5f4e
Replaced tabs with spaces.
Jexell 19441c1
Added files via upload
Jexell 6c63426
Update cast.rs
Jexell 510a2a9
Corrected formatting.
Jexell 35244df
Removed trailing whitespace.
Jexell 3ef43ff
Delete cast-mut-ref-to-const-ptr.rs
Jexell 945ef71
Added files via upload
Jexell 456537b
The casts that this file checks are now allowed.
Jexell 2e72108
Shortened test.
Jexell e384e3a
Removed an unnecessary unsafe block.
Jexell ded897c
Shortened cast.rs.
Jexell 5385c68
Update cast-mut-ref-to-const-ptr.rs
Jexell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct - this would only allow casts from
&[T; n]
to*mut T
, whereas you want casts from immutable to const and mut to mut.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should do the opposite of that due to the
!
at the front and only accept casts that are not&[T; n]
to*mut T
. The other 3 casts work with a version of rustc that contains this change.