summary refs log tree commit diff
path: root/src/librustdoc/clean
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 /src/librustdoc/clean
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 'src/librustdoc/clean')
-rw-r--r--src/librustdoc/clean/utils.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs
index c22ad43e049..82f4a38384d 100644
--- a/src/librustdoc/clean/utils.rs
+++ b/src/librustdoc/clean/utils.rs
@@ -303,7 +303,8 @@ pub(crate) fn name_from_pat(p: &hir::Pat<'_>) -> Symbol {
     debug!("trying to get a name from pattern: {p:?}");
 
     Symbol::intern(&match p.kind {
-        PatKind::Wild | PatKind::Struct(..) => return kw::Underscore,
+        // FIXME(never_patterns): does this make sense?
+        PatKind::Wild | PatKind::Never | PatKind::Struct(..) => return kw::Underscore,
         PatKind::Binding(_, _, ident, _) => return ident.name,
         PatKind::TupleStruct(ref p, ..) | PatKind::Path(ref p) => qpath_to_string(p),
         PatKind::Or(pats) => {