We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
&
let ref
1 parent c92fc8d commit d8cf9aaCopy full SHA for d8cf9aa
src/librustc_error_codes/error_codes/E0502.md
@@ -5,7 +5,7 @@ Erroneous code example:
5
```compile_fail,E0502
6
fn bar(x: &mut i32) {}
7
fn foo(a: &mut i32) {
8
- let ref y = a; // a is borrowed as immutable.
+ let y = &a; // a is borrowed as immutable.
9
bar(a); // error: cannot borrow `*a` as mutable because `a` is also borrowed
10
// as immutable
11
println!("{}", y);
@@ -19,7 +19,7 @@ variable before trying to access it mutably:
19
20
21
bar(a);
22
- let ref y = a; // ok!
+ let y = &a; // ok!
23
24
}
25
```
0 commit comments