We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It's not really a bug, but I can't do this synchronization. There is currently something that I did not understand in the functioning of rust
I tried to replace init() with:
init()
use core::borrow::BorrowMut; use core::ops::DerefMut; use cortex_m::interrupt::Mutex; use linked_list_allocator::Heap; // ... pub struct CortexMHeap { heap: Mutex<Heap>, } // ... pub unsafe fn init(&self, start_addr: usize, size: usize) { cortex_m::interrupt::free(|cs| { self.heap .borrow(cs) .borrow_mut() .deref_mut() .init(start_addr, size); }); } }
but answer is:
error[E0596]: cannot borrow data in a `&` reference as mutable --> src/lib.rs:103:17 | 103 | / self.heap 104 | | .borrow(cs) 105 | | .borrow_mut() 106 | | .deref_mut() | |________________________________^ cannot borrow as mutable
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It's not really a bug, but I can't do this synchronization. There is currently something that I did not understand in the functioning of rust
I tried to replace
init()
with:but answer is:
The text was updated successfully, but these errors were encountered: