Skip to content

Commit

Permalink
Merge pull request #97 from Dirbaio/feature-nightly-only
Browse files Browse the repository at this point in the history
Use `feature()` on nightly toolchains only.
  • Loading branch information
ryan-summers authored Nov 28, 2023
2 parents e39a13d + 6e4e73b commit 86878c8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
18 changes: 18 additions & 0 deletions embedded-nal-async/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use std::env;
use std::ffi::OsString;
use std::process::Command;

fn main() {
println!("cargo:rerun-if-changed=build.rs");

let rustc = env::var_os("RUSTC").unwrap_or_else(|| OsString::from("rustc"));

let output = Command::new(rustc)
.arg("--version")
.output()
.expect("failed to run `rustc --version`");

if String::from_utf8_lossy(&output.stdout).contains("nightly") {
println!("cargo:rustc-cfg=nightly");
}
}
5 changes: 3 additions & 2 deletions embedded-nal-async/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//! # embedded-nal-async - An async Network Abstraction Layer for Embedded Systems

#![no_std]
#![feature(async_fn_in_trait, impl_trait_projections)]
#![allow(stable_features, unknown_lints, async_fn_in_trait)]
#![cfg_attr(nightly, allow(stable_features, unknown_lints))]
#![cfg_attr(nightly, feature(async_fn_in_trait, impl_trait_projections))]
#![allow(async_fn_in_trait)]
#![deny(missing_docs)]
#![deny(unsafe_code)]
#![cfg_attr(feature = "ip_in_core", feature(ip_in_core))]
Expand Down

0 comments on commit 86878c8

Please sign in to comment.