diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2024-12-01 22:10:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-01 22:10:23 -0500 |
| commit | 811eaebf7e1038cf229bc40f9f121f8709eeb5f4 (patch) | |
| tree | a6d713a8dda192eef05e00d1268b20c05cde8fd6 /compiler/rustc_trait_selection/src | |
| parent | a522d78598415cdd614ccc6d961160f192f64b5c (diff) | |
| parent | d38f01312c1b827a7a0186c186482579a82cdec3 (diff) | |
| download | rust-811eaebf7e1038cf229bc40f9f121f8709eeb5f4.tar.gz rust-811eaebf7e1038cf229bc40f9f121f8709eeb5f4.zip | |
Rollup merge of #133589 - voidc:remove-array-len, r=boxyuwu
Remove `hir::ArrayLen` This refactoring removes `hir::ArrayLen`, replacing it with `hir::ConstArg`. To represent inferred array lengths (previously `hir::ArrayLen::Infer`), a new variant `ConstArgKind::Infer` is added. r? `@BoxyUwU`
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs index 0f9d4cb1982..8ba7969207e 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs @@ -1837,11 +1837,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { }; if let Some(tykind) = tykind && let hir::TyKind::Array(_, length) = tykind - && let hir::ArrayLen::Body(ct) = length && let Some((scalar, ty)) = sz.found.try_to_scalar() && ty == self.tcx.types.usize { - let span = ct.span(); + let span = length.span(); Some(TypeErrorAdditionalDiags::ConsiderSpecifyingLength { span, length: scalar.to_target_usize(&self.tcx).unwrap(), |
