We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f70a4b9 commit 8a72f35Copy full SHA for 8a72f35
library/core/src/iter/adapters/step_by.rs
@@ -1,7 +1,7 @@
1
use crate::convert::TryFrom;
2
use crate::{
3
intrinsics,
4
- iter::from_fn,
+ iter::{from_fn, TrustedLen},
5
ops::{Range, Try},
6
};
7
@@ -484,6 +484,12 @@ macro_rules! spec_int_ranges {
484
acc
485
}
486
487
+
488
+ /// Safety: This macro is only applied to ranges over types <= usize
489
+ /// which means the inner length is guaranteed to fit into a usize and so
490
+ /// the outer length calculation won't encounter clamped values
491
+ #[unstable(feature = "trusted_len", issue = "37572")]
492
+ unsafe impl TrustedLen for StepBy<Range<$t>> {}
493
)*)
494
495
0 commit comments