From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/kindck/kindck-copy.rs | 71 ----------- src/test/ui/kindck/kindck-copy.stderr | 137 --------------------- src/test/ui/kindck/kindck-impl-type-params-2.rs | 15 --- .../ui/kindck/kindck-impl-type-params-2.stderr | 22 ---- src/test/ui/kindck/kindck-impl-type-params.rs | 47 ------- src/test/ui/kindck/kindck-impl-type-params.stderr | 103 ---------------- .../kindck/kindck-inherited-copy-bound.curr.stderr | 53 -------- ...ited-copy-bound.object_safe_for_dispatch.stderr | 39 ------ src/test/ui/kindck/kindck-inherited-copy-bound.rs | 34 ----- src/test/ui/kindck/kindck-nonsendable-1.rs | 11 -- src/test/ui/kindck/kindck-nonsendable-1.stderr | 25 ---- src/test/ui/kindck/kindck-send-object.rs | 26 ---- src/test/ui/kindck/kindck-send-object.stderr | 32 ----- src/test/ui/kindck/kindck-send-object1.rs | 32 ----- src/test/ui/kindck/kindck-send-object1.stderr | 32 ----- src/test/ui/kindck/kindck-send-object2.rs | 24 ---- src/test/ui/kindck/kindck-send-object2.stderr | 32 ----- src/test/ui/kindck/kindck-send-owned.rs | 16 --- src/test/ui/kindck/kindck-send-owned.stderr | 18 --- src/test/ui/kindck/kindck-send-unsafe.rs | 11 -- .../kindck/kindck-send-unsafe.rs~rust-lang_master | 12 -- src/test/ui/kindck/kindck-send-unsafe.stderr | 16 --- 22 files changed, 808 deletions(-) delete mode 100644 src/test/ui/kindck/kindck-copy.rs delete mode 100644 src/test/ui/kindck/kindck-copy.stderr delete mode 100644 src/test/ui/kindck/kindck-impl-type-params-2.rs delete mode 100644 src/test/ui/kindck/kindck-impl-type-params-2.stderr delete mode 100644 src/test/ui/kindck/kindck-impl-type-params.rs delete mode 100644 src/test/ui/kindck/kindck-impl-type-params.stderr delete mode 100644 src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr delete mode 100644 src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr delete mode 100644 src/test/ui/kindck/kindck-inherited-copy-bound.rs delete mode 100644 src/test/ui/kindck/kindck-nonsendable-1.rs delete mode 100644 src/test/ui/kindck/kindck-nonsendable-1.stderr delete mode 100644 src/test/ui/kindck/kindck-send-object.rs delete mode 100644 src/test/ui/kindck/kindck-send-object.stderr delete mode 100644 src/test/ui/kindck/kindck-send-object1.rs delete mode 100644 src/test/ui/kindck/kindck-send-object1.stderr delete mode 100644 src/test/ui/kindck/kindck-send-object2.rs delete mode 100644 src/test/ui/kindck/kindck-send-object2.stderr delete mode 100644 src/test/ui/kindck/kindck-send-owned.rs delete mode 100644 src/test/ui/kindck/kindck-send-owned.stderr delete mode 100644 src/test/ui/kindck/kindck-send-unsafe.rs delete mode 100644 src/test/ui/kindck/kindck-send-unsafe.rs~rust-lang_master delete mode 100644 src/test/ui/kindck/kindck-send-unsafe.stderr (limited to 'src/test/ui/kindck') diff --git a/src/test/ui/kindck/kindck-copy.rs b/src/test/ui/kindck/kindck-copy.rs deleted file mode 100644 index 6df98c230..000000000 --- a/src/test/ui/kindck/kindck-copy.rs +++ /dev/null @@ -1,71 +0,0 @@ -// Test which of the builtin types are considered POD. - -use std::rc::Rc; - -fn assert_copy() { } - -trait Dummy { } - -#[derive(Copy, Clone)] -struct MyStruct { - x: isize, - y: isize, -} - -struct MyNoncopyStruct { - x: Box, -} - -fn test<'a,T,U:Copy>(_: &'a isize) { - // lifetime pointers are ok... - assert_copy::<&'static isize>(); - assert_copy::<&'a isize>(); - assert_copy::<&'a str>(); - assert_copy::<&'a [isize]>(); - - // ...unless they are mutable - assert_copy::<&'static mut isize>(); //~ ERROR : Copy` is not satisfied - assert_copy::<&'a mut isize>(); //~ ERROR : Copy` is not satisfied - - // boxes are not ok - assert_copy::>(); //~ ERROR : Copy` is not satisfied - assert_copy::(); //~ ERROR : Copy` is not satisfied - assert_copy:: >(); //~ ERROR : Copy` is not satisfied - assert_copy::>(); //~ ERROR : Copy` is not satisfied - - // borrowed object types are generally ok - assert_copy::<&'a dyn Dummy>(); - assert_copy::<&'a (dyn Dummy + Send)>(); - assert_copy::<&'static (dyn Dummy + Send)>(); - - // owned object types are not ok - assert_copy::>(); //~ ERROR : Copy` is not satisfied - assert_copy::>(); //~ ERROR : Copy` is not satisfied - - // mutable object types are not ok - assert_copy::<&'a mut (dyn Dummy + Send)>(); //~ ERROR : Copy` is not satisfied - - // unsafe ptrs are ok - assert_copy::<*const isize>(); - assert_copy::<*const &'a mut isize>(); - - // regular old ints and such are ok - assert_copy::(); - assert_copy::(); - assert_copy::<()>(); - - // tuples are ok - assert_copy::<(isize,isize)>(); - - // structs of POD are ok - assert_copy::(); - - // structs containing non-POD are not ok - assert_copy::(); //~ ERROR : Copy` is not satisfied - - // ref counted types are not ok - assert_copy::>(); //~ ERROR : Copy` is not satisfied -} - -pub fn main() { -} diff --git a/src/test/ui/kindck/kindck-copy.stderr b/src/test/ui/kindck/kindck-copy.stderr deleted file mode 100644 index 9af89159a..000000000 --- a/src/test/ui/kindck/kindck-copy.stderr +++ /dev/null @@ -1,137 +0,0 @@ -error[E0277]: the trait bound `&'static mut isize: Copy` is not satisfied - --> $DIR/kindck-copy.rs:27:19 - | -LL | assert_copy::<&'static mut isize>(); - | ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `&'static mut isize` - | - = help: the trait `Copy` is implemented for `isize` -note: required by a bound in `assert_copy` - --> $DIR/kindck-copy.rs:5:18 - | -LL | fn assert_copy() { } - | ^^^^ required by this bound in `assert_copy` - -error[E0277]: the trait bound `&'a mut isize: Copy` is not satisfied - --> $DIR/kindck-copy.rs:28:19 - | -LL | assert_copy::<&'a mut isize>(); - | ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `&'a mut isize` - | - = help: the trait `Copy` is implemented for `isize` -note: required by a bound in `assert_copy` - --> $DIR/kindck-copy.rs:5:18 - | -LL | fn assert_copy() { } - | ^^^^ required by this bound in `assert_copy` - -error[E0277]: the trait bound `Box: Copy` is not satisfied - --> $DIR/kindck-copy.rs:31:19 - | -LL | assert_copy::>(); - | ^^^^^^^^^^ the trait `Copy` is not implemented for `Box` - | -note: required by a bound in `assert_copy` - --> $DIR/kindck-copy.rs:5:18 - | -LL | fn assert_copy() { } - | ^^^^ required by this bound in `assert_copy` - -error[E0277]: the trait bound `String: Copy` is not satisfied - --> $DIR/kindck-copy.rs:32:19 - | -LL | assert_copy::(); - | ^^^^^^ the trait `Copy` is not implemented for `String` - | -note: required by a bound in `assert_copy` - --> $DIR/kindck-copy.rs:5:18 - | -LL | fn assert_copy() { } - | ^^^^ required by this bound in `assert_copy` - -error[E0277]: the trait bound `Vec: Copy` is not satisfied - --> $DIR/kindck-copy.rs:33:19 - | -LL | assert_copy:: >(); - | ^^^^^^^^^^ the trait `Copy` is not implemented for `Vec` - | -note: required by a bound in `assert_copy` - --> $DIR/kindck-copy.rs:5:18 - | -LL | fn assert_copy() { } - | ^^^^ required by this bound in `assert_copy` - -error[E0277]: the trait bound `Box<&'a mut isize>: Copy` is not satisfied - --> $DIR/kindck-copy.rs:34:19 - | -LL | assert_copy::>(); - | ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Box<&'a mut isize>` - | -note: required by a bound in `assert_copy` - --> $DIR/kindck-copy.rs:5:18 - | -LL | fn assert_copy() { } - | ^^^^ required by this bound in `assert_copy` - -error[E0277]: the trait bound `Box: Copy` is not satisfied - --> $DIR/kindck-copy.rs:42:19 - | -LL | assert_copy::>(); - | ^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Box` - | -note: required by a bound in `assert_copy` - --> $DIR/kindck-copy.rs:5:18 - | -LL | fn assert_copy() { } - | ^^^^ required by this bound in `assert_copy` - -error[E0277]: the trait bound `Box: Copy` is not satisfied - --> $DIR/kindck-copy.rs:43:19 - | -LL | assert_copy::>(); - | ^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Box` - | -note: required by a bound in `assert_copy` - --> $DIR/kindck-copy.rs:5:18 - | -LL | fn assert_copy() { } - | ^^^^ required by this bound in `assert_copy` - -error[E0277]: the trait bound `&'a mut (dyn Dummy + Send + 'a): Copy` is not satisfied - --> $DIR/kindck-copy.rs:46:19 - | -LL | assert_copy::<&'a mut (dyn Dummy + Send)>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `&'a mut (dyn Dummy + Send + 'a)` - | -note: required by a bound in `assert_copy` - --> $DIR/kindck-copy.rs:5:18 - | -LL | fn assert_copy() { } - | ^^^^ required by this bound in `assert_copy` - -error[E0277]: the trait bound `MyNoncopyStruct: Copy` is not satisfied - --> $DIR/kindck-copy.rs:64:19 - | -LL | assert_copy::(); - | ^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `MyNoncopyStruct` - | -note: required by a bound in `assert_copy` - --> $DIR/kindck-copy.rs:5:18 - | -LL | fn assert_copy() { } - | ^^^^ required by this bound in `assert_copy` - -error[E0277]: the trait bound `Rc: Copy` is not satisfied - --> $DIR/kindck-copy.rs:67:19 - | -LL | assert_copy::>(); - | ^^^^^^^^^ the trait `Copy` is not implemented for `Rc` - | -note: required by a bound in `assert_copy` - --> $DIR/kindck-copy.rs:5:18 - | -LL | fn assert_copy() { } - | ^^^^ required by this bound in `assert_copy` - -error: aborting due to 11 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/kindck/kindck-impl-type-params-2.rs b/src/test/ui/kindck/kindck-impl-type-params-2.rs deleted file mode 100644 index 8950fc51e..000000000 --- a/src/test/ui/kindck/kindck-impl-type-params-2.rs +++ /dev/null @@ -1,15 +0,0 @@ -trait Foo { -} - - - -impl Foo for T { -} - -fn take_param(foo: &T) { } - -fn main() { - let x: Box<_> = Box::new(3); - take_param(&x); - //~^ ERROR the trait bound `Box<{integer}>: Copy` is not satisfied -} diff --git a/src/test/ui/kindck/kindck-impl-type-params-2.stderr b/src/test/ui/kindck/kindck-impl-type-params-2.stderr deleted file mode 100644 index 930d96375..000000000 --- a/src/test/ui/kindck/kindck-impl-type-params-2.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0277]: the trait bound `Box<{integer}>: Copy` is not satisfied - --> $DIR/kindck-impl-type-params-2.rs:13:16 - | -LL | take_param(&x); - | ---------- ^^ the trait `Copy` is not implemented for `Box<{integer}>` - | | - | required by a bound introduced by this call - | -note: required for `Box<{integer}>` to implement `Foo` - --> $DIR/kindck-impl-type-params-2.rs:6:14 - | -LL | impl Foo for T { - | ^^^ ^ -note: required by a bound in `take_param` - --> $DIR/kindck-impl-type-params-2.rs:9:17 - | -LL | fn take_param(foo: &T) { } - | ^^^ required by this bound in `take_param` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/kindck/kindck-impl-type-params.rs b/src/test/ui/kindck/kindck-impl-type-params.rs deleted file mode 100644 index 72a6599c3..000000000 --- a/src/test/ui/kindck/kindck-impl-type-params.rs +++ /dev/null @@ -1,47 +0,0 @@ -// Issue #14061: tests the interaction between generic implementation -// parameter bounds and trait objects. - -use std::marker; - -struct S(marker::PhantomData); - -trait Gettable { - fn get(&self) -> T { panic!() } -} - -impl Gettable for S {} - -fn f(val: T) { - let t: S = S(marker::PhantomData); - let a = &t as &dyn Gettable; - //~^ ERROR `T` cannot be sent between threads safely - //~| ERROR : Copy` is not satisfied -} - -fn g(val: T) { - let t: S = S(marker::PhantomData); - let a: &dyn Gettable = &t; - //~^ ERROR `T` cannot be sent between threads safely - //~| ERROR : Copy` is not satisfied -} - -fn foo<'a>() { - let t: S<&'a isize> = S(marker::PhantomData); - let a = &t as &dyn Gettable<&'a isize>; -} - -fn foo2<'a>() { - let t: Box> = Box::new(S(marker::PhantomData)); - let a = t as Box>; - //~^ ERROR : Copy` is not satisfied -} - -fn foo3<'a>() { - struct Foo; // does not impl Copy - - let t: Box> = Box::new(S(marker::PhantomData)); - let a: Box> = t; - //~^ ERROR : Copy` is not satisfied -} - -fn main() { } diff --git a/src/test/ui/kindck/kindck-impl-type-params.stderr b/src/test/ui/kindck/kindck-impl-type-params.stderr deleted file mode 100644 index 8dbe0c38c..000000000 --- a/src/test/ui/kindck/kindck-impl-type-params.stderr +++ /dev/null @@ -1,103 +0,0 @@ -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 {} - | ^^^^^^^^^^^ ^^^^ - = 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 for `S` to implement `Gettable` - --> $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 for `S` to implement `Gettable` - --> $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 for `S` to implement `Gettable` - --> $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 for `S` to implement `Gettable` - --> $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 for `S` to implement `Gettable` - --> $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`. diff --git a/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr b/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr deleted file mode 100644 index e81d2441e..000000000 --- a/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr +++ /dev/null @@ -1,53 +0,0 @@ -error[E0277]: the trait bound `Box<{integer}>: Copy` is not satisfied - --> $DIR/kindck-inherited-copy-bound.rs:21:16 - | -LL | take_param(&x); - | ---------- ^^ the trait `Copy` is not implemented for `Box<{integer}>` - | | - | required by a bound introduced by this call - | -note: required for `Box<{integer}>` to implement `Foo` - --> $DIR/kindck-inherited-copy-bound.rs:14:14 - | -LL | impl Foo for T { - | ^^^ ^ -note: required by a bound in `take_param` - --> $DIR/kindck-inherited-copy-bound.rs:17:17 - | -LL | fn take_param(foo: &T) { } - | ^^^ required by this bound in `take_param` - -error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/kindck-inherited-copy-bound.rs:28:19 - | -LL | let z = &x as &dyn Foo; - | ^^^^^^^^ `Foo` cannot be made into an object - | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/kindck-inherited-copy-bound.rs:10:13 - | -LL | trait Foo : Copy { - | --- ^^^^ ...because it requires `Self: Sized` - | | - | this trait cannot be made into an object... - -error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/kindck-inherited-copy-bound.rs:28:13 - | -LL | let z = &x as &dyn Foo; - | ^^ `Foo` cannot be made into an object - | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/kindck-inherited-copy-bound.rs:10:13 - | -LL | trait Foo : Copy { - | --- ^^^^ ...because it requires `Self: Sized` - | | - | this trait cannot be made into an object... - = note: required for `&Box<{integer}>` to implement `CoerceUnsized<&dyn Foo>` - = note: required by cast to type `&dyn Foo` - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0038, E0277. -For more information about an error, try `rustc --explain E0038`. diff --git a/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr b/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr deleted file mode 100644 index 2380533b9..000000000 --- a/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0277]: the trait bound `Box<{integer}>: Copy` is not satisfied - --> $DIR/kindck-inherited-copy-bound.rs:21:16 - | -LL | take_param(&x); - | ---------- ^^ the trait `Copy` is not implemented for `Box<{integer}>` - | | - | required by a bound introduced by this call - | -note: required for `Box<{integer}>` to implement `Foo` - --> $DIR/kindck-inherited-copy-bound.rs:14:14 - | -LL | impl Foo for T { - | ^^^ ^ -note: required by a bound in `take_param` - --> $DIR/kindck-inherited-copy-bound.rs:17:17 - | -LL | fn take_param(foo: &T) { } - | ^^^ required by this bound in `take_param` - -error[E0038]: the trait `Foo` cannot be made into an object - --> $DIR/kindck-inherited-copy-bound.rs:28:13 - | -LL | let z = &x as &dyn Foo; - | ^^ `Foo` cannot be made into an object - | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/kindck-inherited-copy-bound.rs:10:13 - | -LL | trait Foo : Copy { - | --- ^^^^ ...because it requires `Self: Sized` - | | - | this trait cannot be made into an object... - = note: required for `&Box` to implement `CoerceUnsized<&dyn Foo>` - = note: required by cast to type `&dyn Foo` - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0038, E0277. -For more information about an error, try `rustc --explain E0038`. diff --git a/src/test/ui/kindck/kindck-inherited-copy-bound.rs b/src/test/ui/kindck/kindck-inherited-copy-bound.rs deleted file mode 100644 index 87d47556b..000000000 --- a/src/test/ui/kindck/kindck-inherited-copy-bound.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Test that Copy bounds inherited by trait are checked. -// -// revisions: curr object_safe_for_dispatch - -#![cfg_attr(object_safe_for_dispatch, feature(object_safe_for_dispatch))] - - -use std::any::Any; - -trait Foo : Copy { - fn foo(&self) {} -} - -impl Foo for T { -} - -fn take_param(foo: &T) { } - -fn a() { - let x: Box<_> = Box::new(3); - take_param(&x); //[curr]~ ERROR E0277 - //[object_safe_for_dispatch]~^ ERROR E0277 -} - -fn b() { - let x: Box<_> = Box::new(3); - let y = &x; - let z = &x as &dyn Foo; - //[curr]~^ ERROR E0038 - //[curr]~| ERROR E0038 - //[object_safe_for_dispatch]~^^^ ERROR E0038 -} - -fn main() { } diff --git a/src/test/ui/kindck/kindck-nonsendable-1.rs b/src/test/ui/kindck/kindck-nonsendable-1.rs deleted file mode 100644 index b32fd7862..000000000 --- a/src/test/ui/kindck/kindck-nonsendable-1.rs +++ /dev/null @@ -1,11 +0,0 @@ -use std::rc::Rc; - -fn foo(_x: Rc) {} - -fn bar(_: F) { } - -fn main() { - let x = Rc::new(3); - bar(move|| foo(x)); - //~^ ERROR `Rc` cannot be sent between threads safely -} diff --git a/src/test/ui/kindck/kindck-nonsendable-1.stderr b/src/test/ui/kindck/kindck-nonsendable-1.stderr deleted file mode 100644 index cc6e1f59c..000000000 --- a/src/test/ui/kindck/kindck-nonsendable-1.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0277]: `Rc` cannot be sent between threads safely - --> $DIR/kindck-nonsendable-1.rs:9:9 - | -LL | bar(move|| foo(x)); - | --- ------^^^^^^^ - | | | - | | `Rc` cannot be sent between threads safely - | | within this `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:15]` - | required by a bound introduced by this call - | - = help: within `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:15]`, the trait `Send` is not implemented for `Rc` -note: required because it's used within this closure - --> $DIR/kindck-nonsendable-1.rs:9:9 - | -LL | bar(move|| foo(x)); - | ^^^^^^ -note: required by a bound in `bar` - --> $DIR/kindck-nonsendable-1.rs:5:21 - | -LL | fn bar(_: F) { } - | ^^^^ required by this bound in `bar` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/kindck/kindck-send-object.rs b/src/test/ui/kindck/kindck-send-object.rs deleted file mode 100644 index 6411e688b..000000000 --- a/src/test/ui/kindck/kindck-send-object.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Test which of the builtin types are considered sendable. The tests -// in this file all test the "kind" violates detected during kindck. -// See all `regions-bounded-by-send.rs` - -fn assert_send() { } -trait Dummy { } -trait Message : Send { } - -// careful with object types, who knows what they close over... - -fn object_ref_with_static_bound_not_ok() { - assert_send::<&'static (dyn Dummy + 'static)>(); - //~^ ERROR `(dyn Dummy + 'static)` cannot be shared between threads safely [E0277] -} - -fn box_object_with_no_bound_not_ok<'a>() { - assert_send::>(); - //~^ ERROR `dyn Dummy` cannot be sent between threads safely -} - -fn object_with_send_bound_ok() { - assert_send::<&'static (dyn Dummy + Sync)>(); - assert_send::>(); -} - -fn main() { } diff --git a/src/test/ui/kindck/kindck-send-object.stderr b/src/test/ui/kindck/kindck-send-object.stderr deleted file mode 100644 index e9bbeeacd..000000000 --- a/src/test/ui/kindck/kindck-send-object.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error[E0277]: `(dyn Dummy + 'static)` cannot be shared between threads safely - --> $DIR/kindck-send-object.rs:12:19 - | -LL | assert_send::<&'static (dyn Dummy + 'static)>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely - | - = help: the trait `Sync` is not implemented for `(dyn Dummy + 'static)` - = note: required for `&'static (dyn Dummy + 'static)` to implement `Send` -note: required by a bound in `assert_send` - --> $DIR/kindck-send-object.rs:5:18 - | -LL | fn assert_send() { } - | ^^^^ required by this bound in `assert_send` - -error[E0277]: `dyn Dummy` cannot be sent between threads safely - --> $DIR/kindck-send-object.rs:17:19 - | -LL | assert_send::>(); - | ^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely - | - = help: the trait `Send` is not implemented for `dyn Dummy` - = note: required for `Unique` to implement `Send` - = note: required because it appears within the type `Box` -note: required by a bound in `assert_send` - --> $DIR/kindck-send-object.rs:5:18 - | -LL | fn assert_send() { } - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/kindck/kindck-send-object1.rs b/src/test/ui/kindck/kindck-send-object1.rs deleted file mode 100644 index 787d0f8f6..000000000 --- a/src/test/ui/kindck/kindck-send-object1.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Test which object types are considered sendable. This test -// is broken into two parts because some errors occur in distinct -// phases in the compiler. See kindck-send-object2.rs as well! - -fn assert_send() { } -trait Dummy { } - -// careful with object types, who knows what they close over... -fn test51<'a>() { - assert_send::<&'a dyn Dummy>(); - //~^ ERROR `(dyn Dummy + 'a)` cannot be shared between threads safely [E0277] -} -fn test52<'a>() { - assert_send::<&'a (dyn Dummy + Sync)>(); -} - -// ...unless they are properly bounded -fn test60() { - assert_send::<&'static (dyn Dummy + Sync)>(); -} -fn test61() { - assert_send::>(); -} - -// closure and object types can have lifetime bounds which make -// them not ok -fn test_71<'a>() { - assert_send::>(); - //~^ ERROR `(dyn Dummy + 'a)` cannot be sent between threads safely -} - -fn main() { } diff --git a/src/test/ui/kindck/kindck-send-object1.stderr b/src/test/ui/kindck/kindck-send-object1.stderr deleted file mode 100644 index 11f597fee..000000000 --- a/src/test/ui/kindck/kindck-send-object1.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely - --> $DIR/kindck-send-object1.rs:10:19 - | -LL | assert_send::<&'a dyn Dummy>(); - | ^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely - | - = help: the trait `Sync` is not implemented for `(dyn Dummy + 'a)` - = note: required for `&'a (dyn Dummy + 'a)` to implement `Send` -note: required by a bound in `assert_send` - --> $DIR/kindck-send-object1.rs:5:18 - | -LL | fn assert_send() { } - | ^^^^ required by this bound in `assert_send` - -error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely - --> $DIR/kindck-send-object1.rs:28:19 - | -LL | assert_send::>(); - | ^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely - | - = help: the trait `Send` is not implemented for `(dyn Dummy + 'a)` - = note: required for `Unique<(dyn Dummy + 'a)>` to implement `Send` - = note: required because it appears within the type `Box<(dyn Dummy + 'a)>` -note: required by a bound in `assert_send` - --> $DIR/kindck-send-object1.rs:5:18 - | -LL | fn assert_send() { } - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/kindck/kindck-send-object2.rs b/src/test/ui/kindck/kindck-send-object2.rs deleted file mode 100644 index b797588e4..000000000 --- a/src/test/ui/kindck/kindck-send-object2.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Continue kindck-send-object1.rs. - -fn assert_send() { } -trait Dummy { } - -fn test50() { - assert_send::<&'static dyn Dummy>(); - //~^ ERROR `(dyn Dummy + 'static)` cannot be shared between threads safely [E0277] -} - -fn test53() { - assert_send::>(); - //~^ ERROR `dyn Dummy` cannot be sent between threads safely -} - -// ...unless they are properly bounded -fn test60() { - assert_send::<&'static (dyn Dummy + Sync)>(); -} -fn test61() { - assert_send::>(); -} - -fn main() { } diff --git a/src/test/ui/kindck/kindck-send-object2.stderr b/src/test/ui/kindck/kindck-send-object2.stderr deleted file mode 100644 index b8af33d0d..000000000 --- a/src/test/ui/kindck/kindck-send-object2.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error[E0277]: `(dyn Dummy + 'static)` cannot be shared between threads safely - --> $DIR/kindck-send-object2.rs:7:19 - | -LL | assert_send::<&'static dyn Dummy>(); - | ^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely - | - = help: the trait `Sync` is not implemented for `(dyn Dummy + 'static)` - = note: required for `&'static (dyn Dummy + 'static)` to implement `Send` -note: required by a bound in `assert_send` - --> $DIR/kindck-send-object2.rs:3:18 - | -LL | fn assert_send() { } - | ^^^^ required by this bound in `assert_send` - -error[E0277]: `dyn Dummy` cannot be sent between threads safely - --> $DIR/kindck-send-object2.rs:12:19 - | -LL | assert_send::>(); - | ^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely - | - = help: the trait `Send` is not implemented for `dyn Dummy` - = note: required for `Unique` to implement `Send` - = note: required because it appears within the type `Box` -note: required by a bound in `assert_send` - --> $DIR/kindck-send-object2.rs:3:18 - | -LL | fn assert_send() { } - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/kindck/kindck-send-owned.rs b/src/test/ui/kindck/kindck-send-owned.rs deleted file mode 100644 index 65efb6904..000000000 --- a/src/test/ui/kindck/kindck-send-owned.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Test which of the builtin types are considered sendable. - -fn assert_send() { } - -// owned content are ok -fn test30() { assert_send::>(); } -fn test31() { assert_send::(); } -fn test32() { assert_send:: >(); } - -// but not if they own a bad thing -fn test40() { - assert_send::>(); - //~^ ERROR `*mut u8` cannot be sent between threads safely -} - -fn main() { } diff --git a/src/test/ui/kindck/kindck-send-owned.stderr b/src/test/ui/kindck/kindck-send-owned.stderr deleted file mode 100644 index b03f56465..000000000 --- a/src/test/ui/kindck/kindck-send-owned.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0277]: `*mut u8` cannot be sent between threads safely - --> $DIR/kindck-send-owned.rs:12:19 - | -LL | assert_send::>(); - | ^^^^^^^^^^^^ `*mut u8` cannot be sent between threads safely - | - = help: the trait `Send` is not implemented for `*mut u8` - = note: required for `Unique<*mut u8>` to implement `Send` - = note: required because it appears within the type `Box<*mut u8>` -note: required by a bound in `assert_send` - --> $DIR/kindck-send-owned.rs:3:18 - | -LL | fn assert_send() { } - | ^^^^ required by this bound in `assert_send` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/kindck/kindck-send-unsafe.rs b/src/test/ui/kindck/kindck-send-unsafe.rs deleted file mode 100644 index 4ef30a71f..000000000 --- a/src/test/ui/kindck/kindck-send-unsafe.rs +++ /dev/null @@ -1,11 +0,0 @@ -extern crate core; - -fn assert_send() { } - -fn test71<'a>() { - assert_send::<*mut &'a isize>(); - //~^ ERROR `*mut &'a isize` cannot be sent between threads safely -} - -fn main() { -} diff --git a/src/test/ui/kindck/kindck-send-unsafe.rs~rust-lang_master b/src/test/ui/kindck/kindck-send-unsafe.rs~rust-lang_master deleted file mode 100644 index 3f0444ec9..000000000 --- a/src/test/ui/kindck/kindck-send-unsafe.rs~rust-lang_master +++ /dev/null @@ -1,12 +0,0 @@ -fn assert_send() { } - -// unsafe ptrs are ok unless they point at unsendable things -fn test70() { - assert_send::<*mut int>(); -} -fn test71<'a>() { - assert_send::<*mut &'a int>(); //~ ERROR does not fulfill the required lifetime -} - -fn main() { -} diff --git a/src/test/ui/kindck/kindck-send-unsafe.stderr b/src/test/ui/kindck/kindck-send-unsafe.stderr deleted file mode 100644 index ceed0053c..000000000 --- a/src/test/ui/kindck/kindck-send-unsafe.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0277]: `*mut &'a isize` cannot be sent between threads safely - --> $DIR/kindck-send-unsafe.rs:6:19 - | -LL | assert_send::<*mut &'a isize>(); - | ^^^^^^^^^^^^^^ `*mut &'a isize` cannot be sent between threads safely - | - = help: the trait `Send` is not implemented for `*mut &'a isize` -note: required by a bound in `assert_send` - --> $DIR/kindck-send-unsafe.rs:3:18 - | -LL | fn assert_send() { } - | ^^^^ required by this bound in `assert_send` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. -- cgit v1.2.3