@@ -12,32 +12,12 @@ use rustc_ast::Attribute;
12
12
use rustc_hir:: def:: DefKind ;
13
13
use rustc_hir:: def_id:: DefId ;
14
14
use rustc_middle:: mir:: { HasLocalDecls , Local } ;
15
- use rustc_middle:: ty:: print:: with_no_trimmed_paths;
16
15
use rustc_middle:: ty:: { self , Instance } ;
17
16
use std:: collections:: BTreeMap ;
18
17
use std:: convert:: TryInto ;
19
18
use std:: iter:: FromIterator ;
20
19
use tracing:: { debug, info_span} ;
21
20
22
- /// Utility to skip functions that can't currently be successfully codgenned.
23
- impl < ' tcx > GotocCtx < ' tcx > {
24
- fn should_skip_current_fn ( & self ) -> bool {
25
- let current_fn_name =
26
- with_no_trimmed_paths ! ( self . tcx. def_path_str( self . current_fn( ) . instance( ) . def_id( ) ) ) ;
27
- // We cannot use self.current_fn().readable_name() because it gives the monomorphized type, which is more difficult to match on.
28
- // Ideally we should not rely on the pretty-printed name here. Tracked here: https://github.com/model-checking/kani/issues/1374
29
- match current_fn_name. as_str ( ) {
30
- // https://github.com/model-checking/kani/issues/202
31
- "fmt::ArgumentV1::<'a>::as_usize" => true ,
32
- // https://github.com/model-checking/kani/issues/282
33
- "bridge::closure::Closure::<'a, A, R>::call" => true ,
34
- name if name. contains ( "reusable_box::ReusableBoxFuture" ) => true ,
35
- "tokio::sync::Semaphore::acquire_owned::{closure#0}" => true ,
36
- _ => false ,
37
- }
38
- }
39
- }
40
-
41
21
/// Codegen MIR functions into gotoc
42
22
impl < ' tcx > GotocCtx < ' tcx > {
43
23
/// Get the number of parameters that the current function expects.
@@ -94,20 +74,6 @@ impl<'tcx> GotocCtx<'tcx> {
94
74
info_span ! ( "CodegenFunction" , name = self . current_fn( ) . readable_name( ) ) . entered ( ) ;
95
75
if old_sym. is_function_definition ( ) {
96
76
tracing:: info!( "Double codegen of {:?}" , old_sym) ;
97
- } else if self . should_skip_current_fn ( ) {
98
- debug ! ( "Skipping function {}" , self . current_fn( ) . readable_name( ) ) ;
99
- self . codegen_function_prelude ( ) ;
100
- self . codegen_declare_variables ( ) ;
101
- let loc = self . codegen_span ( & self . current_fn ( ) . mir ( ) . span ) ;
102
- let readable_name = format ! ( "The function {}" , self . current_fn( ) . readable_name( ) ) ;
103
- // We'll ideally just get rid of this eventually, but use "mimic" to avoid extra compilation warnings
104
- let body = self . codegen_mimic_unimplemented (
105
- & readable_name,
106
- loc,
107
- // There actually are links to specific issues in `should_skip_current_fn`...
108
- "https://github.com/model-checking/kani/issues/new/choose" ,
109
- ) ;
110
- self . symbol_table . update_fn_declaration_with_definition ( & name, body) ;
111
77
} else {
112
78
assert ! ( old_sym. is_function( ) ) ;
113
79
let mir = self . current_fn ( ) . mir ( ) ;
0 commit comments