diff options
| author | Ralf Jung <post@ralfj.de> | 2025-05-29 11:51:37 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2025-05-29 11:51:37 +0200 |
| commit | 1b6a2906563148eea90e933fcff7edf0ac91ca35 (patch) | |
| tree | cf9e868333b7f0c13301cf52571c1e8a5bf1baca /compiler/rustc_pattern_analysis/src | |
| parent | c9addbe0e5ed754ed356fa1422db6fdfcc87a6f6 (diff) | |
| parent | afc64242b61041ee2f6e107c9483957dacfbf090 (diff) | |
| download | rust-1b6a2906563148eea90e933fcff7edf0ac91ca35.tar.gz rust-1b6a2906563148eea90e933fcff7edf0ac91ca35.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/rustc.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_pattern_analysis/src/rustc.rs b/compiler/rustc_pattern_analysis/src/rustc.rs index d9f1888bfd9..46ced7500ea 100644 --- a/compiler/rustc_pattern_analysis/src/rustc.rs +++ b/compiler/rustc_pattern_analysis/src/rustc.rs @@ -249,12 +249,12 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { ty::Ref(_, rty, _) => reveal_and_alloc(cx, once(*rty)), _ => bug!("Unexpected type for `Ref` constructor: {ty:?}"), }, - Slice(slice) => match *ty.kind() { - ty::Slice(ty) | ty::Array(ty, _) => { + Slice(slice) => match ty.builtin_index() { + Some(ty) => { let arity = slice.arity(); reveal_and_alloc(cx, (0..arity).map(|_| ty)) } - _ => bug!("bad slice pattern {:?} {:?}", ctor, ty), + None => bug!("bad slice pattern {:?} {:?}", ctor, ty), }, DerefPattern(pointee_ty) => reveal_and_alloc(cx, once(pointee_ty.inner())), Bool(..) | IntRange(..) | F16Range(..) | F32Range(..) | F64Range(..) |
