summaryrefslogtreecommitdiff
path: root/tests/ui/kindck/kindck-impl-type-params.stderr
blob: efb25bf83e1df7bafc7620def16b0706134d9bf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
error[E0277]: `T` cannot be sent between threads safely
  --> $DIR/kindck-impl-type-params.rs:16:13
   |
LL |     let a = &t as &dyn Gettable<T>;
   |             ^^ `T` cannot be sent between threads safely
   |
note: required for `S<T>` to implement `Gettable<T>`
  --> $DIR/kindck-impl-type-params.rs:12:32
   |
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
   |         ----                   ^^^^^^^^^^^     ^^^^
   |         |
   |         unsatisfied trait bound introduced here
   = note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
   |
LL | fn f<T: std::marker::Send>(val: T) {
   |       +++++++++++++++++++

error[E0277]: the trait bound `T: Copy` is not satisfied
  --> $DIR/kindck-impl-type-params.rs:16:13
   |
LL |     let a = &t as &dyn Gettable<T>;
   |             ^^ the trait `Copy` is not implemented for `T`
   |
note: required for `S<T>` to implement `Gettable<T>`
  --> $DIR/kindck-impl-type-params.rs:12:32
   |
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
   |                ----            ^^^^^^^^^^^     ^^^^
   |                |
   |                unsatisfied trait bound introduced here
   = note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
   |
LL | fn f<T: std::marker::Copy>(val: T) {
   |       +++++++++++++++++++

error[E0277]: `T` cannot be sent between threads safely
  --> $DIR/kindck-impl-type-params.rs:23:31
   |
LL |     let a: &dyn Gettable<T> = &t;
   |                               ^^ `T` cannot be sent between threads safely
   |
note: required for `S<T>` to implement `Gettable<T>`
  --> $DIR/kindck-impl-type-params.rs:12:32
   |
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
   |         ----                   ^^^^^^^^^^^     ^^^^
   |         |
   |         unsatisfied trait bound introduced here
   = note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
   |
LL | fn g<T: std::marker::Send>(val: T) {
   |       +++++++++++++++++++

error[E0277]: the trait bound `T: Copy` is not satisfied
  --> $DIR/kindck-impl-type-params.rs:23:31
   |
LL |     let a: &dyn Gettable<T> = &t;
   |                               ^^ the trait `Copy` is not implemented for `T`
   |
note: required for `S<T>` to implement `Gettable<T>`
  --> $DIR/kindck-impl-type-params.rs:12:32
   |
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
   |                ----            ^^^^^^^^^^^     ^^^^
   |                |
   |                unsatisfied trait bound introduced here
   = note: required for the cast from `S<T>` to the object type `dyn Gettable<T>`
help: consider restricting type parameter `T`
   |
LL | fn g<T: std::marker::Copy>(val: T) {
   |       +++++++++++++++++++

error[E0277]: the trait bound `String: Copy` is not satisfied
  --> $DIR/kindck-impl-type-params.rs:35:13
   |
LL |     let a = t as Box<dyn Gettable<String>>;
   |             ^ the trait `Copy` is not implemented for `String`
   |
   = help: the trait `Gettable<T>` is implemented for `S<T>`
note: required for `S<String>` to implement `Gettable<String>`
  --> $DIR/kindck-impl-type-params.rs:12:32
   |
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
   |                ----            ^^^^^^^^^^^     ^^^^
   |                |
   |                unsatisfied trait bound introduced here
   = note: required for the cast from `S<String>` to the object type `dyn Gettable<String>`

error[E0277]: the trait bound `Foo: Copy` is not satisfied
  --> $DIR/kindck-impl-type-params.rs:43:37
   |
LL |     let a: Box<dyn Gettable<Foo>> = t;
   |                                     ^ the trait `Copy` is not implemented for `Foo`
   |
   = help: the trait `Gettable<T>` is implemented for `S<T>`
note: required for `S<Foo>` to implement `Gettable<Foo>`
  --> $DIR/kindck-impl-type-params.rs:12:32
   |
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
   |                ----            ^^^^^^^^^^^     ^^^^
   |                |
   |                unsatisfied trait bound introduced here
   = note: required for the cast from `S<Foo>` to the object type `dyn Gettable<Foo>`
help: consider annotating `Foo` with `#[derive(Copy)]`
   |
LL +     #[derive(Copy)]
LL |     struct Foo; // does not impl Copy
   |

error: aborting due to 6 previous errors

For more information about this error, try `rustc --explain E0277`.