mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
42ab090be9
Add a note to the ArbitraryExpressionInPattern error The current "arbitrary expressions aren't allowed in patterns" error is confusing, as it fires for code where it *looks* like a pattern but the compiler still treats it as an expression. That this is due to the `:expr` fragment specifier forcing the expression-ness property on the code. In the test suite, the "arbitrary expressions aren't allowed in patterns" error can only be found in combination with macro_rules macros that force expression-ness of their content, namely via `:expr` metavariables. I also can't come up with cases where there would be an expression instead of a pattern, so I think it's always coming from an `:expr`. In order to make the error less confusing, this adds a note explaining the weird `:expr` fragment behaviour. Fixes #99380 |
||
---|---|---|
.. | ||
asm.rs | ||
block.rs | ||
delegation.rs | ||
errors.rs | ||
expr.rs | ||
format.rs | ||
index.rs | ||
item.rs | ||
lib.rs | ||
lifetime_collector.rs | ||
pat.rs | ||
path.rs |