我正在尝试在 Rust 中将大整数相加:
extern crate core;
use core::ops::Add;
use num::bigint::{BigInt};
use num::integer::Integer;
...
let mut big = "8705702225074732811211966512111".parse::<BigInt>().unwrap();
let one = "1".parse::<BigInt>().unwrap();
big = big.add(&one);
我收到以下错误:
src\main.rs:3:1: 3:19 error: use of unstable library feature 'core': the libcore library has not yet been scrutinized for stabilization in terms of structure and naming (see issue #27701)
src\main.rs:3 extern crate core;
目前有什么解决方法吗?或者这暂时完全不可行?
最佳答案
您应该能够使用 std::ops::Add
trait 而不是 core::ops::Add
。
use std::ops::Add;
关于rust - 不稳定库功能 "core"问题的解决方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34756799/