File tree Expand file tree Collapse file tree 8 files changed +83
-10
lines changed Expand file tree Collapse file tree 8 files changed +83
-10
lines changed Original file line number Diff line number Diff line change 1+ use std:: env;
2+ use std:: ffi:: OsString ;
3+ use std:: process:: Command ;
4+
5+ fn main ( ) {
6+ println ! ( "cargo:rerun-if-changed=build.rs" ) ;
7+
8+ let rustc = env:: var_os ( "RUSTC" ) . unwrap_or_else ( || OsString :: from ( "rustc" ) ) ;
9+
10+ let output = Command :: new ( rustc)
11+ . arg ( "--version" )
12+ . output ( )
13+ . expect ( "failed to run `rustc --version`" ) ;
14+
15+ if String :: from_utf8_lossy ( & output. stdout ) . contains ( "nightly" ) {
16+ println ! ( "cargo:rustc-cfg=nightly" ) ;
17+ }
18+ }
Original file line number Diff line number Diff line change 55// Needed to pass CI, because we deny warnings.
66// We don't immediately remove them to not immediately break older nightlies.
77// When all features are stable, we'll remove them.
8- #![ allow( stable_features) ]
9- #![ allow ( unknown_lints ) ]
8+ #![ cfg_attr ( nightly , allow( stable_features, unknown_lints ) ) ]
9+ #![ cfg_attr ( nightly , feature ( async_fn_in_trait , impl_trait_projections ) ) ]
1010#![ allow( async_fn_in_trait) ]
11- #![ feature( async_fn_in_trait, impl_trait_projections) ]
1211
1312pub mod delay;
1413pub mod digital;
Original file line number Diff line number Diff line change 1+ use std:: env;
2+ use std:: ffi:: OsString ;
3+ use std:: process:: Command ;
4+
5+ fn main ( ) {
6+ println ! ( "cargo:rerun-if-changed=build.rs" ) ;
7+
8+ let rustc = env:: var_os ( "RUSTC" ) . unwrap_or_else ( || OsString :: from ( "rustc" ) ) ;
9+
10+ let output = Command :: new ( rustc)
11+ . arg ( "--version" )
12+ . output ( )
13+ . expect ( "failed to run `rustc --version`" ) ;
14+
15+ if String :: from_utf8_lossy ( & output. stdout ) . contains ( "nightly" ) {
16+ println ! ( "cargo:rustc-cfg=nightly" ) ;
17+ }
18+ }
Original file line number Diff line number Diff line change 66// Needed to pass CI, because we deny warnings.
77// We don't immediately remove them to not immediately break older nightlies.
88// When all features are stable, we'll remove them.
9- #![ cfg_attr( feature = "async" , allow( stable_features) ) ]
10- #![ cfg_attr( feature = "async" , feature( async_fn_in_trait, impl_trait_projections) ) ]
9+ #![ cfg_attr( all( feature = "async" , nightly) , allow( stable_features) ) ]
10+ #![ cfg_attr(
11+ all( feature = "async" , nightly) ,
12+ feature( async_fn_in_trait, impl_trait_projections)
13+ ) ]
1114
1215// needed to prevent defmt macros from breaking, since they emit code that does `defmt::blahblah`.
1316#[ cfg( feature = "defmt-03" ) ]
Original file line number Diff line number Diff line change 1+ use std:: env;
2+ use std:: ffi:: OsString ;
3+ use std:: process:: Command ;
4+
5+ fn main ( ) {
6+ println ! ( "cargo:rerun-if-changed=build.rs" ) ;
7+
8+ let rustc = env:: var_os ( "RUSTC" ) . unwrap_or_else ( || OsString :: from ( "rustc" ) ) ;
9+
10+ let output = Command :: new ( rustc)
11+ . arg ( "--version" )
12+ . output ( )
13+ . expect ( "failed to run `rustc --version`" ) ;
14+
15+ if String :: from_utf8_lossy ( & output. stdout ) . contains ( "nightly" ) {
16+ println ! ( "cargo:rustc-cfg=nightly" ) ;
17+ }
18+ }
Original file line number Diff line number Diff line change 77// We don't immediately remove them to not immediately break older nightlies.
88// When all features are stable, we'll remove them.
99#![ cfg_attr(
10- any( feature = "tokio-1" , feature = "futures-03" ) ,
10+ all ( any( feature = "tokio-1" , feature = "futures-03" ) , nightly ) ,
1111 allow( stable_features)
1212) ]
1313#![ cfg_attr(
14- any( feature = "tokio-1" , feature = "futures-03" ) ,
14+ all ( any( feature = "tokio-1" , feature = "futures-03" ) , nightly ) ,
1515 feature( async_fn_in_trait, impl_trait_projections)
1616) ]
1717
Original file line number Diff line number Diff line change 1+ use std:: env;
2+ use std:: ffi:: OsString ;
3+ use std:: process:: Command ;
4+
5+ fn main ( ) {
6+ println ! ( "cargo:rerun-if-changed=build.rs" ) ;
7+
8+ let rustc = env:: var_os ( "RUSTC" ) . unwrap_or_else ( || OsString :: from ( "rustc" ) ) ;
9+
10+ let output = Command :: new ( rustc)
11+ . arg ( "--version" )
12+ . output ( )
13+ . expect ( "failed to run `rustc --version`" ) ;
14+
15+ if String :: from_utf8_lossy ( & output. stdout ) . contains ( "nightly" ) {
16+ println ! ( "cargo:rustc-cfg=nightly" ) ;
17+ }
18+ }
Original file line number Diff line number Diff line change 66// Needed to pass CI, because we deny warnings.
77// We don't immediately remove them to not immediately break older nightlies.
88// When all features are stable, we'll remove them.
9- #![ allow( stable_features) ]
10- #![ allow ( unknown_lints ) ]
9+ #![ cfg_attr ( nightly , allow( stable_features, unknown_lints ) ) ]
10+ #![ cfg_attr ( nightly , feature ( async_fn_in_trait , impl_trait_projections ) ) ]
1111#![ allow( async_fn_in_trait) ]
12- #![ feature( async_fn_in_trait, impl_trait_projections) ]
1312
1413#[ cfg( feature = "alloc" ) ]
1514extern crate alloc;
You can’t perform that action at this time.
0 commit comments