diff --git a/src/dynamic.rs b/src/dynamic.rs index e054aa8a..193280a7 100644 --- a/src/dynamic.rs +++ b/src/dynamic.rs @@ -944,6 +944,7 @@ impl Dynamic { pub fn try_cast(self) -> Option { // Coded this way in order to maximally leverage potentials for dead-code removal. + #[cfg(not(feature = "no_closure"))] if let Union::Shared(_, _) = self.0 { return self.flatten().try_cast::(); }