mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-17 06:26:55 +00:00
Fallout in tests
This commit is contained in:
parent
c4edd0c8df
commit
890ed5c468
@ -23,7 +23,7 @@ mod src {
|
||||
pub mod hidden_core {
|
||||
use super::aliases::B;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct A;
|
||||
|
||||
pub fn make() -> B { A }
|
||||
|
@ -13,13 +13,13 @@
|
||||
|
||||
pub use private::P;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct S {
|
||||
p: P,
|
||||
}
|
||||
|
||||
mod private {
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct P {
|
||||
p: i32,
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ static mut COUNT: u64 = 1;
|
||||
|
||||
pub fn get_count() -> u64 { unsafe { COUNT } }
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Foo;
|
||||
|
||||
impl Foo {
|
||||
|
@ -17,7 +17,7 @@ static mut COUNT: u64 = 1;
|
||||
|
||||
pub fn get_count() -> u64 { unsafe { COUNT } }
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Foo;
|
||||
|
||||
impl Foo {
|
||||
|
@ -11,7 +11,7 @@
|
||||
#![crate_name="struct_variant_xc_aux"]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum Enum {
|
||||
Variant(u8),
|
||||
StructVariant { arg: u8 }
|
||||
|
@ -12,26 +12,26 @@
|
||||
|
||||
// used by the rpass test
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Struct;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum Unit {
|
||||
UnitVariant,
|
||||
Argument(Struct)
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct TupleStruct(pub usize, pub &'static str);
|
||||
|
||||
// used by the cfail test
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct StructWithFields {
|
||||
foo: isize,
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum EnumWithVariants {
|
||||
EnumVariant,
|
||||
EnumVariantArg(isize)
|
||||
|
@ -18,7 +18,7 @@ use std::f32::consts::PI;
|
||||
use std::num::Float;
|
||||
use std::rand::{Rng, StdRng};
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Vec2 {
|
||||
x: f32,
|
||||
y: f32,
|
||||
|
@ -54,7 +54,7 @@ fn print_complements() {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum Color {
|
||||
Red,
|
||||
Yellow,
|
||||
@ -72,7 +72,7 @@ impl fmt::Debug for Color {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct CreatureInfo {
|
||||
name: usize,
|
||||
color: Color
|
||||
|
@ -63,12 +63,12 @@ fn next_permutation(perm: &mut [i32], count: &mut [i32]) {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct P {
|
||||
p: [i32; 16],
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Perm {
|
||||
cnt: [i32; 16],
|
||||
fact: [u32; 16],
|
||||
|
@ -105,7 +105,7 @@ fn sum_and_scale(a: &'static [AminoAcid]) -> Vec<AminoAcid> {
|
||||
result
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct AminoAcid {
|
||||
c: u8,
|
||||
p: f32,
|
||||
|
@ -64,7 +64,7 @@ static OCCURRENCES: [&'static str;5] = [
|
||||
|
||||
// Code implementation
|
||||
|
||||
#[derive(Copy, PartialEq, PartialOrd, Ord, Eq)]
|
||||
#[derive(Copy, Clone, PartialEq, PartialOrd, Ord, Eq)]
|
||||
struct Code(u64);
|
||||
|
||||
impl Code {
|
||||
|
@ -96,7 +96,7 @@ static BODIES: [Planet;N_BODIES] = [
|
||||
},
|
||||
];
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Planet {
|
||||
x: f64, y: f64, z: f64,
|
||||
vx: f64, vy: f64, vz: f64,
|
||||
|
@ -9,13 +9,13 @@
|
||||
// except according to those terms.
|
||||
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Foo {
|
||||
bar1: Bar,
|
||||
bar2: Bar
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Bar {
|
||||
int1: isize,
|
||||
int2: isize,
|
||||
|
@ -8,13 +8,13 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Foo {
|
||||
bar1: Bar,
|
||||
bar2: Bar
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Bar {
|
||||
int1: isize,
|
||||
int2: isize,
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
use std::ops::Add;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Point {
|
||||
x: isize,
|
||||
y: isize,
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#![feature(box_syntax)]
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct A { a: isize, b: isize }
|
||||
|
||||
struct B { a: isize, b: Box<isize> }
|
||||
|
@ -22,7 +22,11 @@ struct NotSync;
|
||||
impl !Sync for NotSync {}
|
||||
|
||||
impl Copy for TestE {}
|
||||
impl Clone for TestE { fn clone(&self) -> Self { *self } }
|
||||
|
||||
impl Copy for MyType {}
|
||||
impl Clone for MyType { fn clone(&self) -> Self { *self } }
|
||||
|
||||
impl Copy for (MyType, MyType) {}
|
||||
//~^ ERROR E0206
|
||||
|
||||
@ -31,6 +35,8 @@ impl Copy for &'static NotSync {}
|
||||
|
||||
impl Copy for [MyType] {}
|
||||
//~^ ERROR E0206
|
||||
//~| ERROR E0277
|
||||
//~| ERROR E0277
|
||||
|
||||
impl Copy for &'static [NotSync] {}
|
||||
//~^ ERROR E0206
|
||||
|
@ -14,7 +14,7 @@
|
||||
use std::ops::Index;
|
||||
use std::fmt::Debug;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct S;
|
||||
|
||||
impl Index<usize> for S {
|
||||
@ -25,7 +25,7 @@ impl Index<usize> for S {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct T;
|
||||
|
||||
impl Index<usize> for T {
|
||||
|
@ -12,14 +12,14 @@
|
||||
|
||||
// issue #20126
|
||||
|
||||
#[derive(Copy)] //~ ERROR the trait `Copy` may not be implemented
|
||||
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
|
||||
struct Foo;
|
||||
|
||||
impl Drop for Foo {
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
#[derive(Copy)] //~ ERROR the trait `Copy` may not be implemented
|
||||
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
|
||||
struct Bar<T>(::std::marker::PhantomData<T>);
|
||||
|
||||
#[unsafe_destructor]
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
use std::simd::f32x4;
|
||||
|
||||
#[simd] #[derive(Copy)] #[repr(C)] struct LocalSimd(u8, u8);
|
||||
#[simd] #[derive(Copy, Clone)] #[repr(C)] struct LocalSimd(u8, u8);
|
||||
|
||||
extern {
|
||||
fn foo() -> f32x4; //~ ERROR use of SIMD type
|
||||
|
@ -13,7 +13,7 @@
|
||||
#![feature(simd)]
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
#[simd]
|
||||
pub struct f32x4(f32, f32, f32, f32);
|
||||
|
||||
|
@ -17,7 +17,7 @@ fn assert_copy<T:Copy>() { }
|
||||
|
||||
trait Dummy : MarkerTrait { }
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct MyStruct {
|
||||
x: isize,
|
||||
y: isize,
|
||||
|
@ -25,13 +25,13 @@ fn take_param<T:Foo>(foo: &T) { }
|
||||
|
||||
fn a() {
|
||||
let x: Box<_> = box 3;
|
||||
take_param(&x); //~ ERROR `core::marker::Copy` is not implemented
|
||||
take_param(&x); //~ ERROR E0277
|
||||
}
|
||||
|
||||
fn b() {
|
||||
let x: Box<_> = box 3;
|
||||
let y = &x;
|
||||
let z = &x as &Foo; //~ ERROR `core::marker::Copy` is not implemented
|
||||
let z = &x as &Foo; //~ ERROR E0038
|
||||
}
|
||||
|
||||
fn main() { }
|
||||
|
@ -16,6 +16,7 @@ struct IWantToCopyThis {
|
||||
|
||||
impl Copy for IWantToCopyThis {}
|
||||
//~^ ERROR the trait `Copy` may not be implemented for this type
|
||||
//~| ERROR E0277
|
||||
|
||||
enum CantCopyThisEither {
|
||||
A,
|
||||
@ -28,5 +29,6 @@ enum IWantToCopyThisToo {
|
||||
|
||||
impl Copy for IWantToCopyThisToo {}
|
||||
//~^ ERROR the trait `Copy` may not be implemented for this type
|
||||
//~| ERROR E0277
|
||||
|
||||
fn main() {}
|
||||
|
@ -20,7 +20,7 @@ mod bleh {
|
||||
)
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct S;
|
||||
|
||||
impl S {
|
||||
|
@ -105,21 +105,21 @@ use self::AutoDiscriminant::{One, Two, Three};
|
||||
use self::ManualDiscriminant::{OneHundred, OneThousand, OneMillion};
|
||||
use self::SingleVariant::TheOnlyVariant;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum AutoDiscriminant {
|
||||
One,
|
||||
Two,
|
||||
Three
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum ManualDiscriminant {
|
||||
OneHundred = 100,
|
||||
OneThousand = 1000,
|
||||
OneMillion = 1000000
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum SingleVariant {
|
||||
TheOnlyVariant
|
||||
}
|
||||
|
@ -114,7 +114,7 @@
|
||||
#![feature(box_syntax)]
|
||||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Struct<T> {
|
||||
x: T
|
||||
}
|
||||
|
@ -115,7 +115,7 @@
|
||||
#![feature(box_syntax)]
|
||||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum Enum {
|
||||
Variant1 { x: u16, y: u16 },
|
||||
Variant2 (u32)
|
||||
|
@ -115,7 +115,7 @@
|
||||
#![feature(box_syntax)]
|
||||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Struct<T> {
|
||||
x: T
|
||||
}
|
||||
|
@ -115,7 +115,7 @@
|
||||
#![feature(box_syntax)]
|
||||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Struct {
|
||||
x: isize
|
||||
}
|
||||
|
@ -115,7 +115,7 @@
|
||||
#![feature(box_syntax)]
|
||||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Struct {
|
||||
x: isize
|
||||
}
|
||||
|
@ -115,7 +115,7 @@
|
||||
#![feature(box_syntax)]
|
||||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct TupleStruct(isize, f64);
|
||||
|
||||
impl TupleStruct {
|
||||
|
@ -114,7 +114,7 @@
|
||||
#![feature(box_syntax)]
|
||||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Struct {
|
||||
x: isize
|
||||
}
|
||||
|
@ -114,7 +114,7 @@
|
||||
#![feature(box_syntax)]
|
||||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Struct {
|
||||
x: isize
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ fn test1() { let val = &0; { } *val; }
|
||||
|
||||
fn test2() -> isize { let val = &0; { } *val }
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct S { eax: isize }
|
||||
|
||||
fn test3() {
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
#[derive()]
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Foo;
|
||||
|
||||
pub fn main() { }
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
#[repr(packed)]
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
struct Foo {
|
||||
a: i8,
|
||||
b: i16,
|
||||
|
@ -179,7 +179,7 @@ enum SomeEnum<'a> {
|
||||
MyTypes(MyType, MyType)
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum SomeOtherEnum {
|
||||
SomeConst1,
|
||||
SomeConst2,
|
||||
|
@ -20,10 +20,10 @@ pub trait Offset {
|
||||
fn dummy(&self) { }
|
||||
}
|
||||
|
||||
#[derive(Copy)] pub struct X;
|
||||
#[derive(Copy, Clone)] pub struct X;
|
||||
impl Offset for X { type State = Y; }
|
||||
|
||||
#[derive(Copy)] pub struct Y;
|
||||
#[derive(Copy, Clone)] pub struct Y;
|
||||
impl OffsetState for Y {}
|
||||
|
||||
pub fn now() -> DateTime<X> { from_utc(Y) }
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
use std::ops::Mul;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Foo {
|
||||
x: f64,
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
use std::cell::Cell;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum newtype {
|
||||
newvar(isize)
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ use trait_superkinds_in_metadata::{RequiresRequiresShareAndSend, RequiresShare};
|
||||
use trait_superkinds_in_metadata::RequiresCopy;
|
||||
use std::marker;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct X<T>(T);
|
||||
|
||||
impl<T:Sync> RequiresShare for X<T> { }
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
use std::cmp;
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
enum cat_type { tuxedo, tabby, tortoiseshell }
|
||||
|
||||
impl cmp::PartialEq for cat_type {
|
||||
|
@ -11,7 +11,7 @@
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
pub fn main() {
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum x { foo }
|
||||
impl ::std::cmp::PartialEq for x {
|
||||
fn eq(&self, other: &x) -> bool {
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum Foo {
|
||||
Bar = 0xDEADBEE
|
||||
}
|
||||
|
@ -14,10 +14,9 @@
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
struct C { _x: u8 }
|
||||
|
||||
impl Copy for C { }
|
||||
|
||||
fn main() {
|
||||
fn d() -> C { C { _x: 0 } }
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Test;
|
||||
|
||||
pub fn main() {}
|
||||
|
@ -32,7 +32,7 @@ fn foo2<T:ToBar>(x: &Fat<[T]>) {
|
||||
assert!(x.ptr[1].to_bar() == bar);
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Eq)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
struct Bar;
|
||||
|
||||
trait ToBar {
|
||||
|
@ -51,7 +51,7 @@ fn foo3(x: &Fat<Fat<[isize]>>) {
|
||||
}
|
||||
|
||||
|
||||
#[derive(Copy, PartialEq, Eq)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
struct Bar;
|
||||
|
||||
trait ToBar {
|
||||
|
@ -19,10 +19,10 @@ struct Fat<T: ?Sized> {
|
||||
ptr: T
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Eq)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
struct Bar;
|
||||
|
||||
#[derive(Copy, PartialEq, Eq)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
struct Bar1 {
|
||||
f: isize
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
enum chan { chan_t, }
|
||||
|
||||
impl PartialEq for chan {
|
||||
|
@ -12,7 +12,7 @@ macro_rules! check {
|
||||
($m:ident, $t:ty, $v:expr) => {{
|
||||
mod $m {
|
||||
use std::mem::size_of;
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
enum E {
|
||||
V = $v,
|
||||
A = 0
|
||||
|
@ -13,7 +13,7 @@
|
||||
#![allow(unknown_features)]
|
||||
#![feature(box_syntax)]
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct LM { resize_at: usize, size: usize }
|
||||
|
||||
enum HashMap<K,V> {
|
||||
|
@ -15,7 +15,7 @@ fn f(arg: &mut A) {
|
||||
arg.a = 100;
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct A { a: isize }
|
||||
|
||||
pub fn main() {
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
// Tests for if as expressions returning nominal types
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct I { i: isize }
|
||||
|
||||
fn test_rec() {
|
||||
@ -22,7 +22,7 @@ fn test_rec() {
|
||||
assert_eq!(rs.i, 100);
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
enum mood { happy, sad, }
|
||||
|
||||
impl PartialEq for mood {
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
// Tests for match as expressions resulting in struct types
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct R { i: isize }
|
||||
|
||||
fn test_rec() {
|
||||
@ -21,7 +21,7 @@ fn test_rec() {
|
||||
assert_eq!(rs.i, 100);
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
enum mood { happy, sad, }
|
||||
|
||||
impl PartialEq for mood {
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
use std::cell::Cell;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Point {x: isize, y: isize, z: isize}
|
||||
|
||||
fn f(p: &Cell<Point>) {
|
||||
|
@ -11,7 +11,7 @@
|
||||
// Test a foreign function that accepts and returns a struct
|
||||
// by value.
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub struct TwoU16s {
|
||||
one: u16, two: u16
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
// Test a foreign function that accepts and returns a struct
|
||||
// by value.
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub struct TwoU32s {
|
||||
one: u32, two: u32
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
// Test a foreign function that accepts and returns a struct
|
||||
// by value.
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub struct TwoU64s {
|
||||
one: u64, two: u64
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
// Test a foreign function that accepts and returns a struct
|
||||
// by value.
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub struct TwoU8s {
|
||||
one: u8, two: u8
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct S {
|
||||
x: u64,
|
||||
y: u64,
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
fn id<T>(x: T) -> T { return x; }
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Triple {x: isize, y: isize, z: isize}
|
||||
|
||||
pub fn main() {
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum Q { R(Option<usize>) }
|
||||
|
||||
fn xyzzy(q: Q) -> usize {
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Pair { x: isize, y: isize }
|
||||
|
||||
pub fn main() {
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Foo<T> { x: T }
|
||||
|
||||
type Ty<'tcx> = &'tcx TyS<'tcx>;
|
||||
@ -31,7 +31,7 @@ enum TyS<'tcx> {
|
||||
Boop(PhantomData<*mut &'tcx ()>)
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum Bar<'tcx> {
|
||||
Baz(Foo<Ty<'tcx>>)
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ extern crate collections;
|
||||
|
||||
use std::collections::HashSet;
|
||||
|
||||
#[derive(Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
|
||||
struct XYZ {
|
||||
x: isize,
|
||||
y: isize,
|
||||
|
@ -24,7 +24,7 @@ impl Deref for Root {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct JSRef {
|
||||
node: *const Node
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum Foo {
|
||||
Bar,
|
||||
Baz
|
||||
|
@ -34,7 +34,7 @@ pub trait Strategy {
|
||||
}
|
||||
|
||||
/// The basic fully-recursive strategy. Nothing is pruned.
|
||||
#[derive(Copy, Default)]
|
||||
#[derive(Copy, Clone, Default)]
|
||||
pub struct Recursive;
|
||||
|
||||
impl Strategy for Recursive {
|
||||
|
@ -14,4 +14,8 @@
|
||||
#[derive(Copy)]
|
||||
struct Test(*const i32);
|
||||
|
||||
impl Clone for Test {
|
||||
fn clone(&self) -> Test { *self }
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -22,12 +22,14 @@ struct BufferHandle<R: Resources> {
|
||||
raw: <R as Resources>::Buffer,
|
||||
}
|
||||
impl<R: Resources> Copy for BufferHandle<R> {}
|
||||
impl<R: Resources> Clone for BufferHandle<R> {
|
||||
fn clone(&self) -> BufferHandle<R> { *self }
|
||||
}
|
||||
|
||||
enum Res {}
|
||||
impl Resources for Res {
|
||||
type Buffer = u32;
|
||||
}
|
||||
impl Copy for Res { }
|
||||
|
||||
fn main() {
|
||||
let b: BufferHandle<Res> = BufferHandle { raw: 1 };
|
||||
|
@ -17,7 +17,7 @@ trait clam<A> {
|
||||
fn chowder(&self, y: A);
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct foo<A> {
|
||||
x: A,
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
use std::intrinsics;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Wrap(i64);
|
||||
|
||||
// These volatile and atomic intrinsics used to cause an ICE
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct cat {
|
||||
meow: extern "Rust" fn(),
|
||||
}
|
||||
@ -23,7 +23,7 @@ fn cat() -> cat {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct KittyInfo {kitty: cat}
|
||||
|
||||
// Code compiles and runs successfully if we add a + before the first arg
|
||||
|
@ -13,11 +13,11 @@
|
||||
#![allow(unknown_features)]
|
||||
#![feature(box_syntax)]
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum side { mayo, catsup, vinegar }
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum order { hamburger, fries(side), shake }
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum meal { to_go(order), for_here(order) }
|
||||
|
||||
fn foo(m: Box<meal>, cond: bool) {
|
||||
|
@ -29,7 +29,7 @@ use std::iter::repeat;
|
||||
use std::slice;
|
||||
|
||||
// Represents a position on a canvas.
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Point {
|
||||
x: isize,
|
||||
y: isize,
|
||||
@ -37,13 +37,13 @@ struct Point {
|
||||
|
||||
// Represents an offset on a canvas. (This has the same structure as a Point.
|
||||
// but different semantics).
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Size {
|
||||
width: isize,
|
||||
height: isize,
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Rect {
|
||||
top_left: Point,
|
||||
size: Size,
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
use std::ops::Mul;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Vec2 {
|
||||
x: f64,
|
||||
y: f64
|
||||
|
@ -16,13 +16,13 @@
|
||||
|
||||
use std::f64;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Point {
|
||||
x: f64,
|
||||
y: f64
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum Shape {
|
||||
Circle(Point, f64),
|
||||
Rectangle(Point, Point)
|
||||
|
@ -17,7 +17,7 @@ with the representation of [isize; n] and [isize] somehow, or at least
|
||||
failed to typecheck correctly.
|
||||
*/
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct X { vec: &'static [isize] }
|
||||
|
||||
static V: &'static [X] = &[X { vec: &[1, 2, 3] }];
|
||||
|
@ -38,7 +38,7 @@ const VARIANT2_NORTH: EnumWithStructVariants = EnumWithStructVariants::Variant2
|
||||
dir: Direction::North };
|
||||
|
||||
pub mod glfw {
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct InputState(usize);
|
||||
|
||||
pub const RELEASE : InputState = InputState(0);
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
static mut COUNT: u64 = 1;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Foo;
|
||||
|
||||
trait Bar : Sized {
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
static mut COUNT: usize = 1;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Foo;
|
||||
|
||||
impl Foo {
|
||||
|
@ -18,7 +18,7 @@
|
||||
* and apply the wrong instance of the method `unwrap`.
|
||||
*/
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct S<T> { i:u8, t:T }
|
||||
|
||||
impl<T> S<T> {
|
||||
@ -27,10 +27,10 @@ impl<T> S<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
struct A((u32, u32));
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
struct B(u64);
|
||||
|
||||
pub fn main() {
|
||||
|
@ -16,7 +16,7 @@ trait MyTrait<T> {
|
||||
fn get(&self) -> T;
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct MyType {
|
||||
dummy: usize
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ impl<T> MyTrait<T> for T
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct MyType {
|
||||
dummy: usize
|
||||
}
|
||||
|
@ -8,10 +8,10 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct mytype(Mytype);
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Mytype {
|
||||
compute: fn(mytype) -> isize,
|
||||
val: isize,
|
||||
|
@ -13,7 +13,7 @@
|
||||
use std::cmp;
|
||||
use std::ops;
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
struct Point {
|
||||
x: isize,
|
||||
y: isize
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Foo {
|
||||
f1: isize,
|
||||
_f2: isize,
|
||||
|
@ -13,7 +13,7 @@
|
||||
use std::rc::Rc;
|
||||
use std::ops::Deref;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct DerefWrapper<X, Y> {
|
||||
x: X,
|
||||
y: Y
|
||||
@ -36,7 +36,7 @@ impl<X, Y> Deref for DerefWrapper<X, Y> {
|
||||
mod priv_test {
|
||||
use std::ops::Deref;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct DerefWrapperHideX<X, Y> {
|
||||
x: X,
|
||||
pub y: Y
|
||||
|
@ -13,7 +13,7 @@
|
||||
use std::mem;
|
||||
|
||||
#[repr(packed)]
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
struct Foo {
|
||||
bar: u8,
|
||||
baz: u64
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Point {x: isize, y: isize}
|
||||
|
||||
type rect = (Point, Point);
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Rect {x: isize, y: isize, w: isize, h: isize}
|
||||
|
||||
fn f(r: Rect, x: isize, y: isize, w: isize, h: isize) {
|
||||
|
@ -30,7 +30,7 @@ struct B {
|
||||
v6: Option<C>
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct C {
|
||||
f: isize
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ trait GetRef<'a> {
|
||||
fn get(&self) -> &'a isize;
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Box<'a> {
|
||||
t: &'a isize
|
||||
}
|
||||
|
@ -17,12 +17,11 @@ trait GetRef<'a, T> {
|
||||
fn get(&self) -> &'a T;
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
struct Box<'a, T:'a> {
|
||||
t: &'a T
|
||||
}
|
||||
|
||||
impl<'a,T:'a> Copy for Box<'a,T> {}
|
||||
|
||||
impl<'a,T:Clone> GetRef<'a,T> for Box<'a,T> {
|
||||
fn get(&self) -> &'a T {
|
||||
self.t
|
||||
|
@ -17,7 +17,7 @@ trait Get<T> {
|
||||
fn get(&self) -> T;
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Box<T> {
|
||||
t: T
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ use std::mem;
|
||||
|
||||
type Type<'tcx> = &'tcx TypeStructure<'tcx>;
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
enum TypeStructure<'tcx> {
|
||||
TypeInt,
|
||||
TypeFunction(Type<'tcx>, Type<'tcx>),
|
||||
@ -94,20 +94,20 @@ impl<'tcx,'ast> TypeContext<'tcx, 'ast> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
|
||||
struct NodeId {
|
||||
id: usize
|
||||
}
|
||||
|
||||
type Ast<'ast> = &'ast AstStructure<'ast>;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct AstStructure<'ast> {
|
||||
id: NodeId,
|
||||
kind: AstKind<'ast>
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum AstKind<'ast> {
|
||||
ExprInt,
|
||||
ExprVar(usize),
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Value {
|
||||
n: isize
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
use std::ops;
|
||||
|
||||
#[simd]
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct f32x4(f32, f32, f32, f32);
|
||||
|
||||
fn add<T: ops::Add<Output=T>>(lhs: T, rhs: T) -> T {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user