Rust fix compilation for no_std targets #2 (#7553)

* Fix nightly no_std

* Fix nightly no_std
This commit is contained in:
Dan Lapid
2022-10-19 16:14:41 +03:00
committed by GitHub
parent 0edb275285
commit 5792623df4
11 changed files with 187 additions and 35 deletions

12
rust/flatbuffers/build.rs Normal file
View File

@@ -0,0 +1,12 @@
use rustc_version::{version_meta, Channel};
fn main() {
let version_meta = version_meta().unwrap();
// To use nightly features we declare this and then we can use
// #[cfg(nightly)]
// for nightly only features
if version_meta.channel == Channel::Nightly {
println!("cargo:rustc-cfg=nightly")
}
}