]> git.lizzy.rs Git - rust.git/commitdiff
Improve interior mutability example for E0386.
authorNathan Kleyn <nathan@nathankleyn.com>
Thu, 13 Aug 2015 09:17:18 +0000 (10:17 +0100)
committerNathan Kleyn <nathan@nathankleyn.com>
Thu, 13 Aug 2015 09:17:56 +0000 (10:17 +0100)
src/librustc_borrowck/diagnostics.rs

index 0d0456cfb42cc9332f4be8c797ebac698aa0cf4e..d7762896debd73716a763612dda2f8872a227765 100644 (file)
@@ -184,7 +184,8 @@ fn main(){
 `RefCell`:
 
 ```
-let y: Cell<_> = Cell::new(1);
+let x: i64 = 1;
+let y: Box<Cell<_>> = Box::new(Cell::new(x));
 y.set(2);
 ```
 "##,