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

Change some helps to suggestions #31053

Closed
wants to merge 3 commits into from

Conversation

Manishearth
Copy link
Member

r? @eddyb

@eddyb
Copy link
Member

eddyb commented Jan 20, 2016

No tests?

@Manishearth
Copy link
Member Author

Pushed the test fixes. suggestion testing doesn't seem to work, the feature exists but it's not giving an error when I provide the wrong suggestion

@Manishearth
Copy link
Member Author

oh, the issue is that the other suggestion is hard to trigger, not sure the context in which resolve is set to emit_errors=false

"E0519");
if let Ok(snip) = cx.sess().codemap().span_to_snippet(lit_span) {
err.span_suggestion(span, "try using a cast or the `!` operator:",
format!("!{}", snip));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the cast way is the only one you can do generically. as -1isize as usize does not yield the same as !1usize. It would need to be !(x-1), which errors if x == 0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh. Adding a generic cast here is harder so I'll just fix up the help message.

@bors
Copy link
Contributor

bors commented Jan 21, 2016

☔ The latest upstream changes (presumably #31010) made this pull request unmergeable. Please resolve the merge conflicts.

@Manishearth
Copy link
Member Author

Given that the unsigned one doesn't have a generic suggestion and the other one can't be triggered, closing

@Manishearth Manishearth deleted the help_suggestions branch December 2, 2016 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants