-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Global paths don't work in match
at all
#6449
Comments
|
Nominating for feature complete. |
This could be related: #6533 |
Interestingly I get the same error here, without any paths: pub enum MouseButton {
MOUSE_BUTTON_1 = 1,
MOUSE_BUTTON_2 = 2,
MOUSE_BUTTON_3 = 3,
MOUSE_BUTTON_4 = 4,
MOUSE_BUTTON_5 = 5,
MOUSE_BUTTON_6 = 6,
MOUSE_BUTTON_7 = 7,
MOUSE_BUTTON_8 = 8,
}
pub static MOUSE_BUTTON_LEFT : MouseButton = MOUSE_BUTTON_1;
pub static MOUSE_BUTTON_RIGHT : MouseButton = MOUSE_BUTTON_2;
pub static MOUSE_BUTTON_MIDDLE : MouseButton = MOUSE_BUTTON_3;
fn mouse_button_to_str(button: MouseButton) -> ~str {
match button {
MOUSE_BUTTON_LEFT => ~"Left",
MOUSE_BUTTON_RIGHT => ~"Right",
MOUSE_BUTTON_MIDDLE => ~"Middle",
MOUSE_BUTTON_4 => ~"4",
MOUSE_BUTTON_5 => ~"5",
MOUSE_BUTTON_6 => ~"6",
MOUSE_BUTTON_7 => ~"7",
MOUSE_BUTTON_8 => ~"8",
}
}
fn main() {} Error:
|
@bjz, I would file that as a new issue. |
accepted for production-ready milestone |
linking to #6143 for unified tracking of resolve |
Bug triage. Milestone looks right. |
Recently, referring to https://gist.github.com/wilkie/157110f8387ecfce021e I get an error not already mentioned here:
Using a |
Just a bug, not a 1.0 blocker. P-high, not 1.0. |
This replaces some `if`s with `match`es. This was originally not possible because using a global path in a match statement caused a "non-constant path in constant expr" ICE. The issue is long since closed, though you still hit it (as an error now, not an ICE) if you try to generate match patterns using pat_lit(expr_path). But it works when constructing the patterns more carefully.
This replaces some `if`s with `match`es. This was originally not possible because using a global path in a match statement caused a "non-constant path in constant expr" ICE. The issue is long since closed, though you still hit it (as an error now, not an ICE) if you try to generate match patterns using pat_lit(expr_path). But it works when constructing the patterns more carefully.
This replaces some `if`s with `match`es. This was originally not possible because using a global path in a match statement caused a "non-constant path in constant expr" ICE. The issue is long since closed, though you still hit it (as an error now, not an ICE) if you try to generate match patterns using pat_lit(expr_path). But it works when constructing the patterns more carefully.
This replaces some `if`s with `match`es. This was originally not possible because using a global path in a match statement caused a "non-constant path in constant expr" ICE. The issue is long since closed, though you still hit it (as an error now, not an ICE) if you try to generate match patterns using pat_lit(expr_path). But it works when constructing the patterns more carefully.
needless_borrow: print the type in the lint message changelog: needless_borrow: print type in lint message
causes
Similarly,
is the same, except the actual error message is
And
doesn't even parse
The versions without the leading
::
work fine.(Among other things, this makes syntax extensions harder/uglier than necessary.)
The text was updated successfully, but these errors were encountered: