From 0c13565ca66d25d15ee9146919dd74e57cdfda89 Mon Sep 17 00:00:00 2001 From: lcnr Date: Wed, 20 Jul 2022 14:32:58 +0200 Subject: Add a builtin `FnPtr` trait --- compiler/rustc_mir_transform/src/inline/cycle.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/rustc_mir_transform/src/inline') diff --git a/compiler/rustc_mir_transform/src/inline/cycle.rs b/compiler/rustc_mir_transform/src/inline/cycle.rs index 792457c80b0..faf404c7771 100644 --- a/compiler/rustc_mir_transform/src/inline/cycle.rs +++ b/compiler/rustc_mir_transform/src/inline/cycle.rs @@ -84,6 +84,9 @@ pub(crate) fn mir_callgraph_reachable<'tcx>( | InstanceDef::FnPtrShim(..) | InstanceDef::ClosureOnceShim { .. } | InstanceDef::CloneShim(..) => {} + + // This shim does not call any other functions, thus there can be no recursion. + InstanceDef::FnPtrAddrShim(..) => continue, InstanceDef::DropGlue(..) => { // FIXME: A not fully substituted drop shim can cause ICEs if one attempts to // have its MIR built. Likely oli-obk just screwed up the `ParamEnv`s, so this -- cgit 1.4.1-3-g733a5