From 7d4b7c4678f5395a4ec9c03fd4ecc281f1ca42d5 Mon Sep 17 00:00:00 2001 From: Daniel Schwartz-Narbonne Date: Tue, 15 Jun 2021 14:36:51 -0400 Subject: [PATCH 1/5] skip a bunch of functions --- .../src/gotoc/current_fn.rs | 8 +++++ .../rustc_codegen_llvm/src/gotoc/intrinsic.rs | 8 ++++- compiler/rustc_codegen_llvm/src/gotoc/mod.rs | 35 ++++++++++++++++--- .../rustc_codegen_llvm/src/gotoc/place.rs | 7 +++- compiler/rustc_codegen_llvm/src/gotoc/typ.rs | 10 ++++-- .../rustc_codegen_llvm/src/gotoc/utils.rs | 11 ++++-- 6 files changed, 69 insertions(+), 10 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/gotoc/current_fn.rs b/compiler/rustc_codegen_llvm/src/gotoc/current_fn.rs index 28c98ce5b7ba..e21381014fad 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/current_fn.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/current_fn.rs @@ -24,6 +24,8 @@ pub struct CurrentFnCtx<'tcx> { mir: &'tcx Body<'tcx>, /// The symbol name of the current function name: String, + /// A human readable pretty name for the current function + readable_name: String, /// The signature of the current function sig: PolyFnSig<'tcx>, /// A counter to enable creating temporary variables @@ -40,6 +42,7 @@ impl CurrentFnCtx<'tcx> { labels: vec![], mir: gcx.tcx.instance_mir(instance.def), name: gcx.symbol_name(instance), + readable_name: gcx.readable_instance_name(instance), sig: gcx.fn_sig_of_instance(instance), temp_var_counter: 0, } @@ -104,6 +107,11 @@ impl CurrentFnCtx<'tcx> { self.name.clone() } + /// The pretty name of the function we are currently compiling + pub fn readable_name(&self) -> String { + self.readable_name.clone() + } + /// The signature of the function we are currently compiling pub fn sig(&self) -> PolyFnSig<'tcx> { self.sig diff --git a/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs b/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs index 14cb15d01051..3d0f47f35fbe 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs @@ -255,6 +255,7 @@ impl<'tcx> GotocCtx<'tcx> { "atomic_load" => self.codegen_atomic_load(intrinsic, fargs, p, loc), "atomic_load_acq" => self.codegen_atomic_load(intrinsic, fargs, p, loc), "atomic_load_relaxed" => self.codegen_atomic_load(intrinsic, fargs, p, loc), + "atomic_load_unordered" => self.codegen_atomic_load(intrinsic, fargs, p, loc), "atomic_or" => codegen_atomic_binop!(bitor), "atomic_or_acq" => codegen_atomic_binop!(bitor), "atomic_or_acqrel" => codegen_atomic_binop!(bitor), @@ -263,6 +264,7 @@ impl<'tcx> GotocCtx<'tcx> { "atomic_store" => self.codegen_atomic_store(intrinsic, fargs, p, loc), "atomic_store_rel" => self.codegen_atomic_store(intrinsic, fargs, p, loc), "atomic_store_relaxed" => self.codegen_atomic_store(intrinsic, fargs, p, loc), + "atomic_store_unordered" => self.codegen_atomic_store(intrinsic, fargs, p, loc), "atomic_xadd" => codegen_atomic_binop!(plus), "atomic_xadd_acq" => codegen_atomic_binop!(plus), "atomic_xadd_acqrel" => codegen_atomic_binop!(plus), @@ -434,7 +436,11 @@ impl<'tcx> GotocCtx<'tcx> { "va_start" => unimplemented!(), "volatile_set_memory" => unimplemented!(), "volatile_store" => unimplemented!(), - _ => unimplemented!("unsupported intrinsic: {}", intrinsic), + _ => unimplemented!( + "unsupported intrinsic: {}\n\tin function {}", + intrinsic, + self.current_fn().readable_name() + ), } } diff --git a/compiler/rustc_codegen_llvm/src/gotoc/mod.rs b/compiler/rustc_codegen_llvm/src/gotoc/mod.rs index 6db1110272d5..95d0ea208ce6 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/mod.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/mod.rs @@ -97,13 +97,40 @@ impl<'tcx> GotocCtx<'tcx> { self.current_fn().mir().basic_blocks().indices().map(|bb| format!("{:?}", bb)).collect() } + fn should_skip_current_fn(&self) -> bool { + match self.current_fn().readable_name().as_str() { + //thread 'rustc' panicked at + //'Expected fat pointer, got + // Pointer { typ: StructTag("tag-fmt::Opaque") } + //in function fmt::ArgumentV1::<'a>::as_usize', + // compiler/rustc_codegen_llvm/src/gotoc/place.rs:96:13 + "fmt::ArgumentV1::<'a>::as_usize" => true, + // https://doc.rust-lang.org/std/intrinsics/fn.caller_location.html + "panic::Location::<'a>::caller" => true, + // thread 'rustc' panicked at 'Can't cast + // Expr { value: Symbol { identifier: "_ZN54_$LT$dyn$u20$core..any..Any$u2b$core..marker..Send$GT$12downcast_ref17hfd95d38a01cb23d4E::1::var_3" }, typ: StructTag("tag-dyn core::any::Any + core::marker::Send"), location: None } + // Pointer { typ: Empty }', compiler/rustc_codegen_llvm/src/gotoc/cbmc/goto_program/expr.rs:408:9 + "<(dyn core::any::Any + core::marker::Send + 'static)>::downcast_ref" => true, + _ => false, + } + } + pub fn codegen_function(&mut self, instance: Instance<'tcx>) { self.set_current_fn(instance); let name = self.current_fn().name(); let old_sym = self.symbol_table.lookup(&name).unwrap(); + dbg!(&old_sym.pretty_name); assert!(old_sym.is_function()); if old_sym.is_function_definition() { warn!("Double codegen of {:?}", old_sym); + } else if self.should_skip_current_fn() { + dbg!("skipping"); + let loc = self.codegen_span2(&self.current_fn().mir().span); + let body = Stmt::assert_false( + &format! {"The function {} is not curently supported by RMC", self.current_fn().readable_name()}, + loc, + ); + self.symbol_table.update_fn_declaration_with_definition(&name, body); } else { let mir = self.current_fn().mir(); self.print_instance(instance, mir); @@ -170,7 +197,7 @@ impl<'tcx> GotocCtx<'tcx> { fname, ctx.fn_typ(), None, - Some(ctx.readable_instance_name(instance)), + Some(ctx.current_fn().readable_name()), ctx.codegen_span2(&mir.span), ) }); @@ -268,8 +295,8 @@ impl CodegenBackend for GotocCodegenBackend { MonoItem::Fn(instance) => c.declare_function(instance), MonoItem::Static(def_id) => c.declare_static(def_id, item), MonoItem::GlobalAsm(_) => { - tcx.sess.err("does not support assembly code"); - tcx.sess.abort_if_errors() + // tcx.sess.err("does not support assembly code"); + // tcx.sess.abort_if_errors() } } } @@ -282,7 +309,7 @@ impl CodegenBackend for GotocCodegenBackend { match item { MonoItem::Fn(instance) => c.codegen_function(instance), MonoItem::Static(def_id) => c.codegen_static(def_id, item), - MonoItem::GlobalAsm(_) => unreachable!(), // we have aborted above + MonoItem::GlobalAsm(_) => {} //unreachable!(), // we have aborted above } } } diff --git a/compiler/rustc_codegen_llvm/src/gotoc/place.rs b/compiler/rustc_codegen_llvm/src/gotoc/place.rs index a0768f0c489a..5a2c028e53c1 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/place.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/place.rs @@ -93,7 +93,12 @@ impl<'tcx> ProjectedPlace<'tcx> { let mir_typ_or_variant = mir_typ_or_variant.monomorphize(ctx); let fat_ptr_mir_typ = fat_ptr_mir_typ.map(|t| ctx.monomorphize(t)); if let Some(fat_ptr) = &fat_ptr_goto_expr { - assert!(fat_ptr.typ().is_rust_fat_ptr(&ctx.symbol_table)); + assert!( + fat_ptr.typ().is_rust_fat_ptr(&ctx.symbol_table), + "Expected fat pointer, got {:?} in function {}", + fat_ptr.typ(), + ctx.current_fn().readable_name() + ); } // TODO: these assertions fail on a few regressions. Figure out why. // I think it may have to do with boxed fat pointers. diff --git a/compiler/rustc_codegen_llvm/src/gotoc/typ.rs b/compiler/rustc_codegen_llvm/src/gotoc/typ.rs index 1f4d8df8c3ff..01fd7bcd10a5 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/typ.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/typ.rs @@ -486,7 +486,9 @@ impl<'tcx> GotocCtx<'tcx> { final_fields } - _ => unreachable!(), + // Primitives, such as NEVER, have no fields + FieldsShape::Primitive => vec![], + _ => unreachable!("{}\n{:?}", self.current_fn().readable_name(), layout.fields), } } @@ -579,11 +581,15 @@ impl<'tcx> GotocCtx<'tcx> { // TODO, determine if this is the right course of action ty::FnDef(_, _) | ty::Never => self.codegen_ty(pointee_type).to_pointer(), + // These types were blocking stdlib. Doing the default thing to unblock. + // TODO, determine if this is the right course of action + ty::FnPtr(_) => self.codegen_ty(pointee_type).to_pointer(), + // These types have no regression tests for them. // For soundess, hold off on generating them till we have test-cases. ty::Bound(_, _) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), ty::Error(_) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), - ty::FnPtr(_) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), + //ty::FnPtr(_) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), ty::Generator(_, _, _) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), ty::GeneratorWitness(_) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), ty::Infer(_) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), diff --git a/compiler/rustc_codegen_llvm/src/gotoc/utils.rs b/compiler/rustc_codegen_llvm/src/gotoc/utils.rs index 215a910fcd09..ded9cc97385d 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/utils.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/utils.rs @@ -88,7 +88,12 @@ impl<'tcx> GotocCtx<'tcx> { assert!(e.typ().is_rust_box(), "expected rust box {:?}", e); let unique_ptr_typ = self.symbol_table.lookup_field_type_in_type(e.typ(), "0").unwrap().clone(); - assert!(unique_ptr_typ.is_rust_unique_pointer()); + assert!( + unique_ptr_typ.is_rust_unique_pointer(), + "{:?}\n\t{}", + unique_ptr_typ, + self.current_fn().readable_name() + ); e.member("0", &self.symbol_table).member("pointer", &self.symbol_table) } @@ -133,7 +138,9 @@ impl Type { /// Checks if the struct represents a Rust "Unique" pub fn is_rust_unique_pointer(&self) -> bool { self.type_name().map_or(false, |name| { - name.starts_with("tag-std::ptr::Unique") || name.starts_with("tag-core::ptr::Unique") + name.starts_with("tag-std::ptr::Unique") + || name.starts_with("tag-core::ptr::Unique") + || name.starts_with("tag-rustc_std_workspace_core::ptr::Unique") }) } From 32190f037a565c027295c59984d1ebd762a28577 Mon Sep 17 00:00:00 2001 From: Daniel Schwartz-Narbonne Date: Tue, 15 Jun 2021 23:37:35 -0400 Subject: [PATCH 2/5] more functions that don't work --- .../rustc_codegen_llvm/src/gotoc/intrinsic.rs | 6 ++++- compiler/rustc_codegen_llvm/src/gotoc/mod.rs | 27 ++++++++++--------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs b/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs index 3d0f47f35fbe..d2085a8b89c7 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs @@ -428,7 +428,11 @@ impl<'tcx> GotocCtx<'tcx> { "prefetch_read_instruction" => unimplemented!(), "prefetch_write_data" => unimplemented!(), "prefetch_write_instruction" => unimplemented!(), - "try" => unimplemented!(), + "try" => unimplemented!( + "unsupported intrinsic: {}\n\tin function {}", + intrinsic, + self.current_fn().readable_name() + ), "unaligned_volatile_store" => unimplemented!(), "va_arg" => unimplemented!(), "va_copy" => unimplemented!(), diff --git a/compiler/rustc_codegen_llvm/src/gotoc/mod.rs b/compiler/rustc_codegen_llvm/src/gotoc/mod.rs index 95d0ea208ce6..a11dede452d8 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/mod.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/mod.rs @@ -99,18 +99,22 @@ impl<'tcx> GotocCtx<'tcx> { fn should_skip_current_fn(&self) -> bool { match self.current_fn().readable_name().as_str() { - //thread 'rustc' panicked at - //'Expected fat pointer, got - // Pointer { typ: StructTag("tag-fmt::Opaque") } - //in function fmt::ArgumentV1::<'a>::as_usize', - // compiler/rustc_codegen_llvm/src/gotoc/place.rs:96:13 + // https://github.com/model-checking/rmc/issues/202 "fmt::ArgumentV1::<'a>::as_usize" => true, - // https://doc.rust-lang.org/std/intrinsics/fn.caller_location.html - "panic::Location::<'a>::caller" => true, - // thread 'rustc' panicked at 'Can't cast - // Expr { value: Symbol { identifier: "_ZN54_$LT$dyn$u20$core..any..Any$u2b$core..marker..Send$GT$12downcast_ref17hfd95d38a01cb23d4E::1::var_3" }, typ: StructTag("tag-dyn core::any::Any + core::marker::Send"), location: None } - // Pointer { typ: Empty }', compiler/rustc_codegen_llvm/src/gotoc/cbmc/goto_program/expr.rs:408:9 + // https://github.com/model-checking/rmc/issues/203 "<(dyn core::any::Any + core::marker::Send + 'static)>::downcast_ref" => true, + // https://github.com/model-checking/rmc/issues/204 + "sys_common::thread_info::THREAD_INFO::__getit" => true, + // https://github.com/model-checking/rmc/issues/205 + "panic::Location::<'a>::caller" => true, + // https://github.com/model-checking/rmc/issues/206 + "core::sync::atomic::atomic_swap" => true, + // https://github.com/model-checking/rmc/issues/207 + "core::slice::::split_first" => true, + // https://github.com/model-checking/rmc/issues/208 + "panicking::take_hook" => true, + // https://github.com/model-checking/rmc/issues/209 + "panicking::r#try" => true, _ => false, } } @@ -119,12 +123,11 @@ impl<'tcx> GotocCtx<'tcx> { self.set_current_fn(instance); let name = self.current_fn().name(); let old_sym = self.symbol_table.lookup(&name).unwrap(); - dbg!(&old_sym.pretty_name); assert!(old_sym.is_function()); if old_sym.is_function_definition() { warn!("Double codegen of {:?}", old_sym); } else if self.should_skip_current_fn() { - dbg!("skipping"); + debug!("Skipping function {}", self.current_fn().readable_name()); let loc = self.codegen_span2(&self.current_fn().mir().span); let body = Stmt::assert_false( &format! {"The function {} is not curently supported by RMC", self.current_fn().readable_name()}, From b46e22c23cdb0c3c6d5bb710a770d36b2b087aaa Mon Sep 17 00:00:00 2001 From: Daniel Schwartz-Narbonne Date: Tue, 15 Jun 2021 23:49:49 -0400 Subject: [PATCH 3/5] don't bother printing info we don't need --- compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs b/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs index d2085a8b89c7..3d0f47f35fbe 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/intrinsic.rs @@ -428,11 +428,7 @@ impl<'tcx> GotocCtx<'tcx> { "prefetch_read_instruction" => unimplemented!(), "prefetch_write_data" => unimplemented!(), "prefetch_write_instruction" => unimplemented!(), - "try" => unimplemented!( - "unsupported intrinsic: {}\n\tin function {}", - intrinsic, - self.current_fn().readable_name() - ), + "try" => unimplemented!(), "unaligned_volatile_store" => unimplemented!(), "va_arg" => unimplemented!(), "va_copy" => unimplemented!(), From b7f53d38578f57340556942f6de1bc7768d1a8e5 Mon Sep 17 00:00:00 2001 From: Daniel Schwartz-Narbonne Date: Wed, 16 Jun 2021 14:10:43 -0400 Subject: [PATCH 4/5] PR comments --- .../src/gotoc/current_fn.rs | 6 ++---- .../rustc_codegen_llvm/src/gotoc/hooks.rs | 2 +- compiler/rustc_codegen_llvm/src/gotoc/mod.rs | 20 ++++++++++++------- compiler/rustc_codegen_llvm/src/gotoc/typ.rs | 6 +++--- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/gotoc/current_fn.rs b/compiler/rustc_codegen_llvm/src/gotoc/current_fn.rs index e21381014fad..e2aa91a59794 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/current_fn.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/current_fn.rs @@ -3,12 +3,10 @@ use crate::gotoc::GotocCtx; use crate::gotoc::Stmt; -use rustc_hir::def_id::DefId; use rustc_middle::mir::BasicBlock; use rustc_middle::mir::Body; use rustc_middle::ty::Instance; use rustc_middle::ty::PolyFnSig; -use rustc_middle::ty::TyCtxt; /// This structure represents useful data about the function we are currently compiling. pub struct CurrentFnCtx<'tcx> { @@ -108,8 +106,8 @@ impl CurrentFnCtx<'tcx> { } /// The pretty name of the function we are currently compiling - pub fn readable_name(&self) -> String { - self.readable_name.clone() + pub fn readable_name(&self) -> &str { + &self.readable_name } /// The signature of the function we are currently compiling diff --git a/compiler/rustc_codegen_llvm/src/gotoc/hooks.rs b/compiler/rustc_codegen_llvm/src/gotoc/hooks.rs index d3603f7c6a08..ac154a5be323 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/hooks.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/hooks.rs @@ -224,7 +224,7 @@ impl<'tcx> GotocHook<'tcx> for Intrinsic { span: Option, ) -> Stmt { let loc = tcx.codegen_span_option2(span); - if (tcx.symbol_name(instance) == "abort") { + if tcx.symbol_name(instance) == "abort" { Stmt::assert_false("abort intrinsic reached", loc) } else { let p = assign_to.unwrap(); diff --git a/compiler/rustc_codegen_llvm/src/gotoc/mod.rs b/compiler/rustc_codegen_llvm/src/gotoc/mod.rs index a11dede452d8..64b012d05810 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/mod.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/mod.rs @@ -98,13 +98,13 @@ impl<'tcx> GotocCtx<'tcx> { } fn should_skip_current_fn(&self) -> bool { - match self.current_fn().readable_name().as_str() { + match self.current_fn().readable_name() { // https://github.com/model-checking/rmc/issues/202 "fmt::ArgumentV1::<'a>::as_usize" => true, // https://github.com/model-checking/rmc/issues/203 "<(dyn core::any::Any + core::marker::Send + 'static)>::downcast_ref" => true, // https://github.com/model-checking/rmc/issues/204 - "sys_common::thread_info::THREAD_INFO::__getit" => true, + x if x.ends_with("__getit") => true, // https://github.com/model-checking/rmc/issues/205 "panic::Location::<'a>::caller" => true, // https://github.com/model-checking/rmc/issues/206 @@ -122,6 +122,7 @@ impl<'tcx> GotocCtx<'tcx> { pub fn codegen_function(&mut self, instance: Instance<'tcx>) { self.set_current_fn(instance); let name = self.current_fn().name(); + dbg!(self.current_fn().readable_name()); let old_sym = self.symbol_table.lookup(&name).unwrap(); assert!(old_sym.is_function()); if old_sym.is_function_definition() { @@ -130,7 +131,10 @@ impl<'tcx> GotocCtx<'tcx> { debug!("Skipping function {}", self.current_fn().readable_name()); let loc = self.codegen_span2(&self.current_fn().mir().span); let body = Stmt::assert_false( - &format! {"The function {} is not curently supported by RMC", self.current_fn().readable_name()}, + &format!( + "The function {} is not currently supported by RMC", + self.current_fn().readable_name() + ), loc, ); self.symbol_table.update_fn_declaration_with_definition(&name, body); @@ -200,7 +204,7 @@ impl<'tcx> GotocCtx<'tcx> { fname, ctx.fn_typ(), None, - Some(ctx.current_fn().readable_name()), + Some(ctx.current_fn().readable_name().to_string()), ctx.codegen_span2(&mir.span), ) }); @@ -298,8 +302,10 @@ impl CodegenBackend for GotocCodegenBackend { MonoItem::Fn(instance) => c.declare_function(instance), MonoItem::Static(def_id) => c.declare_static(def_id, item), MonoItem::GlobalAsm(_) => { - // tcx.sess.err("does not support assembly code"); - // tcx.sess.abort_if_errors() + warn!( + "Crate {} contains global ASM, which is not handled by RMC", + c.crate_name() + ); } } } @@ -312,7 +318,7 @@ impl CodegenBackend for GotocCodegenBackend { match item { MonoItem::Fn(instance) => c.codegen_function(instance), MonoItem::Static(def_id) => c.codegen_static(def_id, item), - MonoItem::GlobalAsm(_) => {} //unreachable!(), // we have aborted above + MonoItem::GlobalAsm(_) => {} // We have already warned above } } } diff --git a/compiler/rustc_codegen_llvm/src/gotoc/typ.rs b/compiler/rustc_codegen_llvm/src/gotoc/typ.rs index 01fd7bcd10a5..4c3a6c7307ed 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/typ.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/typ.rs @@ -578,18 +578,18 @@ impl<'tcx> GotocCtx<'tcx> { | ty::Uint(_) => self.codegen_ty(pointee_type).to_pointer(), // These types were blocking firecracker. Doing the default thing to unblock. - // TODO, determine if this is the right course of action + // https://github.com/model-checking/rmc/issues/215 + // https://github.com/model-checking/rmc/issues/216 ty::FnDef(_, _) | ty::Never => self.codegen_ty(pointee_type).to_pointer(), // These types were blocking stdlib. Doing the default thing to unblock. - // TODO, determine if this is the right course of action + // https://github.com/model-checking/rmc/issues/214 ty::FnPtr(_) => self.codegen_ty(pointee_type).to_pointer(), // These types have no regression tests for them. // For soundess, hold off on generating them till we have test-cases. ty::Bound(_, _) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), ty::Error(_) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), - //ty::FnPtr(_) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), ty::Generator(_, _, _) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), ty::GeneratorWitness(_) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), ty::Infer(_) => todo!("{:?} {:?}", pointee_type, pointee_type.kind()), From 54a904d2d9d88984f2c43b89d4c98fd7359efbcb Mon Sep 17 00:00:00 2001 From: Daniel Schwartz-Narbonne Date: Wed, 16 Jun 2021 16:23:19 -0400 Subject: [PATCH 5/5] remove extra dbg --- compiler/rustc_codegen_llvm/src/gotoc/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/rustc_codegen_llvm/src/gotoc/mod.rs b/compiler/rustc_codegen_llvm/src/gotoc/mod.rs index 64b012d05810..3ff391865e0b 100644 --- a/compiler/rustc_codegen_llvm/src/gotoc/mod.rs +++ b/compiler/rustc_codegen_llvm/src/gotoc/mod.rs @@ -122,7 +122,6 @@ impl<'tcx> GotocCtx<'tcx> { pub fn codegen_function(&mut self, instance: Instance<'tcx>) { self.set_current_fn(instance); let name = self.current_fn().name(); - dbg!(self.current_fn().readable_name()); let old_sym = self.symbol_table.lookup(&name).unwrap(); assert!(old_sym.is_function()); if old_sym.is_function_definition() {