Skip to content

MIR-borrowck: print named fields with .name rather than .<num> #44974

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
pnkfelix opened this issue Oct 2, 2017 · 1 comment
Closed

MIR-borrowck: print named fields with .name rather than .<num> #44974

pnkfelix opened this issue Oct 2, 2017 · 1 comment
Labels
A-borrow-checker Area: The borrow checker A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@pnkfelix
Copy link
Member

pnkfelix commented Oct 2, 2017

The MIR-borrowck printing of Lvalues visible to end-users prints accesses to a named struct/enum field with a description like obj.3 instead of obj.field.

This needs to be fixed before MIR-borrowck is usable in real-world.

(And fixing it sooner would probably make developing MIR-borrowck a bit more enjoyable.)

@pnkfelix pnkfelix added A-borrow-checker Area: The borrow checker A-diagnostics Area: Messages for errors, warnings, and lints E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. WG-compiler-nll T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Oct 2, 2017
@pnkfelix
Copy link
Member Author

pnkfelix commented Oct 2, 2017

@zilbuz tells me that they are working on this.

bors added a commit that referenced this issue Oct 12, 2017
MIR borrowck: print lvalues in error messages in the same way that the AST borrowck

Fix #44974

- Print fields with `.name` rather than `.<num>`
- Autoderef values if followed by a field or an index
- Output `[..]` when borrowing inside a slice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-borrow-checker Area: The borrow checker A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

1 participant