move tests from ui/kindck to ui/traits

This commit is contained in:
cyrgani
2026-03-17 22:02:05 +00:00
parent caeda1869a
commit 62b9fa15e7
11 changed files with 48 additions and 52 deletions
-4
View File
@@ -784,10 +784,6 @@ These tests revolve around the `--json` compiler flag. See [JSON Output](https:/
Tests exercising keywords, such as attempting to use them as identifiers when not contextual keywords.
## `tests/ui/kindck/`
**FIXME**: `kindck` is no longer a thing, these tests probably need to be audited and rehomed.
## `tests/ui/label/`
Exercises block and loop `'label`s.
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `&'static mut isize: Copy` is not satisfied
--> $DIR/kindck-copy.rs:27:19
--> $DIR/basic-copyable-types.rs:27:19
|
LL | assert_copy::<&'static mut isize>();
| ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `&'static mut isize`
|
note: required by a bound in `assert_copy`
--> $DIR/kindck-copy.rs:5:19
--> $DIR/basic-copyable-types.rs:5:19
|
LL | fn assert_copy<T: Copy>() {}
| ^^^^ required by this bound in `assert_copy`
@@ -16,13 +16,13 @@ LL + assert_copy::<isize>();
|
error[E0277]: the trait bound `&'a mut isize: Copy` is not satisfied
--> $DIR/kindck-copy.rs:28:19
--> $DIR/basic-copyable-types.rs:28:19
|
LL | assert_copy::<&'a mut isize>();
| ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `&'a mut isize`
|
note: required by a bound in `assert_copy`
--> $DIR/kindck-copy.rs:5:19
--> $DIR/basic-copyable-types.rs:5:19
|
LL | fn assert_copy<T: Copy>() {}
| ^^^^ required by this bound in `assert_copy`
@@ -33,114 +33,114 @@ LL + assert_copy::<isize>();
|
error[E0277]: the trait bound `Box<isize>: Copy` is not satisfied
--> $DIR/kindck-copy.rs:31:19
--> $DIR/basic-copyable-types.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:19
--> $DIR/basic-copyable-types.rs:5:19
|
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
--> $DIR/basic-copyable-types.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:19
--> $DIR/basic-copyable-types.rs:5:19
|
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
--> $DIR/basic-copyable-types.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:19
--> $DIR/basic-copyable-types.rs:5:19
|
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
--> $DIR/basic-copyable-types.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:19
--> $DIR/basic-copyable-types.rs:5:19
|
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
--> $DIR/basic-copyable-types.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:19
--> $DIR/basic-copyable-types.rs:5:19
|
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
--> $DIR/basic-copyable-types.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:19
--> $DIR/basic-copyable-types.rs:5:19
|
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
--> $DIR/basic-copyable-types.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:19
--> $DIR/basic-copyable-types.rs:5:19
|
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
--> $DIR/basic-copyable-types.rs:64:19
|
LL | assert_copy::<MyNoncopyStruct>();
| ^^^^^^^^^^^^^^^ unsatisfied trait bound
|
help: the trait `Copy` is not implemented for `MyNoncopyStruct`
--> $DIR/kindck-copy.rs:15:1
--> $DIR/basic-copyable-types.rs:15:1
|
LL | struct MyNoncopyStruct {
| ^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `assert_copy`
--> $DIR/kindck-copy.rs:5:19
--> $DIR/basic-copyable-types.rs:5:19
|
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
--> $DIR/basic-copyable-types.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:19
--> $DIR/basic-copyable-types.rs:5:19
|
LL | fn assert_copy<T: Copy>() {}
| ^^^^ required by this bound in `assert_copy`
@@ -1,21 +1,21 @@
error[E0277]: `Rc<usize>` cannot be sent between threads safely
--> $DIR/kindck-nonsendable-1.rs:9:9
--> $DIR/closure-rc-not-send.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:16}`
| | within this `{closure@$DIR/closure-rc-not-send.rs:9:9: 9:16}`
| required by a bound introduced by this call
|
= help: within `{closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:16}`, the trait `Send` is not implemented for `Rc<usize>`
= help: within `{closure@$DIR/closure-rc-not-send.rs:9:9: 9:16}`, 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
--> $DIR/closure-rc-not-send.rs:9:9
|
LL | bar(move || foo(x));
| ^^^^^^^
note: required by a bound in `bar`
--> $DIR/kindck-nonsendable-1.rs:5:22
--> $DIR/closure-rc-not-send.rs:5:22
|
LL | fn bar<F: FnOnce() + Send>(_: F) {}
| ^^^^ required by this bound in `bar`
@@ -1,11 +1,11 @@
error[E0277]: `T` cannot be sent between threads safely
--> $DIR/kindck-impl-type-params.rs:18:13
--> $DIR/copy-bounds-impl-type-params.rs:18: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:14:32
--> $DIR/copy-bounds-impl-type-params.rs:14:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ---- ^^^^^^^^^^^ ^^^^
@@ -18,13 +18,13 @@ 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:18:13
--> $DIR/copy-bounds-impl-type-params.rs:18: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:14:32
--> $DIR/copy-bounds-impl-type-params.rs:14:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ---- ^^^^^^^^^^^ ^^^^
@@ -37,13 +37,13 @@ LL | fn f<T: std::marker::Copy>(val: T) {
| +++++++++++++++++++
error[E0277]: `T` cannot be sent between threads safely
--> $DIR/kindck-impl-type-params.rs:25:31
--> $DIR/copy-bounds-impl-type-params.rs:25: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:14:32
--> $DIR/copy-bounds-impl-type-params.rs:14:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ---- ^^^^^^^^^^^ ^^^^
@@ -56,13 +56,13 @@ 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:25:31
--> $DIR/copy-bounds-impl-type-params.rs:25: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:14:32
--> $DIR/copy-bounds-impl-type-params.rs:14:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ---- ^^^^^^^^^^^ ^^^^
@@ -75,18 +75,18 @@ 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:38:13
--> $DIR/copy-bounds-impl-type-params.rs:38: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>`
--> $DIR/kindck-impl-type-params.rs:14:1
--> $DIR/copy-bounds-impl-type-params.rs:14:1
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: required for `S<String>` to implement `Gettable<String>`
--> $DIR/kindck-impl-type-params.rs:14:32
--> $DIR/copy-bounds-impl-type-params.rs:14:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ---- ^^^^^^^^^^^ ^^^^
@@ -95,18 +95,18 @@ LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
= note: required for the cast from `Box<S<String>>` to `Box<dyn Gettable<String>>`
error[E0277]: the trait bound `Foo: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:46:37
--> $DIR/copy-bounds-impl-type-params.rs:46: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>`
--> $DIR/kindck-impl-type-params.rs:14:1
--> $DIR/copy-bounds-impl-type-params.rs:14:1
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: required for `S<Foo>` to implement `Gettable<Foo>`
--> $DIR/kindck-impl-type-params.rs:14:32
--> $DIR/copy-bounds-impl-type-params.rs:14:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
| ---- ^^^^^^^^^^^ ^^^^
@@ -120,7 +120,7 @@ LL | struct Foo; // does not impl Copy
|
error: lifetime may not live long enough
--> $DIR/kindck-impl-type-params.rs:32:13
--> $DIR/copy-bounds-impl-type-params.rs:32:13
|
LL | fn foo<'a>() {
| -- lifetime `'a` defined here
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Box<{integer}>: Foo` is not satisfied
--> $DIR/kindck-inherited-copy-bound.rs:15:16
--> $DIR/inherited-copy-bound.rs:15:16
|
LL | take_param(&x);
| ---------- ^^ the trait `Copy` is not implemented for `Box<{integer}>`
@@ -7,27 +7,27 @@ LL | take_param(&x);
| required by a bound introduced by this call
|
note: required for `Box<{integer}>` to implement `Foo`
--> $DIR/kindck-inherited-copy-bound.rs:9:15
--> $DIR/inherited-copy-bound.rs:9:15
|
LL | impl<T: Copy> Foo for T {}
| ---- ^^^ ^
| |
| unsatisfied trait bound introduced here
note: required by a bound in `take_param`
--> $DIR/kindck-inherited-copy-bound.rs:11:18
--> $DIR/inherited-copy-bound.rs:11:18
|
LL | fn take_param<T: Foo>(foo: &T) {}
| ^^^ required by this bound in `take_param`
error[E0038]: the trait `Foo` is not dyn compatible
--> $DIR/kindck-inherited-copy-bound.rs:21:24
--> $DIR/inherited-copy-bound.rs:21:24
|
LL | let z = &x as &dyn Foo;
| ^^^ `Foo` is not dyn compatible
|
note: for a trait to be dyn compatible it needs to allow building a vtable
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
--> $DIR/kindck-inherited-copy-bound.rs:5:12
--> $DIR/inherited-copy-bound.rs:5:12
|
LL | trait Foo: Copy {
| --- ^^^^ ...because it requires `Self: Sized`