about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/check/wfcheck.rs
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-05-29 04:49:42 +0200
committerGitHub <noreply@github.com>2025-05-29 04:49:42 +0200
commitd3a69636c910afd8b9f62bb583568bf28c4cccb6 (patch)
treeee00ad5cec697d92626dff00d352e009175b0f2b /compiler/rustc_hir_analysis/src/check/wfcheck.rs
parent1c46b4a4a9f5a3adfc2d6522caca435e78d2da33 (diff)
parent550aed825b3a630b5b2bd235e193bfce065268c2 (diff)
downloadrust-d3a69636c910afd8b9f62bb583568bf28c4cccb6.tar.gz
rust-d3a69636c910afd8b9f62bb583568bf28c4cccb6.zip
Rollup merge of #141638 - oli-obk:builtin-index, r=lcnr
Use `builtin_index` instead of hand-rolling it

Just using the dedicated method more
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check/wfcheck.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/check/wfcheck.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
index 063dbbcaecb..f85ff5a6f4b 100644
--- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs
+++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs
@@ -1046,8 +1046,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) -> Result<(),
                             match ty.kind() {
                                 ty::Adt(adt_def, ..) => adt_def.did().is_local(),
                                 // Arrays and slices use the inner type's `ConstParamTy`.
-                                ty::Array(ty, ..) => ty_is_local(*ty),
-                                ty::Slice(ty) => ty_is_local(*ty),
+                                ty::Array(ty, ..) | ty::Slice(ty) => ty_is_local(*ty),
                                 // `&` references use the inner type's `ConstParamTy`.
                                 // `&mut` are not supported.
                                 ty::Ref(_, ty, ast::Mutability::Not) => ty_is_local(*ty),