We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a88fb4a commit 69cba8cCopy full SHA for 69cba8c
compiler/rustc_error_codes/src/error_codes/E0504.md
@@ -7,20 +7,20 @@ Erroneous code example:
7
8
```compile_fail
9
struct FancyNum {
10
- num: u8,
+ s: String,
11
}
12
13
fn main() {
14
- let fancy_num = FancyNum { num: 5 };
+ let fancy_num = FancyNum { s: "".into() };
15
let fancy_ref = &fancy_num;
16
17
let x = move || {
18
- println!("child function: {}", fancy_num.num);
+ println!("child function: {}", fancy_num.s);
19
// error: cannot move `fancy_num` into closure because it is borrowed
20
};
21
22
x();
23
- println!("main function: {}", fancy_ref.num);
+ println!("main function: {}", fancy_ref.s);
24
25
```
26
0 commit comments