File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ pub enum Feature {
5151 Logger ,
5252 PanicOnLoggerErrors ,
5353 Unstable ,
54+ UnstableAlloc ,
5455
5556 // `uefi-services` features.
5657 PanicHandler ,
@@ -69,6 +70,7 @@ impl Feature {
6970 Self :: Logger => "logger" ,
7071 Self :: PanicOnLoggerErrors => "panic-on-logger-errors" ,
7172 Self :: Unstable => "unstable" ,
73+ Self :: UnstableAlloc => "unstable_alloc" ,
7274
7375 Self :: PanicHandler => "uefi-services/panic_handler" ,
7476 Self :: Qemu => "uefi-services/qemu" ,
@@ -99,6 +101,11 @@ impl Feature {
99101 vec ! [ Self :: GlobalAllocator , Self :: Alloc , Self :: Logger ]
100102 }
101103
104+ /// Set of features that enables more code in the root uefi crate.
105+ pub fn more_code_unstable ( ) -> Vec < Self > {
106+ vec ! [ Self :: Unstable , Self :: UnstableAlloc ]
107+ }
108+
102109 fn comma_separated_string ( features : & [ Feature ] ) -> String {
103110 features
104111 . iter ( )
Original file line number Diff line number Diff line change @@ -45,9 +45,15 @@ fn build(opt: &BuildOpt) -> Result<()> {
4545 return build_feature_permutations ( opt) ;
4646 }
4747
48+ let mut features = Feature :: more_code ( ) ;
49+
50+ if opt. unstable_features {
51+ features. extend ( Feature :: more_code_unstable ( ) )
52+ }
53+
4854 let cargo = Cargo {
4955 action : CargoAction :: Build ,
50- features : Feature :: more_code ( ) ,
56+ features,
5157 packages : Package :: all_except_xtask ( ) ,
5258 release : opt. build_mode . release ,
5359 target : Some ( * opt. target ) ,
Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ pub struct BuildOpt {
6363 #[ clap( flatten) ]
6464 pub build_mode : BuildModeOpt ,
6565
66+ /// Tells whether unstable features should be activated.
67+ #[ clap( long, action) ]
68+ pub unstable_features : bool ,
69+
6670 /// Build multiple times to check that different feature
6771 /// combinations work.
6872 #[ clap( long, action) ]
You can’t perform that action at this time.
0 commit comments