@@ -282,17 +282,6 @@ pub struct VerificationArgs {
282
282
#[ arg( long) ]
283
283
pub randomize_layout : Option < Option < u64 > > ,
284
284
285
- /// Enable the stubbing of functions and methods.
286
- // TODO: Stubbing should in principle work with concrete playback.
287
- // <https://github.com/model-checking/kani/issues/1842>
288
- #[ arg(
289
- long,
290
- hide_short_help = true ,
291
- requires( "enable_unstable" ) ,
292
- conflicts_with( "concrete_playback" )
293
- ) ]
294
- enable_stubbing : bool ,
295
-
296
285
/// Enable Kani coverage output alongside verification result
297
286
#[ arg( long, hide_short_help = true ) ]
298
287
pub coverage : bool ,
@@ -345,8 +334,7 @@ impl VerificationArgs {
345
334
346
335
/// Is experimental stubbing enabled?
347
336
pub fn is_stubbing_enabled ( & self ) -> bool {
348
- self . enable_stubbing
349
- || self . common_args . unstable_features . contains ( UnstableFeature :: Stubbing )
337
+ self . common_args . unstable_features . contains ( UnstableFeature :: Stubbing )
350
338
|| self . is_function_contracts_enabled ( )
351
339
}
352
340
}
@@ -579,6 +567,13 @@ impl ValidateArgs for VerificationArgs {
579
567
--output-format=old.",
580
568
) ) ;
581
569
}
570
+ if self . concrete_playback . is_some ( ) && self . is_stubbing_enabled ( ) {
571
+ // Concrete playback currently does not work with contracts or stubbing.
572
+ return Err ( Error :: raw (
573
+ ErrorKind :: ArgumentConflict ,
574
+ "Conflicting options: --concrete-playback isn't compatible with stubbing." ,
575
+ ) ) ;
576
+ }
582
577
if self . concrete_playback . is_some ( ) && self . jobs ( ) != Some ( 1 ) {
583
578
// Concrete playback currently embeds a lot of assumptions about the order in which harnesses get called.
584
579
return Err ( Error :: raw (
@@ -606,10 +601,6 @@ impl ValidateArgs for VerificationArgs {
606
601
}
607
602
}
608
603
609
- if self . enable_stubbing {
610
- print_deprecated ( & self . common_args , "--enable-stubbing" , "-Z stubbing" ) ;
611
- }
612
-
613
604
if self . concrete_playback . is_some ( )
614
605
&& !self . common_args . unstable_features . contains ( UnstableFeature :: ConcretePlayback )
615
606
{
@@ -880,14 +871,18 @@ mod tests {
880
871
881
872
#[ test]
882
873
fn check_enable_stubbing ( ) {
883
- check_unstable_flag ! ( "--enable-stubbing --harness foo" , enable_stubbing) ;
874
+ let res = parse_unstable_disabled ( "--harness foo" ) . unwrap ( ) ;
875
+ assert ! ( !res. verify_opts. is_stubbing_enabled( ) ) ;
884
876
885
- check_unstable_flag ! ( "--enable-stubbing" , enable_stubbing) ;
877
+ let res = parse_unstable_disabled ( "--harness foo -Z stubbing" ) . unwrap ( ) ;
878
+ assert ! ( res. verify_opts. is_stubbing_enabled( ) ) ;
886
879
887
- // `--enable-stubbing` cannot be called with `--concrete-playback`
888
- let err =
889
- parse_unstable_enabled ( "--enable-stubbing --harness foo --concrete-playback=print" )
890
- . unwrap_err ( ) ;
880
+ // `-Z stubbing` cannot be called with `--concrete-playback`
881
+ let res = parse_unstable_disabled (
882
+ "--harness foo --concrete-playback=print -Z concrete-playback -Z stubbing" ,
883
+ )
884
+ . unwrap ( ) ;
885
+ let err = res. validate ( ) . unwrap_err ( ) ;
891
886
assert_eq ! ( err. kind( ) , ErrorKind :: ArgumentConflict ) ;
892
887
}
893
888
0 commit comments