rust-lang/rust — pull request #17864 by pcwalton (2014-10-08 00:55:08+00:00)
Title: librustc: Make `Copy` opt-in.

This change makes the compiler no longer infer whether types (structures
and enumerations) implement the `Copy` trait (and thus are implicitly
copyable). Rather, you must implement `Copy` yourself via `impl Copy for
MyType {}`.

This breaks code like:

#[deriving(Show)]
struct Point2D {
x: int,
y: int,
}

fn main() {
let mypoint = Point2D {
x: 1,
y: 1,
};
let otherpoint = mypoint;
println!("{}{}", mypoint, otherpoint);
}

Change this code to:

#[deriving(Show)]
struct Point2D {
x: int,
y: int,
}

impl Copy for Point2D {}

fn main() {
let mypoint = Point2D {
x: 1,
y: 1,
};
let otherpoint = mypoint;
println!("{}{}", mypoint, otherpoint);
}

This is the backwards-incompatible part of #13231.

Part of RFC #3.

[breaking-change]

r? @nikomatsakis