about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-11-29 12:34:47 +0100
committerGitHub <noreply@github.com>2023-11-29 12:34:47 +0100
commitc03f8917ee45255166916cdc8b9aa1f6f8a98fdc (patch)
tree7fedd712bd38a5ed6042be8a84a4eaad627dd981 /compiler/rustc_ast_lowering
parentec1f21cb0483c40329b54c10b19c0e6220f5e51d (diff)
parenta3838c855064f55485147c66e0e50b039875613e (diff)
downloadrust-c03f8917ee45255166916cdc8b9aa1f6f8a98fdc.tar.gz
rust-c03f8917ee45255166916cdc8b9aa1f6f8a98fdc.zip
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.
Diffstat (limited to 'compiler/rustc_ast_lowering')
-rw-r--r--compiler/rustc_ast_lowering/src/pat.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_ast_lowering/src/pat.rs b/compiler/rustc_ast_lowering/src/pat.rs
index 4950f6e54b5..017314ee4d1 100644
--- a/compiler/rustc_ast_lowering/src/pat.rs
+++ b/compiler/rustc_ast_lowering/src/pat.rs
@@ -24,6 +24,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
             let node = loop {
                 match &pattern.kind {
                     PatKind::Wild => break hir::PatKind::Wild,
+                    PatKind::Never => break hir::PatKind::Never,
                     PatKind::Ident(binding_mode, ident, sub) => {
                         let lower_sub = |this: &mut Self| sub.as_ref().map(|s| this.lower_pat(s));
                         break self.lower_pat_ident(pattern, *binding_mode, *ident, lower_sub);