File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ use crate::num::Wrapping;
1010/// [`sum()`]: Iterator::sum
1111/// [`FromIterator`]: iter::FromIterator
1212#[ stable( feature = "iter_arith_traits" , since = "1.12.0" ) ]
13+ #[ rustc_on_unimplemented(
14+ message = "a value of type `{Self}` cannot be made by summing an iterator over elements of type `{A}`" ,
15+ label = "value of type `{Self}` cannot be made by summing a `std::iter::Iterator<Item={A}>`"
16+ ) ]
1317pub trait Sum < A = Self > : Sized {
1418 /// Method which takes an iterator and generates `Self` from the elements by
1519 /// "summing up" the items.
@@ -27,6 +31,10 @@ pub trait Sum<A = Self>: Sized {
2731/// [`product()`]: Iterator::product
2832/// [`FromIterator`]: iter::FromIterator
2933#[ stable( feature = "iter_arith_traits" , since = "1.12.0" ) ]
34+ #[ rustc_on_unimplemented(
35+ message = "a value of type `{Self}` cannot be made by multiplying all elements of type `{A}` from an iterator" ,
36+ label = "value of type `{Self}` cannot be made by multiplying all elements from a `std::iter::Iterator<Item={A}>`"
37+ ) ]
3038pub trait Product < A = Self > : Sized {
3139 /// Method which takes an iterator and generates `Self` from the elements by
3240 /// multiplying the items.
You can’t perform that action at this time.
0 commit comments