-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Remove __rust_force_expr
.
#126929
Remove __rust_force_expr
.
#126929
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
error: arbitrary expressions aren't allowed in patterns | ||
error: expected pattern, found `#` | ||
--> $DIR/vec-macro-in-pattern.rs:7:14 | ||
| | ||
LL | Some(vec![43]) => {} | ||
| ^^^^^^^^ | ||
| | | ||
| expected pattern | ||
| in this macro invocation | ||
| this macro call doesn't expand to a pattern | ||
| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm... does the compiler know what it expands to? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand the question. Are you suggesting changing the error message? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well, I was wondering if we even have the information reliably to change the error message to "this macro call expands to an expression, not a pattern" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's see... the error is emitted by I think it's hard to do what you suggest. We try to parse as a pattern and when that fails there's no easy way to determine what we actually had instead of a pattern, short of reparsing it in a bunch of different ways to see if anything succeeds, which feels clumsy. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea no, that's wrong. Thanks for checking |
||
= note: the `expr` fragment specifier forces the metavariable's content to be an expression | ||
= note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to 1 previous error | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that error not very helpful, as there no
#
in test source code. Error message refers to expanded code?