bheisler / criterion.rs

Statistics-driven benchmarking library for Rust
Apache License 2.0
4.28k stars 290 forks source link

Unstable feature crate attribute not recognized in different modules #746

Open haslersn opened 7 months ago

haslersn commented 7 months ago

I added

#![feature(portable_simd)]

to my benches/main.rs and configured criterion as follows:

[dev-dependencies]
criterion = { version = "0.3" }

[[bench]]
name = "main"
harness = false

Within benches/main.rs, I can use that feature. However, when I add mod uint; to benches/main.rs and use the portable_simd feature from within benches/uint.rs, I get the following error:

error[E0658]: use of unstable library feature 'portable_simd'
 --> benches/uint.rs:1:17
  |
1 | use std::simd::{LaneCount, SupportedLaneCount};
  |                 ^^^^^^^^^
  |
  = note: see issue #86656 <https://github.com/rust-lang/rust/issues/86656> for more information
  = help: add `#![feature(portable_simd)]` to the crate attributes to enable