Remove hir::ArrayLen, introduce ConstArgKind::Infer

Remove Node::ArrayLenInfer
This commit is contained in:
Dominik Stolz 2024-11-28 17:33:22 +01:00
parent 9b4d7c6a40
commit d38f01312c
24 changed files with 105 additions and 182 deletions

View file

@ -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(),