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
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue