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

Improving an error message: "cannot bind by-move into a pattern guard" #684

Closed
steveklabnik opened this issue Jan 21, 2015 · 1 comment
Closed
Labels
T-compiler Relevant to the compiler team, which will review and decide on the RFC.

Comments

@steveklabnik
Copy link
Member

Issue by catamorphism
Saturday Jan 26, 2013 at 20:41 GMT

For earlier discussion, see rust-lang/rust#4649

This issue was labelled with: A-diagnostics, A-windows, B-RFC, I-papercut in the Rust repository


Based on an IRC conversation just now, I can think of two ways to improve this error message:

  1. Because pattern guards use the "if" keyword, someone may have written one by accident. Then, if they see this error message, they're going to ask "what's a pattern guard"? The error could explain this (it's a little hard to figure out right now since the entire pattern gets underlined, not the guard).
  2. Probably more importantly, the error should suggest what to do to fix it.

The error in question is in rustc::middle::check_match.

@Centril
Copy link
Contributor

Centril commented Oct 7, 2018

Closing in favor of rust-lang/rust#45600.

@Centril Centril closed this as completed Oct 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-compiler Relevant to the compiler team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

3 participants