Closed TethysSvensson closed 6 years ago
This function can be compiled and leaks a reference to the stack:
fn bad(cs: &bare_metal::CriticalSection) -> &u32 { let x = bare_metal::Mutex::new(42u32); x.borrow(cs) }
The solution is to change the type signature of borrow to:
borrow
pub fn borrow<'cs>(&'cs self, _cs: &'cs CriticalSection) -> &'cs T
This function can be compiled and leaks a reference to the stack:
The solution is to change the type signature of
borrow
to: