auto merge of #6530 : huonw/rust/deriving-deepclone, r=bstrie

This commit is contained in:
bors 2013-05-16 06:58:52 -07:00
commit 53196bb364
9 changed files with 95 additions and 19 deletions

View file

@ -8,11 +8,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving(Clone)]
#[deriving(Clone, DeepClone)]
enum E {
A,
B(()),
C
}
pub fn main() {}
pub fn main() {
let _ = A.clone();
let _ = B(()).deep_clone();
}

View file

@ -1,8 +1,21 @@
#[deriving(Clone)]
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving(Clone, DeepClone)]
enum E<T,U> {
A(T),
B(T,U),
C
}
fn main() {}
fn main() {
let _ = A::<int, int>(1i).clone();
let _ = B(1i, 1.234).deep_clone();
}

View file

@ -8,11 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving(Clone)]
#[deriving(Clone, DeepClone)]
struct S<T> {
foo: (),
bar: (),
baz: T,
}
pub fn main() {}
pub fn main() {
let _ = S { foo: (), bar: (), baz: 1i }.clone().deep_clone();
}

View file

@ -1,4 +1,16 @@
#[deriving(Clone)]
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving(Clone, DeepClone)]
struct S<T>(T, ());
fn main() {}
fn main() {
let _ = S(1i, ()).clone().deep_clone();
}

View file

@ -1,4 +1,14 @@
#[deriving(Clone)]
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[deriving(Clone, DeepClone)]
struct S {
_int: int,
_i8: i8,