Rollup merge of #118157 - Nadrieril:never_pat-feature-gate, r=compiler-errors
Add `never_patterns` feature gate This PR adds the feature gate and most basic parsing for the experimental `never_patterns` feature. See the tracking issue (https://github.com/rust-lang/rust/issues/118155) for details on the experiment. `@scottmcm` has agreed to be my lang-team liaison for this experiment.
This commit is contained in:
commit
c03f8917ee
40 changed files with 325 additions and 18 deletions
|
@ -286,7 +286,21 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> {
|
|||
fn visit_pat(&mut self, p: &'v hir::Pat<'v>) {
|
||||
record_variants!(
|
||||
(self, p, p.kind, Id::Node(p.hir_id), hir, Pat, PatKind),
|
||||
[Wild, Binding, Struct, TupleStruct, Or, Path, Tuple, Box, Ref, Lit, Range, Slice]
|
||||
[
|
||||
Wild,
|
||||
Binding,
|
||||
Struct,
|
||||
TupleStruct,
|
||||
Or,
|
||||
Never,
|
||||
Path,
|
||||
Tuple,
|
||||
Box,
|
||||
Ref,
|
||||
Lit,
|
||||
Range,
|
||||
Slice
|
||||
]
|
||||
);
|
||||
hir_visit::walk_pat(self, p)
|
||||
}
|
||||
|
@ -554,6 +568,7 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> {
|
|||
Range,
|
||||
Slice,
|
||||
Rest,
|
||||
Never,
|
||||
Paren,
|
||||
MacCall
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue