Skip to content

Commit b155b70

Browse files
committed
Allow to build measureme on stable rust
nightly rust was previously required because of the usage of the unstable `asm` feature which was stabilized in version 1.59.0
1 parent bc2e80a commit b155b70

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

measureme/src/counters.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
//! performance counter support ([#143](https://github.com/rust-lang/measureme/pull/143)).*
2020
//!
2121
//! The hardware performance counters (i.e. all counters other than `wall-time`) are limited to:
22-
//! * nightly Rust (gated on `features = ["nightly"]`), for `asm!`
2322
//! * Linux, for out-of-the-box performance counter reads from userspace
2423
//! * other OSes could work through custom kernel extensions/drivers, in the future
2524
//! * `x86_64` CPUs, mostly due to lack of other available test hardware
@@ -300,10 +299,11 @@ const BUG_REPORT_MSG: &str =
300299
"please report this to https://github.com/rust-lang/measureme/issues/new";
301300

302301
/// Linux x86_64 implementation based on `perf_event_open` and `rdpmc`.
303-
#[cfg(all(feature = "nightly", target_arch = "x86_64", target_os = "linux"))]
302+
#[cfg(all(target_arch = "x86_64", target_os = "linux"))]
304303
mod hw {
305304
use memmap2::{Mmap, MmapOptions};
306305
use perf_event_open_sys::{bindings::*, perf_event_open};
306+
use std::arch::asm;
307307
use std::convert::TryInto;
308308
use std::error::Error;
309309
use std::fs;
@@ -934,7 +934,7 @@ mod hw {
934934
}
935935
}
936936

937-
#[cfg(not(all(feature = "nightly", target_arch = "x86_64", target_os = "linux")))]
937+
#[cfg(not(all(target_arch = "x86_64", target_os = "linux")))]
938938
mod hw {
939939
use std::error::Error;
940940

@@ -985,10 +985,6 @@ mod hw {
985985
msg += s;
986986
};
987987

988-
if cfg!(not(feature = "nightly")) {
989-
add_error("only supported with measureme's \"nightly\" feature");
990-
}
991-
992988
if cfg!(not(target_arch = "x86_64")) {
993989
add_error("only supported architecture is x86_64");
994990
}

measureme/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
//!
3333
//! [`Counter`]: counters::Counter
3434
#![deny(warnings)]
35-
#![cfg_attr(feature = "nightly", feature(asm))]
3635

3736
#[macro_use]
3837
extern crate log;

0 commit comments

Comments
 (0)