From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/kindck/kindck-impl-type-params.stderr | 103 ++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 src/test/ui/kindck/kindck-impl-type-params.stderr (limited to 'src/test/ui/kindck/kindck-impl-type-params.stderr') 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` cannot be sent between threads safely + | +note: required because of the requirements on the impl of `Gettable` for `S` + --> $DIR/kindck-impl-type-params.rs:12:32 + | +LL | impl Gettable for S {} + | ^^^^^^^^^^^ ^^^^ + = note: required for the cast from `S` to the object type `dyn Gettable` +help: consider restricting type parameter `T` + | +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 because of the requirements on the impl of `Gettable` for `S` + --> $DIR/kindck-impl-type-params.rs:12:32 + | +LL | impl Gettable for S {} + | ^^^^^^^^^^^ ^^^^ + = note: required for the cast from `S` to the object type `dyn Gettable` +help: consider restricting type parameter `T` + | +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 because of the requirements on the impl of `Gettable` for `S` + --> $DIR/kindck-impl-type-params.rs:12:32 + | +LL | impl Gettable for S {} + | ^^^^^^^^^^^ ^^^^ + = note: required for the cast from `S` to the object type `dyn Gettable` +help: consider restricting type parameter `T` + | +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 because of the requirements on the impl of `Gettable` for `S` + --> $DIR/kindck-impl-type-params.rs:12:32 + | +LL | impl Gettable for S {} + | ^^^^^^^^^^^ ^^^^ + = note: required for the cast from `S` to the object type `dyn Gettable` +help: consider restricting type parameter `T` + | +LL | fn g(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>; + | ^ the trait `Copy` is not implemented for `String` + | + = help: the trait `Gettable` is implemented for `S` +note: required because of the requirements on the impl of `Gettable` for `S` + --> $DIR/kindck-impl-type-params.rs:12:32 + | +LL | impl Gettable for S {} + | ^^^^^^^^^^^ ^^^^ + = note: required for the cast from `S` to the object type `dyn Gettable` + +error[E0277]: the trait bound `Foo: Copy` is not satisfied + --> $DIR/kindck-impl-type-params.rs:43:37 + | +LL | let a: Box> = t; + | ^ the trait `Copy` is not implemented for `Foo` + | + = help: the trait `Gettable` is implemented for `S` +note: required because of the requirements on the impl of `Gettable` for `S` + --> $DIR/kindck-impl-type-params.rs:12:32 + | +LL | impl Gettable for S {} + | ^^^^^^^^^^^ ^^^^ + = note: required for the cast from `S` to the object type `dyn Gettable` +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`. -- cgit v1.2.3