Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Add #[allow(unused_mut)] to fix compilation on latest nightly
Browse files Browse the repository at this point in the history
The current stable performs an unecessary mutable borrow of these
variables, so we can't just remove the 'mut'
  • Loading branch information
Aaron1011 committed Jul 10, 2020
1 parent 0d90d3d commit f2f7b69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions programs/bpf_loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand All @@ -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!(
Expand Down
1 change: 1 addition & 0 deletions runtime/src/message_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,7 @@ mod tests {
let not_owned_account = Account::new(84, 1, &Pubkey::new_rand());
let not_owned_preaccount = PreAccount::new(&not_owned_key, &not_owned_account, false, true);

#[allow(unused_mut)]
let mut accounts = vec![
Rc::new(RefCell::new(owned_account)),
Rc::new(RefCell::new(not_owned_account)),
Expand Down

0 comments on commit f2f7b69

Please sign in to comment.