Peter Pei Guo
Peter Pei Guo

Reputation: 7870

What is the workaround for unstable library feature "core" issue?

I am trying to add big integers together in 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);

I got the following error:

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;

Is there any workaround at this time? or is this entirely not doable for the time being?

Upvotes: 1

Views: 487

Answers (1)

Alex Knauth
Alex Knauth

Reputation: 8373

You should be able to use the std::ops::Add trait instead of core::ops::Add.

use std::ops::Add;

Upvotes: 3

Related Questions