Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libcore/iter/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ macro_rules! float_sum_product {
)*)
}

integer_sum_product! { i8 i16 i32 i64 isize u8 u16 u32 u64 usize }
integer_sum_product! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }
float_sum_product! { f32 f64 }

/// An iterator adapter that produces output as long as the underlying
Expand Down
4 changes: 4 additions & 0 deletions src/test/run-pass/i128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,8 @@ fn main() {
assert_eq!(b(-87559967289969187895646876466835277875_i128) /
b(84285771033834995895337664386045050880_i128),
-1i128);

// iter-arithmetic traits
assert_eq!(10i128, [1i128, 2, 3, 4].iter().sum());
assert_eq!(24i128, [1i128, 2, 3, 4].iter().product());
}
4 changes: 4 additions & 0 deletions src/test/run-pass/u128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,8 @@ fn main() {
assert_eq!(b(0x679289ac23bb334f_36144401cf882172_u128) /
b(0x7b0b271b64865f05_f54a7b72746c062f_u128),
0u128);

// iter-arithmetic traits
assert_eq!(10u128, [1u128, 2, 3, 4].iter().sum());
assert_eq!(24u128, [1u128, 2, 3, 4].iter().product());
}