From f2f7b69e6579adf45953609c9479147d316b6d95 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Thu, 9 Jul 2020 21:23:59 -0400 Subject: [PATCH] Add #[allow(unused_mut)] to fix compilation on latest nightly The current stable performs an unecessary mutable borrow of these variables, so we can't just remove the 'mut' --- programs/bpf_loader/src/lib.rs | 2 ++ runtime/src/message_processor.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/programs/bpf_loader/src/lib.rs b/programs/bpf_loader/src/lib.rs index 2213d04f39d2ef..41d48d0c02ce5d 100644 --- a/programs/bpf_loader/src/lib.rs +++ b/programs/bpf_loader/src/lib.rs @@ -401,6 +401,7 @@ mod tests { ); // Case: Write bytes to an offset + #[allow(unused_mut)] let mut keyed_accounts = vec![KeyedAccount::new(&program_key, true, &program_account)]; keyed_accounts[0].account.borrow_mut().data = vec![0; 6]; assert_eq!( @@ -418,6 +419,7 @@ mod tests { ); // Case: Overflow + #[allow(unused_mut)] let mut keyed_accounts = vec![KeyedAccount::new(&program_key, true, &program_account)]; keyed_accounts[0].account.borrow_mut().data = vec![0; 5]; assert_eq!( diff --git a/runtime/src/message_processor.rs b/runtime/src/message_processor.rs index 109143e69d73a3..57b250afeeae51 100644 --- a/runtime/src/message_processor.rs +++ b/runtime/src/message_processor.rs @@ -1354,6 +1354,7 @@ mod tests { let not_owned_account = Account::new(84, 1, &Pubkey::new_rand()); let not_owned_preaccount = PreAccount::new(¬_owned_key, ¬_owned_account, false, true); + #[allow(unused_mut)] let mut accounts = vec![ Rc::new(RefCell::new(owned_account)), Rc::new(RefCell::new(not_owned_account)),