summaryrefslogtreecommitdiffstats
path: root/src/test/ui/kindck
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/kindck
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/kindck')
-rw-r--r--src/test/ui/kindck/kindck-copy.rs71
-rw-r--r--src/test/ui/kindck/kindck-copy.stderr137
-rw-r--r--src/test/ui/kindck/kindck-impl-type-params-2.rs15
-rw-r--r--src/test/ui/kindck/kindck-impl-type-params-2.stderr22
-rw-r--r--src/test/ui/kindck/kindck-impl-type-params.rs47
-rw-r--r--src/test/ui/kindck/kindck-impl-type-params.stderr103
-rw-r--r--src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr53
-rw-r--r--src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr39
-rw-r--r--src/test/ui/kindck/kindck-inherited-copy-bound.rs34
-rw-r--r--src/test/ui/kindck/kindck-nonsendable-1.rs11
-rw-r--r--src/test/ui/kindck/kindck-nonsendable-1.stderr25
-rw-r--r--src/test/ui/kindck/kindck-send-object.rs26
-rw-r--r--src/test/ui/kindck/kindck-send-object.stderr32
-rw-r--r--src/test/ui/kindck/kindck-send-object1.rs32
-rw-r--r--src/test/ui/kindck/kindck-send-object1.stderr32
-rw-r--r--src/test/ui/kindck/kindck-send-object2.rs24
-rw-r--r--src/test/ui/kindck/kindck-send-object2.stderr32
-rw-r--r--src/test/ui/kindck/kindck-send-owned.rs16
-rw-r--r--src/test/ui/kindck/kindck-send-owned.stderr18
-rw-r--r--src/test/ui/kindck/kindck-send-unsafe.rs11
-rw-r--r--src/test/ui/kindck/kindck-send-unsafe.rs~rust-lang_master12
-rw-r--r--src/test/ui/kindck/kindck-send-unsafe.stderr16
22 files changed, 0 insertions, 808 deletions
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<T:Copy>() { }
-
-trait Dummy { }
-
-#[derive(Copy, Clone)]
-struct MyStruct {
- x: isize,
- y: isize,
-}
-
-struct MyNoncopyStruct {
- x: Box<char>,
-}
-
-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::<Box<isize>>(); //~ ERROR : Copy` is not satisfied
- assert_copy::<String>(); //~ ERROR : Copy` is not satisfied
- assert_copy::<Vec<isize> >(); //~ ERROR : Copy` is not satisfied
- assert_copy::<Box<&'a mut isize>>(); //~ 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::<Box<dyn Dummy>>(); //~ ERROR : Copy` is not satisfied
- assert_copy::<Box<dyn Dummy + Send>>(); //~ 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::<isize>();
- assert_copy::<bool>();
- assert_copy::<()>();
-
- // tuples are ok
- assert_copy::<(isize,isize)>();
-
- // structs of POD are ok
- assert_copy::<MyStruct>();
-
- // structs containing non-POD are not ok
- assert_copy::<MyNoncopyStruct>(); //~ ERROR : Copy` is not satisfied
-
- // ref counted types are not ok
- assert_copy::<Rc<isize>>(); //~ 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<T: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<T:Copy>() { }
- | ^^^^ required by this bound in `assert_copy`
-
-error[E0277]: the trait bound `Box<isize>: Copy` is not satisfied
- --> $DIR/kindck-copy.rs:31:19
- |
-LL | assert_copy::<Box<isize>>();
- | ^^^^^^^^^^ the trait `Copy` is not implemented for `Box<isize>`
- |
-note: required by a bound in `assert_copy`
- --> $DIR/kindck-copy.rs:5:18
- |
-LL | fn assert_copy<T: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::<String>();
- | ^^^^^^ 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<T:Copy>() { }
- | ^^^^ required by this bound in `assert_copy`
-
-error[E0277]: the trait bound `Vec<isize>: Copy` is not satisfied
- --> $DIR/kindck-copy.rs:33:19
- |
-LL | assert_copy::<Vec<isize> >();
- | ^^^^^^^^^^ the trait `Copy` is not implemented for `Vec<isize>`
- |
-note: required by a bound in `assert_copy`
- --> $DIR/kindck-copy.rs:5:18
- |
-LL | fn assert_copy<T: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::<Box<&'a mut isize>>();
- | ^^^^^^^^^^^^^^^^^^ 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<T:Copy>() { }
- | ^^^^ required by this bound in `assert_copy`
-
-error[E0277]: the trait bound `Box<dyn Dummy>: Copy` is not satisfied
- --> $DIR/kindck-copy.rs:42:19
- |
-LL | assert_copy::<Box<dyn Dummy>>();
- | ^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Box<dyn Dummy>`
- |
-note: required by a bound in `assert_copy`
- --> $DIR/kindck-copy.rs:5:18
- |
-LL | fn assert_copy<T:Copy>() { }
- | ^^^^ required by this bound in `assert_copy`
-
-error[E0277]: the trait bound `Box<dyn Dummy + Send>: Copy` is not satisfied
- --> $DIR/kindck-copy.rs:43:19
- |
-LL | assert_copy::<Box<dyn Dummy + Send>>();
- | ^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Box<dyn Dummy + Send>`
- |
-note: required by a bound in `assert_copy`
- --> $DIR/kindck-copy.rs:5:18
- |
-LL | fn assert_copy<T: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<T: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::<MyNoncopyStruct>();
- | ^^^^^^^^^^^^^^^ 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<T:Copy>() { }
- | ^^^^ required by this bound in `assert_copy`
-
-error[E0277]: the trait bound `Rc<isize>: Copy` is not satisfied
- --> $DIR/kindck-copy.rs:67:19
- |
-LL | assert_copy::<Rc<isize>>();
- | ^^^^^^^^^ the trait `Copy` is not implemented for `Rc<isize>`
- |
-note: required by a bound in `assert_copy`
- --> $DIR/kindck-copy.rs:5:18
- |
-LL | fn assert_copy<T: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<T:Copy> Foo for T {
-}
-
-fn take_param<T:Foo>(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<T:Copy> Foo for T {
- | ^^^ ^
-note: required by a bound in `take_param`
- --> $DIR/kindck-impl-type-params-2.rs:9:17
- |
-LL | fn take_param<T:Foo>(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<T>(marker::PhantomData<T>);
-
-trait Gettable<T> {
- fn get(&self) -> T { panic!() }
-}
-
-impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
-
-fn f<T>(val: T) {
- let t: S<T> = S(marker::PhantomData);
- let a = &t as &dyn Gettable<T>;
- //~^ ERROR `T` cannot be sent between threads safely
- //~| ERROR : Copy` is not satisfied
-}
-
-fn g<T>(val: T) {
- let t: S<T> = S(marker::PhantomData);
- let a: &dyn Gettable<T> = &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<S<String>> = Box::new(S(marker::PhantomData));
- let a = t as Box<dyn Gettable<String>>;
- //~^ ERROR : Copy` is not satisfied
-}
-
-fn foo3<'a>() {
- struct Foo; // does not impl Copy
-
- let t: Box<S<Foo>> = Box::new(S(marker::PhantomData));
- let a: Box<dyn Gettable<Foo>> = 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>;
- | ^^ `T` cannot be sent between threads safely
- |
-note: required for `S<T>` to implement `Gettable<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 for `S<T>` to implement `Gettable<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 for `S<T>` to implement `Gettable<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 for `S<T>` to implement `Gettable<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 for `S<String>` to implement `Gettable<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 for `S<Foo>` to implement `Gettable<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`.
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<T:Copy> Foo for T {
- | ^^^ ^
-note: required by a bound in `take_param`
- --> $DIR/kindck-inherited-copy-bound.rs:17:17
- |
-LL | fn take_param<T:Foo>(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 <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $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 <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $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<T:Copy> Foo for T {
- | ^^^ ^
-note: required by a bound in `take_param`
- --> $DIR/kindck-inherited-copy-bound.rs:17:17
- |
-LL | fn take_param<T:Foo>(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 <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $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<i32>` 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<T:Copy> Foo for T {
-}
-
-fn take_param<T:Foo>(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<usize>) {}
-
-fn bar<F:FnOnce() + Send>(_: F) { }
-
-fn main() {
- let x = Rc::new(3);
- bar(move|| foo(x));
- //~^ ERROR `Rc<usize>` 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<usize>` cannot be sent between threads safely
- --> $DIR/kindck-nonsendable-1.rs:9:9
- |
-LL | bar(move|| foo(x));
- | --- ------^^^^^^^
- | | |
- | | `Rc<usize>` 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<usize>`
-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:FnOnce() + Send>(_: 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<T: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::<Box<dyn Dummy>>();
- //~^ ERROR `dyn Dummy` cannot be sent between threads safely
-}
-
-fn object_with_send_bound_ok() {
- assert_send::<&'static (dyn Dummy + Sync)>();
- assert_send::<Box<dyn Dummy + 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<T: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::<Box<dyn Dummy>>();
- | ^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely
- |
- = help: the trait `Send` is not implemented for `dyn Dummy`
- = note: required for `Unique<dyn Dummy>` to implement `Send`
- = note: required because it appears within the type `Box<dyn Dummy>`
-note: required by a bound in `assert_send`
- --> $DIR/kindck-send-object.rs:5:18
- |
-LL | fn assert_send<T: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<T:Send+'static>() { }
-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::<Box<dyn Dummy + Send>>();
-}
-
-// closure and object types can have lifetime bounds which make
-// them not ok
-fn test_71<'a>() {
- assert_send::<Box<dyn Dummy + 'a>>();
- //~^ 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<T:Send+'static>() { }
- | ^^^^ 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::<Box<dyn Dummy + 'a>>();
- | ^^^^^^^^^^^^^^^^^^^ `(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<T:Send+'static>() { }
- | ^^^^ 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<T: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::<Box<dyn Dummy>>();
- //~^ 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::<Box<dyn Dummy + 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<T: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::<Box<dyn Dummy>>();
- | ^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely
- |
- = help: the trait `Send` is not implemented for `dyn Dummy`
- = note: required for `Unique<dyn Dummy>` to implement `Send`
- = note: required because it appears within the type `Box<dyn Dummy>`
-note: required by a bound in `assert_send`
- --> $DIR/kindck-send-object2.rs:3:18
- |
-LL | fn assert_send<T: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<T:Send>() { }
-
-// owned content are ok
-fn test30() { assert_send::<Box<isize>>(); }
-fn test31() { assert_send::<String>(); }
-fn test32() { assert_send::<Vec<isize> >(); }
-
-// but not if they own a bad thing
-fn test40() {
- assert_send::<Box<*mut u8>>();
- //~^ 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::<Box<*mut u8>>();
- | ^^^^^^^^^^^^ `*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<T: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<T: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<T: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<T:Send>() { }
- | ^^^^ required by this bound in `assert_send`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.