Is benchmarking unsafe in Rust 1.3.0?

I'd like to benchmark a couple of methods and I'm currently using Rust 1.3. With the most basic test

extern crate test;
use test::Bencher;

#[bench]
fn it_benches(b: &mut Bencher){
  b.iter(|| {
    assert!(true)
  });
}

and running cargo bench I get the following error:

error: use of unstable library feature 'test'
extern crate test;

If I try to add the

#![feature(test)]

line I see in some documents I get the following error

error: #[feature] may not be used on the stable release channel
#![feature(test)]

Is there a benchmarking option for Rust 1.3 users?

Benchmarking is not unsafe, it is unstable

The API has not been finalized, so it is unstable. If you want to contribute to the stabilization of the test crate, find the issue for its stabilization, and comment on what you think.

Is there a benchmarking option for Rust 1.3 users?

It is to use nightly, As I Understand It.

1 Like

Thank you! I've updated to the nightly.