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