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

Misleading highlighting of error message in expression with brackets/parentheses #33681

Closed
dhardy opened this issue May 17, 2016 · 0 comments
Closed
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@dhardy
Copy link
Contributor

dhardy commented May 17, 2016

This fails to compile. The error is that a & is required on the last line of main:
let w = &(...) ^ &z;

The error message seems to indicate that the inner operation is wrong, when in fact it is the outer one which needs correcting:

<anon>:15:14: 15:21 error: binary operation `^` cannot be applied to type `A` [E0369]
<anon>:15     let w = (&x ^ &y) ^ &z;
                       ^~~~~~~

should (in my opinion) read:

<anon>:15:14: 15:21 error: binary operation `^` cannot be applied to type `A` [E0369]
<anon>:15     let w = (&x ^ &y) ^ &z;
                      ^~~~~~~~~

Checked on rustc 1.10.0-nightly (6974800c6 2016-05-08) and an older nightly.

@sanxiyn sanxiyn added the A-diagnostics Area: Messages for errors, warnings, and lints label May 17, 2016
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue May 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

2 participants