diff --git a/src/librustc_borrowck/diagnostics.rs b/src/librustc_borrowck/diagnostics.rs index b641dfd7d40..78a8ab9cee0 100644 --- a/src/librustc_borrowck/diagnostics.rs +++ b/src/librustc_borrowck/diagnostics.rs @@ -138,8 +138,10 @@ interior mutability through a shared reference. Our example's `mutable` function could be redefined as below: ``` +use std::cell::Cell; + fn mutable() { - let x = std::cell::Cell::new(0u32); + let x = Cell::new(0u32); foo(|| x.set(2)); } ```