Closed
Description
When running the program at: https://is.gd/XHVVMt on my Chromebook (an Asus C201p) with the latest nightly compiler, I get the following error (RUST_BACKTRACE=1):
thread 'main' panicked at 'already borrowed: BorrowMutError', /checkout/src/libcore/result.rs:860
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
0: <core::result::Result<T, E>>::expect
at /checkout/src/libcore/result.rs:761
1: <core::cell::RefCell<T>>::borrow_mut
at /checkout/src/libcore/cell.rs:740
2: cell_test::main
at ./src/main.rs:9
This doesn't occur on the latest stable compiler, and started sometime around March 12. This doesn't happen on my AMD 64bit desktop, nor on playground. Both debug and release builds are affected.
Code:
use std::cell::RefCell;
fn main() {
let m = RefCell::new(5);
{
m.borrow_mut();
}
{
m.borrow_mut();
}
}
(note the extra scopes don't affect the behaviour.)