Skip to content

Commit 795bbaa

Browse files
authored
Rollup merge of #147464 - RalfJung:repeat, r=saethlin
prefer repeat_n() over repeat().take()
2 parents 94ed5c7 + 70a357a commit 795bbaa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_const_eval/src/interpret/intrinsics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
878878
.compute_size_in_bytes(layout.size, count)
879879
.ok_or_else(|| err_ub_custom!(fluent::const_eval_size_overflow, name = name))?;
880880

881-
let bytes = std::iter::repeat(byte).take(len.bytes_usize());
881+
let bytes = std::iter::repeat_n(byte, len.bytes_usize());
882882
self.write_bytes_ptr(dst, bytes)
883883
}
884884

0 commit comments

Comments
 (0)