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

MIR-borrowck: dereferences are printed wrapped in parens #45185

Closed
pnkfelix opened this issue Oct 10, 2017 · 2 comments · Fixed by #46040
Closed

MIR-borrowck: dereferences are printed wrapped in parens #45185

pnkfelix opened this issue Oct 10, 2017 · 2 comments · Fixed by #46040
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@pnkfelix
Copy link
Member

MIR-borrowck: In error diagnostics, derefencing expressions are printed with parentheses around them.

For example, for borrowck-borrow-mut-object-twice.rs, AST-borrowck reports:

cannot borrow `*x` as mutable more than once at a time (Ast)

while MIR-borrowck reports:

cannot borrow `(*x)` as mutable more than once at a time (Mir)

(This is hopefully relatively simple to resolve; is there any case where we need the parentheses, given that we already elide dereferences when printing field accessor expressions?)

@pnkfelix pnkfelix added WG-compiler-nll T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-diagnostics Area: Messages for errors, warnings, and lints labels Oct 10, 2017
@arielb1 arielb1 added this to the NLL prototype milestone Nov 15, 2017
@nikomatsakis
Copy link
Contributor

@zilbuz are you looking at this?

@zilbuz
Copy link
Contributor

zilbuz commented Nov 16, 2017

@nikomatsakis Yes I am :)

bors added a commit that referenced this issue Nov 22, 2017
MIR-borrowck: Some minor fixes

- Remove parens when printing dereference (fix #45185)
- Change argument type of `autoderef` to `bool`
- Change argument type of `field_index` to `Field`
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 T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants