Skip to content

Commit 890ed5c

Browse files
committed
Fallout in tests
1 parent c4edd0c commit 890ed5c

File tree

108 files changed

+154
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+154
-142
lines changed

src/test/auxiliary/issue-14422.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mod src {
2323
pub mod hidden_core {
2424
use super::aliases::B;
2525

26-
#[derive(Copy)]
26+
#[derive(Copy, Clone)]
2727
pub struct A;
2828

2929
pub fn make() -> B { A }

src/test/auxiliary/issue13213aux.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313

1414
pub use private::P;
1515

16-
#[derive(Copy)]
16+
#[derive(Copy, Clone)]
1717
pub struct S {
1818
p: P,
1919
}
2020

2121
mod private {
22-
#[derive(Copy)]
22+
#[derive(Copy, Clone)]
2323
pub struct P {
2424
p: i32,
2525
}

src/test/auxiliary/method_self_arg1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static mut COUNT: u64 = 1;
1717

1818
pub fn get_count() -> u64 { unsafe { COUNT } }
1919

20-
#[derive(Copy)]
20+
#[derive(Copy, Clone)]
2121
pub struct Foo;
2222

2323
impl Foo {

src/test/auxiliary/method_self_arg2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static mut COUNT: u64 = 1;
1717

1818
pub fn get_count() -> u64 { unsafe { COUNT } }
1919

20-
#[derive(Copy)]
20+
#[derive(Copy, Clone)]
2121
pub struct Foo;
2222

2323
impl Foo {

src/test/auxiliary/struct_variant_xc_aux.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![crate_name="struct_variant_xc_aux"]
1212
#![crate_type = "lib"]
1313

14-
#[derive(Copy)]
14+
#[derive(Copy, Clone)]
1515
pub enum Enum {
1616
Variant(u8),
1717
StructVariant { arg: u8 }

src/test/auxiliary/xcrate_unit_struct.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,26 @@
1212

1313
// used by the rpass test
1414

15-
#[derive(Copy)]
15+
#[derive(Copy, Clone)]
1616
pub struct Struct;
1717

18-
#[derive(Copy)]
18+
#[derive(Copy, Clone)]
1919
pub enum Unit {
2020
UnitVariant,
2121
Argument(Struct)
2222
}
2323

24-
#[derive(Copy)]
24+
#[derive(Copy, Clone)]
2525
pub struct TupleStruct(pub usize, pub &'static str);
2626

2727
// used by the cfail test
2828

29-
#[derive(Copy)]
29+
#[derive(Copy, Clone)]
3030
pub struct StructWithFields {
3131
foo: isize,
3232
}
3333

34-
#[derive(Copy)]
34+
#[derive(Copy, Clone)]
3535
pub enum EnumWithVariants {
3636
EnumVariant,
3737
EnumVariantArg(isize)

src/test/bench/noise.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::f32::consts::PI;
1818
use std::num::Float;
1919
use std::rand::{Rng, StdRng};
2020

21-
#[derive(Copy)]
21+
#[derive(Copy, Clone)]
2222
struct Vec2 {
2323
x: f32,
2424
y: f32,

src/test/bench/shootout-chameneos-redux.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn print_complements() {
5454
}
5555
}
5656

57-
#[derive(Copy)]
57+
#[derive(Copy, Clone)]
5858
enum Color {
5959
Red,
6060
Yellow,
@@ -72,7 +72,7 @@ impl fmt::Debug for Color {
7272
}
7373
}
7474

75-
#[derive(Copy)]
75+
#[derive(Copy, Clone)]
7676
struct CreatureInfo {
7777
name: usize,
7878
color: Color

src/test/bench/shootout-fannkuch-redux.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ fn next_permutation(perm: &mut [i32], count: &mut [i32]) {
6363
}
6464
}
6565

66-
#[derive(Copy)]
66+
#[derive(Copy, Clone)]
6767
struct P {
6868
p: [i32; 16],
6969
}
7070

71-
#[derive(Copy)]
71+
#[derive(Copy, Clone)]
7272
struct Perm {
7373
cnt: [i32; 16],
7474
fact: [u32; 16],

src/test/bench/shootout-fasta-redux.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn sum_and_scale(a: &'static [AminoAcid]) -> Vec<AminoAcid> {
105105
result
106106
}
107107

108-
#[derive(Copy)]
108+
#[derive(Copy, Clone)]
109109
struct AminoAcid {
110110
c: u8,
111111
p: f32,

src/test/bench/shootout-k-nucleotide.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static OCCURRENCES: [&'static str;5] = [
6464

6565
// Code implementation
6666

67-
#[derive(Copy, PartialEq, PartialOrd, Ord, Eq)]
67+
#[derive(Copy, Clone, PartialEq, PartialOrd, Ord, Eq)]
6868
struct Code(u64);
6969

7070
impl Code {

src/test/bench/shootout-nbody.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static BODIES: [Planet;N_BODIES] = [
9696
},
9797
];
9898

99-
#[derive(Copy)]
99+
#[derive(Copy, Clone)]
100100
struct Planet {
101101
x: f64, y: f64, z: f64,
102102
vx: f64, vy: f64, vz: f64,

src/test/compile-fail/borrowck-borrow-from-owned-ptr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
// except according to those terms.
1010

1111

12-
#[derive(Copy)]
12+
#[derive(Copy, Clone)]
1313
struct Foo {
1414
bar1: Bar,
1515
bar2: Bar
1616
}
1717

18-
#[derive(Copy)]
18+
#[derive(Copy, Clone)]
1919
struct Bar {
2020
int1: isize,
2121
int2: isize,

src/test/compile-fail/borrowck-borrow-from-stack-variable.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[derive(Copy)]
11+
#[derive(Copy, Clone)]
1212
struct Foo {
1313
bar1: Bar,
1414
bar2: Bar
1515
}
1616

17-
#[derive(Copy)]
17+
#[derive(Copy, Clone)]
1818
struct Bar {
1919
int1: isize,
2020
int2: isize,

src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use std::ops::Add;
1212

13-
#[derive(Copy)]
13+
#[derive(Copy, Clone)]
1414
struct Point {
1515
x: isize,
1616
y: isize,

src/test/compile-fail/borrowck-use-mut-borrow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#![feature(box_syntax)]
1212

13-
#[derive(Copy)]
13+
#[derive(Copy, Clone)]
1414
struct A { a: isize, b: isize }
1515

1616
struct B { a: isize, b: Box<isize> }

src/test/compile-fail/coherence-impls-copy.rs

+6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ struct NotSync;
2222
impl !Sync for NotSync {}
2323

2424
impl Copy for TestE {}
25+
impl Clone for TestE { fn clone(&self) -> Self { *self } }
26+
2527
impl Copy for MyType {}
28+
impl Clone for MyType { fn clone(&self) -> Self { *self } }
29+
2630
impl Copy for (MyType, MyType) {}
2731
//~^ ERROR E0206
2832

@@ -31,6 +35,8 @@ impl Copy for &'static NotSync {}
3135

3236
impl Copy for [MyType] {}
3337
//~^ ERROR E0206
38+
//~| ERROR E0277
39+
//~| ERROR E0277
3440

3541
impl Copy for &'static [NotSync] {}
3642
//~^ ERROR E0206

src/test/compile-fail/dst-index.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use std::ops::Index;
1515
use std::fmt::Debug;
1616

17-
#[derive(Copy)]
17+
#[derive(Copy, Clone)]
1818
struct S;
1919

2020
impl Index<usize> for S {
@@ -25,7 +25,7 @@ impl Index<usize> for S {
2525
}
2626
}
2727

28-
#[derive(Copy)]
28+
#[derive(Copy, Clone)]
2929
struct T;
3030

3131
impl Index<usize> for T {

src/test/compile-fail/exclusive-drop-and-copy.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
// issue #20126
1414

15-
#[derive(Copy)] //~ ERROR the trait `Copy` may not be implemented
15+
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
1616
struct Foo;
1717

1818
impl Drop for Foo {
1919
fn drop(&mut self) {}
2020
}
2121

22-
#[derive(Copy)] //~ ERROR the trait `Copy` may not be implemented
22+
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
2323
struct Bar<T>(::std::marker::PhantomData<T>);
2424

2525
#[unsafe_destructor]

src/test/compile-fail/feature-gate-simd-ffi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use std::simd::f32x4;
1515

16-
#[simd] #[derive(Copy)] #[repr(C)] struct LocalSimd(u8, u8);
16+
#[simd] #[derive(Copy, Clone)] #[repr(C)] struct LocalSimd(u8, u8);
1717

1818
extern {
1919
fn foo() -> f32x4; //~ ERROR use of SIMD type

src/test/compile-fail/gated-simd-ffi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#![feature(simd)]
1414

1515
#[repr(C)]
16-
#[derive(Copy)]
16+
#[derive(Copy, Clone)]
1717
#[simd]
1818
pub struct f32x4(f32, f32, f32, f32);
1919

src/test/compile-fail/kindck-copy.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn assert_copy<T:Copy>() { }
1717

1818
trait Dummy : MarkerTrait { }
1919

20-
#[derive(Copy)]
20+
#[derive(Copy, Clone)]
2121
struct MyStruct {
2222
x: isize,
2323
y: isize,

src/test/compile-fail/kindck-inherited-copy-bound.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ fn take_param<T:Foo>(foo: &T) { }
2525

2626
fn a() {
2727
let x: Box<_> = box 3;
28-
take_param(&x); //~ ERROR `core::marker::Copy` is not implemented
28+
take_param(&x); //~ ERROR E0277
2929
}
3030

3131
fn b() {
3232
let x: Box<_> = box 3;
3333
let y = &x;
34-
let z = &x as &Foo; //~ ERROR `core::marker::Copy` is not implemented
34+
let z = &x as &Foo; //~ ERROR E0038
3535
}
3636

3737
fn main() { }

src/test/compile-fail/opt-in-copy.rs

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct IWantToCopyThis {
1616

1717
impl Copy for IWantToCopyThis {}
1818
//~^ ERROR the trait `Copy` may not be implemented for this type
19+
//~| ERROR E0277
1920

2021
enum CantCopyThisEither {
2122
A,
@@ -28,5 +29,6 @@ enum IWantToCopyThisToo {
2829

2930
impl Copy for IWantToCopyThisToo {}
3031
//~^ ERROR the trait `Copy` may not be implemented for this type
32+
//~| ERROR E0277
3133

3234
fn main() {}

src/test/compile-fail/pub-method-macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ mod bleh {
2020
)
2121
}
2222

23-
#[derive(Copy)]
23+
#[derive(Copy, Clone)]
2424
pub struct S;
2525

2626
impl S {

src/test/debuginfo/c-style-enum.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,21 @@ use self::AutoDiscriminant::{One, Two, Three};
105105
use self::ManualDiscriminant::{OneHundred, OneThousand, OneMillion};
106106
use self::SingleVariant::TheOnlyVariant;
107107

108-
#[derive(Copy)]
108+
#[derive(Copy, Clone)]
109109
enum AutoDiscriminant {
110110
One,
111111
Two,
112112
Three
113113
}
114114

115-
#[derive(Copy)]
115+
#[derive(Copy, Clone)]
116116
enum ManualDiscriminant {
117117
OneHundred = 100,
118118
OneThousand = 1000,
119119
OneMillion = 1000000
120120
}
121121

122-
#[derive(Copy)]
122+
#[derive(Copy, Clone)]
123123
enum SingleVariant {
124124
TheOnlyVariant
125125
}

src/test/debuginfo/generic-method-on-generic-struct.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
#![feature(box_syntax)]
115115
#![omit_gdb_pretty_printer_section]
116116

117-
#[derive(Copy)]
117+
#[derive(Copy, Clone)]
118118
struct Struct<T> {
119119
x: T
120120
}

src/test/debuginfo/method-on-enum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
#![feature(box_syntax)]
116116
#![omit_gdb_pretty_printer_section]
117117

118-
#[derive(Copy)]
118+
#[derive(Copy, Clone)]
119119
enum Enum {
120120
Variant1 { x: u16, y: u16 },
121121
Variant2 (u32)

src/test/debuginfo/method-on-generic-struct.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
#![feature(box_syntax)]
116116
#![omit_gdb_pretty_printer_section]
117117

118-
#[derive(Copy)]
118+
#[derive(Copy, Clone)]
119119
struct Struct<T> {
120120
x: T
121121
}

src/test/debuginfo/method-on-struct.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
#![feature(box_syntax)]
116116
#![omit_gdb_pretty_printer_section]
117117

118-
#[derive(Copy)]
118+
#[derive(Copy, Clone)]
119119
struct Struct {
120120
x: isize
121121
}

src/test/debuginfo/method-on-trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
#![feature(box_syntax)]
116116
#![omit_gdb_pretty_printer_section]
117117

118-
#[derive(Copy)]
118+
#[derive(Copy, Clone)]
119119
struct Struct {
120120
x: isize
121121
}

0 commit comments

Comments
 (0)