Skip to content

Commit 1a3f3b9

Browse files
committed
---
yaml --- r: 233327 b: refs/heads/beta c: 67c7fd7 h: refs/heads/master i: 233325: c14bde0 233323: e1e4c7d 233319: 39fec2f 233311: 34c75dc v: v3
1 parent b757d9d commit 1a3f3b9

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 9c0d2b246589d7329d78e93afc04d270278e6ada
26+
refs/heads/beta: 67c7fd710be56cf3ba5ca03b7291add856e73a8d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_borrowck/diagnostics.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,23 +142,20 @@ E0383: r##"
142142
This error occurs when an attempt is made to partially reinitialize a
143143
structure that is currently uninitialized.
144144
145-
For example, this can happen when a transfer of ownership has taken place:
145+
For example, this can happen when a drop has taken place:
146146
147147
```
148-
let mut t = Test { a: 1, b: None};
149-
let mut u = Test { a: 2, b: Some(Box::new(t))}; // `t` is now uninitialized
150-
// because ownership has been
151-
// transferred
152-
t.b = Some(Box::new(u)); // error, partial reinitialization of uninitialized
153-
// structure `t`
148+
let mut x = Foo { a: 1 };
149+
drop(x); // `x` is now uninitialized
150+
x.a = 2; // error, partial reinitialization of uninitialized structure `t`
154151
```
155152
156153
This error can be fixed by fully reinitializing the structure in question:
157154
158155
```
159-
let mut t = Test { a: 1, b: None};
160-
let mut u = Test { a: 2, b: Some(Box::new(t))};
161-
t = Test { a: 1, b: Some(Box::new(u))};
156+
let mut x = Foo { a: 1 };
157+
drop(x);
158+
x = Foo { a: 2 };
162159
```
163160
"##,
164161

0 commit comments

Comments
 (0)