File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
kani-compiler/src/codegen_cprover_gotoc/codegen
tests/expected/generators/as_parameter Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1315,6 +1315,10 @@ impl<'tcx> GotocCtx<'tcx> {
1315
1315
pub fn ignore_var_ty ( & self , ty : Ty < ' tcx > ) -> bool {
1316
1316
match ty. kind ( ) {
1317
1317
ty:: FnDef ( _, _) => true ,
1318
+ // Ignore variables of the generator type until we add support for
1319
+ // them:
1320
+ // https://github.com/model-checking/kani/issues/416
1321
+ ty:: Generator ( ..) => true ,
1318
1322
_ => false ,
1319
1323
}
1320
1324
}
Original file line number Diff line number Diff line change
1
+ Status: FAILURE\
2
+ Description: "ty::Generator is not currently supported by Kani. Please post your example at https://github.com/model-checking/kani/issues/416"
Original file line number Diff line number Diff line change
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0 OR MIT
3
+
4
+ // Test that includes a generator as a parameter to a function
5
+ // Codegen should succeed, but verification should fail (codegen_unimplemented)
6
+
7
+ #![ feature( generators, generator_trait) ]
8
+
9
+ use std:: ops:: Generator ;
10
+
11
+ fn foo < T > ( g : T )
12
+ where
13
+ T : Generator ,
14
+ {
15
+ let _ = g;
16
+ }
17
+
18
+ #[ kani:: proof]
19
+ fn main ( ) {
20
+ foo ( || {
21
+ yield 1 ;
22
+ return 2 ;
23
+ } ) ;
24
+ }
You can’t perform that action at this time.
0 commit comments