From 242f2e3c7588574eb5f399dc4cde8f75d7e3e294 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 25 Jan 2020 16:24:15 +0100 Subject: [PATCH] Fix correctness of optimization --- src/abi/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/abi/mod.rs b/src/abi/mod.rs index 813a436ddf2..6d254abb2bf 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -363,7 +363,7 @@ pub fn codegen_fn_prelude(fx: &mut FunctionCx<'_, '_, impl Backend>, start_ebb: ParamEnv::reveal_all(), local_decl.source_info.span, ); - if local_decl.mutability == mir::Mutability::Not && internally_mutable { + if local_decl.mutability == mir::Mutability::Not && !internally_mutable { // We wont mutate this argument, so it is fine to borrow the backing storage // of this argument, to prevent a copy.