Improve suggestion when casting usize to (possibly) wide pointer#92150
Merged
bors merged 1 commit intorust-lang:masterfrom Mar 10, 2022
Merged
Conversation
Contributor
|
(rust-highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
|
@matthewjasper, do you plan on reviewing this any time soon? If not, do you mind reassigning? |
Contributor
Author
|
it's been some time since this got a review |
91a896c to
d9e64ba
Compare
Contributor
Author
|
Addressed comments! @rustbot ready |
d9e64ba to
05f9f78
Compare
05f9f78 to
814c18a
Compare
Contributor
Author
|
Actually there's no reason why we need to limit this diagnostic to isize/usize. We allow all int types => thin pointer. Also simplifies the PR. @rustbot ready |
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit 814c18a has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 10, 2022
…askrgr Rollup of 5 pull requests Successful merges: - rust-lang#92150 (Improve suggestion when casting usize to (possibly) wide pointer) - rust-lang#94635 (Merge `#[deprecated]` and `#[rustc_deprecated]`) - rust-lang#94657 (Constify `Index{,Mut}` for `[T]`, `str`, and `[T; N]`) - rust-lang#94746 (diagnostics: use rustc_on_unimplemented to recommend `[].iter()`) - rust-lang#94788 (Account for suggestions for complete removal of lines) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or 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
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.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.
I thought #92125 was a wonderful idea, so I went ahead and took a stab at it. Not sure if my approach is the best going forward, but I'm happy with the improvement in the error message.
Iwill definitely address any changes if people are more opinionated with the wordings or want more features.
Also, do I need to add a new error code?
(Fixes #92125)