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

Commit f2f7b69

Browse files
committed
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'
1 parent 0d90d3d commit f2f7b69

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

programs/bpf_loader/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ mod tests {
401401
);
402402

403403
// Case: Write bytes to an offset
404+
#[allow(unused_mut)]
404405
let mut keyed_accounts = vec![KeyedAccount::new(&program_key, true, &program_account)];
405406
keyed_accounts[0].account.borrow_mut().data = vec![0; 6];
406407
assert_eq!(
@@ -418,6 +419,7 @@ mod tests {
418419
);
419420

420421
// Case: Overflow
422+
#[allow(unused_mut)]
421423
let mut keyed_accounts = vec![KeyedAccount::new(&program_key, true, &program_account)];
422424
keyed_accounts[0].account.borrow_mut().data = vec![0; 5];
423425
assert_eq!(

runtime/src/message_processor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,6 +1354,7 @@ mod tests {
13541354
let not_owned_account = Account::new(84, 1, &Pubkey::new_rand());
13551355
let not_owned_preaccount = PreAccount::new(&not_owned_key, &not_owned_account, false, true);
13561356

1357+
#[allow(unused_mut)]
13571358
let mut accounts = vec![
13581359
Rc::new(RefCell::new(owned_account)),
13591360
Rc::new(RefCell::new(not_owned_account)),

0 commit comments

Comments
 (0)