From 9b6f48fe052504a12dc51934cc9e9fd1f0b9f515 Mon Sep 17 00:00:00 2001 From: Evgenii Pashkin Date: Sun, 14 Apr 2019 22:21:46 +0300 Subject: [PATCH] Allow nullable trampolines with scope="call" --- src/codegen/function_body_chunk.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen/function_body_chunk.rs b/src/codegen/function_body_chunk.rs index 28f9d0b0a0..c17e0f53f8 100644 --- a/src/codegen/function_body_chunk.rs +++ b/src/codegen/function_body_chunk.rs @@ -480,7 +480,7 @@ impl Builder { format!("::<{}>", bounds_names) }; if !is_destroy { - if !trampoline.scope.is_call() && *trampoline.nullable { + if *trampoline.nullable { chunks.push(Chunk::Custom(format!("let {0} = if {0}_data.is_some() {{ Some({0}_func{1} as _) }} else {{ None }};", trampoline.name, bounds_str)));