diff options
| author | Ralf Jung <post@ralfj.de> | 2025-05-29 10:21:35 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-29 10:21:35 +0000 |
| commit | af48d429a3b2670f70f4e9fc43e2a5fe5c499cde (patch) | |
| tree | cf9e868333b7f0c13301cf52571c1e8a5bf1baca /compiler/rustc_pattern_analysis/src/rustc.rs | |
| parent | 5a38c32c6d8ca6f3ac17c153e2f7acea5e190e71 (diff) | |
| parent | 1b6a2906563148eea90e933fcff7edf0ac91ca35 (diff) | |
| download | rust-af48d429a3b2670f70f4e9fc43e2a5fe5c499cde.tar.gz rust-af48d429a3b2670f70f4e9fc43e2a5fe5c499cde.zip | |
Merge pull request #4355 from RalfJung/rustup
Rustup
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/rustc.rs')
| -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(..) |
