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` cannot be sent between threads safely | note: required for `S` to implement `Gettable` --> $DIR/kindck-impl-type-params.rs:12:32 | LL | impl Gettable for S {} | ---- ^^^^^^^^^^^ ^^^^ | | | unsatisfied trait bound introduced here = note: required for the cast from `&S` to `&dyn Gettable` help: consider restricting type parameter `T` with trait `Send` | LL | fn f(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; | ^^ the trait `Copy` is not implemented for `T` | note: required for `S` to implement `Gettable` --> $DIR/kindck-impl-type-params.rs:12:32 | LL | impl Gettable for S {} | ---- ^^^^^^^^^^^ ^^^^ | | | unsatisfied trait bound introduced here = note: required for the cast from `&S` to `&dyn Gettable` help: consider restricting type parameter `T` with trait `Copy` | LL | fn f(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` cannot be sent between threads safely | note: required for `S` to implement `Gettable` --> $DIR/kindck-impl-type-params.rs:12:32 | LL | impl Gettable for S {} | ---- ^^^^^^^^^^^ ^^^^ | | | unsatisfied trait bound introduced here = note: required for the cast from `&S` to `&dyn Gettable` help: consider restricting type parameter `T` with trait `Send` | LL | fn g(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; | ^^ the trait `Copy` is not implemented for `T` | note: required for `S` to implement `Gettable` --> $DIR/kindck-impl-type-params.rs:12:32 | LL | impl Gettable for S {} | ---- ^^^^^^^^^^^ ^^^^ | | | unsatisfied trait bound introduced here = note: required for the cast from `&S` to `&dyn Gettable` help: consider restricting type parameter `T` with trait `Copy` | LL | fn g(val: T) { | +++++++++++++++++++ error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/kindck-impl-type-params.rs:36:13 | LL | let a = t as Box>; | ^ the trait `Copy` is not implemented for `String` | = help: the trait `Gettable` is implemented for `S` note: required for `S` to implement `Gettable` --> $DIR/kindck-impl-type-params.rs:12:32 | LL | impl Gettable for S {} | ---- ^^^^^^^^^^^ ^^^^ | | | unsatisfied trait bound introduced here = note: required for the cast from `Box>` to `Box>` error[E0277]: the trait bound `Foo: Copy` is not satisfied --> $DIR/kindck-impl-type-params.rs:44:37 | LL | let a: Box> = t; | ^ the trait `Copy` is not implemented for `Foo` | = help: the trait `Gettable` is implemented for `S` note: required for `S` to implement `Gettable` --> $DIR/kindck-impl-type-params.rs:12:32 | LL | impl Gettable for S {} | ---- ^^^^^^^^^^^ ^^^^ | | | unsatisfied trait bound introduced here = note: required for the cast from `Box>` to `Box>` help: consider annotating `Foo` with `#[derive(Copy)]` | LL + #[derive(Copy)] LL | struct Foo; // does not impl Copy | error: lifetime may not live long enough --> $DIR/kindck-impl-type-params.rs:30:13 | LL | fn foo<'a>() { | -- lifetime `'a` defined here LL | let t: S<&'a isize> = S(marker::PhantomData); LL | let a = &t as &dyn Gettable<&'a isize>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'a` must outlive `'static` error: aborting due to 7 previous errors For more information about this error, try `rustc --explain E0277`.