Skip to content

Commit 5a5a2e6

Browse files
committed
---
yaml --- r: 226907 b: refs/heads/master c: 67c7fd7 h: refs/heads/master i: 226905: 3669f11 226903: cc322dc v: v3
1 parent 59495cf commit 5a5a2e6

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 9c0d2b246589d7329d78e93afc04d270278e6ada
2+
refs/heads/master: 67c7fd710be56cf3ba5ca03b7291add856e73a8d
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/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)