auto merge of #6530 : huonw/rust/deriving-deepclone, r=bstrie
This commit is contained in:
commit
53196bb364
9 changed files with 95 additions and 19 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue