Skip to content

Incomplete suggestion for op_ref #3051

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

Closed
illicitonion opened this issue Aug 14, 2018 · 1 comment
Closed

Incomplete suggestion for op_ref #3051

illicitonion opened this issue Aug 14, 2018 · 1 comment

Comments

@illicitonion
Copy link
Contributor

Playground link: https://play.rust-lang.org/?gist=b01329deb426e8ce84a2e54a7d26e158&version=nightly&mode=debug&edition=2015

The suggestion here is incomplete; if you just follow the suggestion verbatim and remove the & on the right hand side, you get a compile error because you're comparing a reference to a value (and rustc in fact tells you to precisely revert your "fix").

Instead, the suggestion should also suggest that you dereference the left hand side:
if *v > 50

@flip1995
Copy link
Member

Dup of #2795

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

No branches or pull requests

2 participants