summaryrefslogtreecommitdiffstats
path: root/src/test/ui/kindck/kindck-impl-type-params.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/kindck/kindck-impl-type-params.stderr')
-rw-r--r--src/test/ui/kindck/kindck-impl-type-params.stderr103
1 files changed, 103 insertions, 0 deletions
diff --git a/src/test/ui/kindck/kindck-impl-type-params.stderr b/src/test/ui/kindck/kindck-impl-type-params.stderr
new file mode 100644
index 000000000..902349135
--- /dev/null
+++ b/src/test/ui/kindck/kindck-impl-type-params.stderr
@@ -0,0 +1,103 @@
+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 because of the requirements on the impl of `Gettable<T>` for `S<T>`
+ --> $DIR/kindck-impl-type-params.rs:12:32
+ |
+LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
+ | ^^^^^^^^^^^ ^^^^
+ = 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 because of the requirements on the impl of `Gettable<T>` for `S<T>`
+ --> $DIR/kindck-impl-type-params.rs:12:32
+ |
+LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
+ | ^^^^^^^^^^^ ^^^^
+ = 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 because of the requirements on the impl of `Gettable<T>` for `S<T>`
+ --> $DIR/kindck-impl-type-params.rs:12:32
+ |
+LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
+ | ^^^^^^^^^^^ ^^^^
+ = 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 because of the requirements on the impl of `Gettable<T>` for `S<T>`
+ --> $DIR/kindck-impl-type-params.rs:12:32
+ |
+LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
+ | ^^^^^^^^^^^ ^^^^
+ = 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 because of the requirements on the impl of `Gettable<String>` for `S<String>`
+ --> $DIR/kindck-impl-type-params.rs:12:32
+ |
+LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
+ | ^^^^^^^^^^^ ^^^^
+ = 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 because of the requirements on the impl of `Gettable<Foo>` for `S<Foo>`
+ --> $DIR/kindck-impl-type-params.rs:12:32
+ |
+LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
+ | ^^^^^^^^^^^ ^^^^
+ = 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)]
+ |
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0277`.