Uh oh!
There was an error while loading. Please reload this page.
When cast needs a dereference point at full cast - #38245
Merged
Merged
Conversation
rust-highfive
commented
Dec 8, 2016
Contributor
(rust_highfive has picked a reviewer for you, use r? to override) |
estebankforce-pushed
the
cast-deref-hint-2
branch
from
December 8, 2016 19:25
af9ceb6 to
cb3ec68Comparenikomatsakis
commented
Dec 9, 2016
Contributor
Hmm I'm not sure I see this as an improvement...I think I prefer the new span, but I'd prefer the "did you mean |
estebankforce-pushed
the
cast-deref-hint-2
branch
2 times, most recently
from
December 14, 2016 21:44
81bd4cb to
096205bCompareAfter the fix of rust-lang#37453 in PR rust-lang#37369, instead of pointing at only the cast type, point at the full cast span when a cast needs a dereference: ``` error: casting `&{float}` as `f32` is invalid --> ../../../src/test/ui/mismatched_types/cast-rfc0401.rs:81:30 | 81 | vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>(); | ^^^^^^^^ cannot cast `&{float}` as `f32` | help: did you mean `*s`? --> ../../../src/test/ui/mismatched_types/cast-rfc0401.rs:81:30 | 81 | vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>(); | ^ ``` instead of ``` error: casting `&{float}` as `f32` is invalid --> ../../../src/test/ui/mismatched_types/cast-rfc0401.rs:81:35 | 81 | vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>(); | - ^^^ | | | | | did you mean `*s`? | cannot cast `&{float}` as `f32` ```
estebankforce-pushed
the
cast-deref-hint-2
branch
from
December 15, 2016 01:33
096205b to
868fb03CompareContributorAuthor
@nikomatsakis I have separated the suggestion to a help as requested: |
nikomatsakis
commented
Dec 19, 2016
Contributor
@estebank looks good! |
nikomatsakis
commented
Dec 19, 2016
Contributor
@bors r+ |
bors
commented
Dec 19, 2016
Collaborator
📌 Commit 868fb03 has been approved by |
bors
commented
Dec 20, 2016
Collaborator
bors added a commit
that referenced
this pull request
Dec 20, 2016
When cast needs a dereference point at full cast After the fix of #37453 in PR #37369, instead of pointing at only the cast type, point at the full cast span when a cast needs a dereference, as well as assign the error label to the correct span for proper coloring: <img width="471" alt="error span pointing at the entire cast" src="https://cloud.githubusercontent.com/assets/1606434/21024245/8797fc2e-bd38-11e6-82c1-66c281c656c1.png"> instead of <img width="471" alt="error span pointing at the type of the cast" src="https://cloud.githubusercontent.com/assets/1606434/21023777/d4814aa6-bd36-11e6-9fc3-b2a0ea5ee15d.png"> Move `compile-fail` test to `ui` test.
eddyb
commented
Dec 20, 2016
Contributor
@rust-lang/tools tests failed but homu didn't pick it up. @bors r- force |
eddyb
commented
Dec 20, 2016
Contributor
Hmmmmmm let's try this instead (sorry, @estebank, trying to get the bot unstuck). |
eddyb
commented
Dec 20, 2016
Contributor
Well that didn't help anything 😞. |
brson
commented
Dec 20, 2016
Contributor
@bors retry |
alexcrichton
commented
Dec 20, 2016
Member
@bors: r=nikomatsakis |
bors
commented
Dec 20, 2016
Collaborator
📌 Commit 868fb03 has been approved by |
alexcrichton added a commit
to alexcrichton/rust
that referenced
this pull request
Dec 20, 2016
…atsakis When cast needs a dereference point at full cast After the fix of rust-lang#37453 in PR rust-lang#37369, instead of pointing at only the cast type, point at the full cast span when a cast needs a dereference, as well as assign the error label to the correct span for proper coloring: <img width="471" alt="error span pointing at the entire cast" src="https://cloud.githubusercontent.com/assets/1606434/21024245/8797fc2e-bd38-11e6-82c1-66c281c656c1.png"> instead of <img width="471" alt="error span pointing at the type of the cast" src="https://cloud.githubusercontent.com/assets/1606434/21023777/d4814aa6-bd36-11e6-9fc3-b2a0ea5ee15d.png"> Move `compile-fail` test to `ui` test.
bors added a commit
that referenced
this pull request
Dec 20, 2016
Rollup of 29 pull requests - Successful merges: #37761, #38006, #38131, #38150, #38158, #38171, #38208, #38215, #38236, #38245, #38289, #38302, #38315, #38346, #38388, #38395, #38398, #38418, #38432, #38451, #38463, #38468, #38470, #38471, #38472, #38478, #38486, #38493, #38498 - Failed merges: #38271, #38483
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 freeto 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.
After the fix of #37453 in PR #37369, instead of pointing at only the cast type, point at the full cast span when a cast needs a dereference, as well as assign the error label to the correct span for proper coloring:
instead of
Move
compile-failtest touitest.