Skip to content

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

Closed
@dhardy

Description

@dhardy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions