We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 68c2f5b + 8bf075f commit b99af95Copy full SHA for b99af95
compiler/rustc_hir_typeck/src/generator_interior/mod.rs
@@ -643,17 +643,14 @@ fn check_must_not_suspend_ty<'tcx>(
643
}
644
ty::Array(ty, len) => {
645
let descr_pre = &format!("{}array{} of ", data.descr_pre, plural_suffix);
646
+ let target_usize =
647
+ len.try_eval_target_usize(fcx.tcx, fcx.param_env).unwrap_or(0) as usize;
648
+ let plural_len = target_usize.saturating_add(1);
649
check_must_not_suspend_ty(
650
fcx,
651
ty,
652
hir_id,
- SuspendCheckData {
- descr_pre,
- plural_len: len.try_eval_target_usize(fcx.tcx, fcx.param_env).unwrap_or(0)
653
- as usize
654
- + 1,
655
- ..data
656
- },
+ SuspendCheckData { descr_pre, plural_len, ..data },
657
)
658
659
// If drop tracking is enabled, we want to look through references, since the referent
0 commit comments