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:
Matthias Krüger 2023-11-29 12:34:47 +01:00 committed by GitHub
commit c03f8917ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 325 additions and 18 deletions

View file

@ -1343,6 +1343,7 @@ impl<'a> State<'a> {
is that it doesn't matter */
match &pat.kind {
PatKind::Wild => self.word("_"),
PatKind::Never => self.word("!"),
PatKind::Ident(BindingAnnotation(by_ref, mutbl), ident, sub) => {
if *by_ref == ByRef::Yes {
self.word_nbsp("ref");