program-examples icon indicating copy to clipboard operation
program-examples copied to clipboard

cannot index into a value of type `&mut Rc<RefCell<&mut [u8]>>`

Open 0xzrf opened this issue 1 year ago • 3 comments

Getting this error in the account_data native example

when I write address_info.serialize(&mut &mut address_info_account.data.borrow_mut()[..])?; in the create.rs file in the instructions folder image This is the error that I get, while the same doesn't happen in the actual repository

Would appreciate help

0xzrf avatar Oct 20 '24 14:10 0xzrf

@krishhh16

Hamissou227 avatar Oct 20 '24 23:10 Hamissou227

Get the same error! Following the discussion.

FlavioAcri avatar Oct 20 '24 23:10 FlavioAcri

Works with rustc 1.78.0 (9b00956e5 2024-04-29)

Would help to provide diagnostics like rust and solana version

heyAyushh avatar Oct 21 '24 17:10 heyAyushh

Verified that it works fine with rustc 1.75.0 (82e1608df 2023-12-21) (requirement for solana-program v1.18.17)

thsioutas avatar Nov 14 '24 09:11 thsioutas