Skip to content

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

@dhardy

Description

@dhardy
Contributor

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.

Activity

added a commit that references this issue on May 20, 2016
5dc8dfa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @sanxiyn@dhardy

        Issue actions

          Misleading highlighting of error message in expression with brackets/parentheses · Issue #33681 · rust-lang/rust