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;
10
10
/// [`sum()`]: Iterator::sum
11
11
/// [`FromIterator`]: iter::FromIterator
12
12
#[ 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
+ ) ]
13
17
pub trait Sum < A = Self > : Sized {
14
18
/// Method which takes an iterator and generates `Self` from the elements by
15
19
/// "summing up" the items.
@@ -27,6 +31,10 @@ pub trait Sum<A = Self>: Sized {
27
31
/// [`product()`]: Iterator::product
28
32
/// [`FromIterator`]: iter::FromIterator
29
33
#[ 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
+ ) ]
30
38
pub trait Product < A = Self > : Sized {
31
39
/// Method which takes an iterator and generates `Self` from the elements by
32
40
/// multiplying the items.
You can’t perform that action at this time.
0 commit comments