rust-lang/rust — pull request #18963 by pcwalton (2014-11-14 23:19:04+00:00)
Title: librustc: Forbid partial reinitialization of uninitialized structures or

enumerations that implement the `Drop` trait.

This breaks code like:

struct Struct {
f: String,
g: String,
}

impl Drop for Struct { ... }

fn main() {
let x = Struct { ... };
drop(x);
x.f = ...;
}

Change this code to not create partially-initialized structures. For
example:

struct Struct {
f: String,
g: String,
}

impl Drop for Struct { ... }

fn main() {
let x = Struct { ... };
drop(x);
x = Struct {
f: ...,
g: ...,
}
}

Closes #18571.

[breaking-change]

I suspect I may have missed some cases that I should have checked.

r? @nikomatsakis