不稳定库功能“核心”问题的解决方法是什么?

时间:2016-01-13 01:15:45

标签: rust biginteger

我想在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;

目前有解决方法吗?或者这暂时是不可行的?

1 个答案:

答案 0 :(得分:3)

您应该可以使用std::ops::Add特征而不是core::ops::Add

use std::ops::Add;