sr-std 1.0.1

Lowest-abstraction level for the Substrate runtime: just exports useful primitives from std or core/alloc to be used with any code that depends on the runtime.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Set a nightly feature

use rustc_version::{version, version_meta, Channel};

fn main() {
	// Assert we haven't traveled back in time
	assert!(version().unwrap().major >= 1);

	// Set cfg flags depending on release channel
	if let Channel::Nightly = version_meta().unwrap().channel {
		println!("cargo:rustc-cfg=feature=\"nightly\"");
	}
}