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

Suggest dereferencing boolean reference when used in 'if' or 'while' #65150

Merged
merged 3 commits into from
Oct 8, 2019

Conversation

XiangQingW
Copy link
Contributor

Implements #64557

Change-Id: I0c5c4d767be2647e6f017ae7bf83558c56dbca97
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cramertj (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 6, 2019
@XiangQingW
Copy link
Contributor Author

r? @Aaron1011

@rust-highfive rust-highfive assigned Aaron1011 and unassigned cramertj Oct 6, 2019
@rust-highfive

This comment has been minimized.

Change-Id: I0c5c4d767be2647e6f017ae7bf83558c56dbca97
@rust-highfive

This comment has been minimized.

Change-Id: I0c5c4d767be2647e6f017ae7bf83558c56dbca97
@csmoe
Copy link
Member

csmoe commented Oct 6, 2019

r? @estebank

@rust-highfive rust-highfive assigned estebank and unassigned Aaron1011 Oct 6, 2019
| ^^^^^
| |
| expected bool, found &bool
| help: consider dereferencing the borrow: `*&true`
Copy link
Contributor

Choose a reason for hiding this comment

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

This tells me that suggest_ref_or_into needs to check for literal borrows before suggesting, but that can be done in a subsequent PR.

@estebank
Copy link
Contributor

estebank commented Oct 6, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Oct 6, 2019

📌 Commit bbb69d1 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 6, 2019
@Aaron1011
Copy link
Member

Aaron1011 commented Oct 6, 2019

@XiangQingW: Note that I'm not a member of the Rust team, so requesting me as a reviewer won't be very useful 😄

Centril added a commit to Centril/rust that referenced this pull request Oct 7, 2019
Suggest dereferencing boolean reference when used in 'if' or 'while'

Implements rust-lang#64557
Centril added a commit to Centril/rust that referenced this pull request Oct 8, 2019
Suggest dereferencing boolean reference when used in 'if' or 'while'

Implements rust-lang#64557
bors added a commit that referenced this pull request Oct 8, 2019
Rollup of 8 pull requests

Successful merges:

 - #64726 (rewrite documentation for unimplemented! to clarify use)
 - #65040 (syntax: more cleanups in item and function signature parsing)
 - #65046 (Make `Cell::new` method come first in documentation)
 - #65098 (Add long error explanation for E0561)
 - #65150 (Suggest dereferencing boolean reference when used in 'if' or 'while')
 - #65154 (Fix const generic arguments not displaying in types mismatch diagnostic)
 - #65181 (fix bug in folding for constants)
 - #65187 (use 'invalid argument' for vxWorks)

Failed merges:

 - #65179 (Add long error explanation for E0567)

r? @ghost
@bors bors merged commit bbb69d1 into rust-lang:master Oct 8, 2019
@bors
Copy link
Contributor

bors commented Oct 8, 2019

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

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants