Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing sum() and product() for u128/i128 #43235

Closed
leonardo-m opened this issue Jul 14, 2017 · 1 comment
Closed

Missing sum() and product() for u128/i128 #43235

leonardo-m opened this issue Jul 14, 2017 · 1 comment

Comments

@leonardo-m
Copy link

#![feature(i128_type)]
#![allow(unused_variables)]
fn main() {
    let r1: u128 = [10, 20].iter().sum();
    let r2: i128 = [10, 20].iter().sum();
    let r3: u128 = [10, 20].iter().product();
    let r4: i128 = [10, 20].iter().product();
}


error[E0277]: the trait bound `u128: std::iter::Sum<&{integer}>` is not satisfied
 --> ...\test.rs:4:36
  |
4 |     let r1: u128 = [10, 20].iter().sum();
  |                                    ^^^ the trait `std::iter::Sum<&{integer}>` is not implemented for `u128`

error[E0277]: the trait bound `i128: std::iter::Sum<&{integer}>` is not satisfied
 --> ...\test.rs:5:36
  |
5 |     let r2: i128 = [10, 20].iter().sum();
  |                                    ^^^ the trait `std::iter::Sum<&{integer}>` is not implemented for `i128`

error[E0277]: the trait bound `u128: std::iter::Product<&{integer}>` is not satisfied
 --> ...\test.rs:6:36
  |
6 |     let r3: u128 = [10, 20].iter().product();
  |                                    ^^^^^^^ the trait `std::iter::Product<&{integer}>` is not implemented for `u128`

error[E0277]: the trait bound `i128: std::iter::Product<&{integer}>` is not satisfied
 --> ...\test.rs:7:36
  |
7 |     let r4: i128 = [10, 20].iter().product();
  |                                    ^^^^^^^ the trait `std::iter::Product<&{integer}>` is not implemented for `i128`


@zackmdavis
Copy link
Member

Looks to be as simple as adding arguments to the invocation of the implementing macro. PR forthcoming.

zackmdavis added a commit to zackmdavis/rust that referenced this issue Jul 14, 2017
bors added a commit that referenced this issue Jul 16, 2017
…_integers, r=nagisa

add u128/i128 to sum/product implementors

Resolves #43235.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants