I'd like this program to compile and print 314158
when executed:
extern crate num;
use num::{BigInt, FromPrimitive, One};
fn main() {
let p: BigInt = FromPrimitive::from_usize(314159).unwrap();
let q: BigInt = p - One::one();
println!("q = {}", q);
} // end main
The compiler error is:
error[E0284]: type annotations required: cannot resolve `<num::BigInt as std::ops::Sub<_>>::Output == num::BigInt`
--> src/main.rs:7:23
|
7 | let q: BigInt = p - One::one();
| ^