1
Fork 0
rust/compiler/rustc_expand/src
Dylan DPC 91e5384fc0
Rollup merge of #81869 - mark-i-m:leading-vert, r=petrochenkov
Simplify pattern grammar, improve or-pattern diagnostics

This implements the change under FCP in https://github.com/rust-lang/rust/issues/81415. It allows nested or-patterns to contain a leading `|`, simplifying the [grammar for patterns](https://github.com/rust-lang/reference/pull/957/files?short_path=cc629f1#diff-cc629f15712821139bc706c63b3845ab59a008e2a998e08ffad42e3aebcbcbe2).

Along the way, we also improve the diagnostics around a few specially-handled cases, such as using `||` instead of `|`, using or-patterns in fn params, including the leading `|` in the pattern span, etc.

r? `@petrochenkov`
2021-02-17 23:51:16 +01:00
..
mbe Add SEMICOLON_IN_EXPRESSIONS_FROM_MACROS lint 2021-01-28 08:51:43 -05:00
mut_visit rustc_ast: visit_mac -> visit_mac_call 2020-11-03 23:39:51 +03:00
parse Force token collection to run when parsing nonterminals 2021-01-20 18:09:32 -05:00
tokenstream mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
base.rs add method to construct def site path as a vec of idents 2021-02-09 13:42:35 +01:00
build.rs Properly handle attributes on statements 2020-11-26 17:08:35 -05:00
config.rs Use Option::map_or instead of .map(..).unwrap_or(..) 2021-01-14 19:23:59 +01:00
expand.rs Rollup merge of #81869 - mark-i-m:leading-vert, r=petrochenkov 2021-02-17 23:51:16 +01:00
lib.rs Remove redundant bool_to_option feature gate 2021-02-15 04:27:57 +01:00
mbe.rs Revert "Promote missing_fragment_specifier to hard error" 2020-12-22 09:33:16 -05:00
module.rs Syntactically permit unsafety on mods 2020-09-10 06:56:33 -07:00
placeholders.rs expand: Remove obsolete ExpansionConfig::keep_macs 2021-02-14 19:43:54 +03:00
proc_macro.rs expand/resolve: Turn #[derive] into a regular macro attribute 2021-02-07 20:08:45 +03:00
proc_macro_server.rs rustc_parse: Better spans for synthesized token streams 2021-01-07 17:48:13 +03:00
tests.rs remove redundant closures (clippy::redundant_closure) 2021-01-03 13:34:24 +01:00