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 5
5
// Needed to pass CI, because we deny warnings.
6
6
// We don't immediately remove them to not immediately break older nightlies.
7
7
// 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 ) ) ]
10
10
#![ allow( async_fn_in_trait) ]
11
- #![ feature( async_fn_in_trait, impl_trait_projections) ]
12
11
13
12
pub mod delay;
14
13
pub 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 6
6
// Needed to pass CI, because we deny warnings.
7
7
// We don't immediately remove them to not immediately break older nightlies.
8
8
// 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
+ ) ]
11
14
12
15
// needed to prevent defmt macros from breaking, since they emit code that does `defmt::blahblah`.
13
16
#[ 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 7
7
// We don't immediately remove them to not immediately break older nightlies.
8
8
// When all features are stable, we'll remove them.
9
9
#![ cfg_attr(
10
- any( feature = "tokio-1" , feature = "futures-03" ) ,
10
+ all ( any( feature = "tokio-1" , feature = "futures-03" ) , nightly ) ,
11
11
allow( stable_features)
12
12
) ]
13
13
#![ cfg_attr(
14
- any( feature = "tokio-1" , feature = "futures-03" ) ,
14
+ all ( any( feature = "tokio-1" , feature = "futures-03" ) , nightly ) ,
15
15
feature( async_fn_in_trait, impl_trait_projections)
16
16
) ]
17
17
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 6
6
// Needed to pass CI, because we deny warnings.
7
7
// We don't immediately remove them to not immediately break older nightlies.
8
8
// 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 ) ) ]
11
11
#![ allow( async_fn_in_trait) ]
12
- #![ feature( async_fn_in_trait, impl_trait_projections) ]
13
12
14
13
#[ cfg( feature = "alloc" ) ]
15
14
extern crate alloc;
You can’t perform that action at this time.
0 commit comments