diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index c15bc3af026e5..9b878307afc96 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -724,7 +724,6 @@ ui/consts/issue-28113.rs ui/consts/issue-28822.rs ui/consts/issue-29798.rs ui/consts/issue-29914-2.rs -ui/consts/issue-29914-3.rs ui/consts/issue-29914.rs ui/consts/issue-29927-1.rs ui/consts/issue-29927.rs @@ -1915,7 +1914,6 @@ ui/parser/issues/issue-17718-parse-const.rs ui/parser/issues/issue-17904-2.rs ui/parser/issues/issue-17904.rs ui/parser/issues/issue-1802-1.rs -ui/parser/issues/issue-1802-2.rs ui/parser/issues/issue-19096.rs ui/parser/issues/issue-19398.rs ui/parser/issues/issue-20616-1.rs @@ -2764,7 +2762,6 @@ ui/type-alias-impl-trait/issue-57961.rs ui/type-alias-impl-trait/issue-58662-coroutine-with-lifetime.rs ui/type-alias-impl-trait/issue-58662-simplified.rs ui/type-alias-impl-trait/issue-58887.rs -ui/type-alias-impl-trait/issue-58951-2.rs ui/type-alias-impl-trait/issue-58951.rs ui/type-alias-impl-trait/issue-60371.rs ui/type-alias-impl-trait/issue-60407.rs @@ -2790,7 +2787,6 @@ ui/type-alias-impl-trait/issue-70121.rs ui/type-alias-impl-trait/issue-72793.rs ui/type-alias-impl-trait/issue-74244.rs ui/type-alias-impl-trait/issue-74280.rs -ui/type-alias-impl-trait/issue-74761-2.rs ui/type-alias-impl-trait/issue-74761.rs ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs ui/type-alias-impl-trait/issue-77179.rs @@ -2955,7 +2951,6 @@ ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.rs ui/unsafe/issue-47412.rs ui/unsafe/issue-85435-unsafe-op-in-let-under-unsafe-under-closure.rs ui/unsafe/issue-87414-query-cycle.rs -ui/unsized-locals/issue-30276-feature-flagged.rs ui/unsized-locals/issue-30276.rs ui/unsized-locals/issue-50940-with-feature.rs ui/unsized-locals/issue-50940.rs diff --git a/tests/ui/async-await/drop-track-field-assign-nonsend.rs b/tests/ui/async-await/drop-track-field-assign-nonsend.rs deleted file mode 100644 index 2b93f90137671..0000000000000 --- a/tests/ui/async-await/drop-track-field-assign-nonsend.rs +++ /dev/null @@ -1,44 +0,0 @@ -// Derived from an ICE found in tokio-xmpp during a crater run. -//@ edition:2021 - -#![allow(dead_code)] - -#[derive(Clone)] -struct InfoResult { - node: Option> -} - -struct Agent { - info_result: InfoResult -} - -impl Agent { - async fn handle(&mut self) { - let mut info = self.info_result.clone(); - info.node = None; - let element = parse_info(info); - let _ = send_element(element).await; - } -} - -struct Element { -} - -async fn send_element(_: Element) {} - -fn parse(_: &[u8]) -> Result<(), ()> { - Ok(()) -} - -fn parse_info(_: InfoResult) -> Element { - Element { } -} - -fn assert_send(_: T) {} - -fn main() { - let agent = Agent { info_result: InfoResult { node: None } }; - // FIXME: It would be nice for this to work. See #94067. - assert_send(agent.handle()); - //~^ ERROR cannot be sent between threads safely -} diff --git a/tests/ui/async-await/drop-track-field-assign-nonsend.stderr b/tests/ui/async-await/drop-track-field-assign-nonsend.stderr deleted file mode 100644 index 9fce4d61b3b6f..0000000000000 --- a/tests/ui/async-await/drop-track-field-assign-nonsend.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/drop-track-field-assign-nonsend.rs:42:17 - | -LL | assert_send(agent.handle()); - | ^^^^^^^^^^^^^^ future returned by `handle` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc` -note: future is not `Send` as this value is used across an await - --> $DIR/drop-track-field-assign-nonsend.rs:20:39 - | -LL | let mut info = self.info_result.clone(); - | -------- has type `InfoResult` which is not `Send` -... -LL | let _ = send_element(element).await; - | ^^^^^ await occurs here, with `mut info` maybe used later -note: required by a bound in `assert_send` - --> $DIR/drop-track-field-assign-nonsend.rs:37:19 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 1 previous error - diff --git a/tests/ui/async-await/drop-track-field-assign.rs b/tests/ui/async-await/drop-track-field-assign.rs deleted file mode 100644 index 491f80d062bbb..0000000000000 --- a/tests/ui/async-await/drop-track-field-assign.rs +++ /dev/null @@ -1,43 +0,0 @@ -// Derived from an ICE found in tokio-xmpp during a crater run. -//@ edition:2021 -//@ build-pass - -#![allow(dead_code)] - -#[derive(Clone)] -struct InfoResult { - node: Option -} - -struct Agent { - info_result: InfoResult -} - -impl Agent { - async fn handle(&mut self) { - let mut info = self.info_result.clone(); - info.node = Some("bar".into()); - let element = parse_info(info); - send_element(element).await; - } -} - -struct Element { -} - -async fn send_element(_: Element) {} - -fn parse(_: &[u8]) -> Result<(), ()> { - Ok(()) -} - -fn parse_info(_: InfoResult) -> Element { - Element { } -} - -fn main() { - let mut agent = Agent { - info_result: InfoResult { node: None } - }; - let _ = agent.handle(); -} diff --git a/tests/ui/borrowck/suggest-local-var-for-vector.rs b/tests/ui/borrowck/suggest-local-var-for-vector.rs deleted file mode 100644 index 40f013f6a78a7..0000000000000 --- a/tests/ui/borrowck/suggest-local-var-for-vector.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - let mut vec = vec![0u32; 420]; - vec[vec.len() - 1] = 123; //~ ERROR cannot borrow `vec` as immutable because it is also borrowed as mutable -} diff --git a/tests/ui/borrowck/suggest-local-var-for-vector.stderr b/tests/ui/borrowck/suggest-local-var-for-vector.stderr deleted file mode 100644 index d88e8b09687db..0000000000000 --- a/tests/ui/borrowck/suggest-local-var-for-vector.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error[E0502]: cannot borrow `vec` as immutable because it is also borrowed as mutable - --> $DIR/suggest-local-var-for-vector.rs:3:9 - | -LL | vec[vec.len() - 1] = 123; - | ----^^^----------- - | | || - | | |immutable borrow occurs here - | | mutable borrow later used here - | mutable borrow occurs here - | -help: try adding a local storing this... - --> $DIR/suggest-local-var-for-vector.rs:3:9 - | -LL | vec[vec.len() - 1] = 123; - | ^^^^^^^^^ -help: ...and then using that local here - --> $DIR/suggest-local-var-for-vector.rs:3:8 - | -LL | vec[vec.len() - 1] = 123; - | ^^^^^^^^^^^^^^^ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0502`. diff --git a/tests/ui/codegen/normalization-overflow/recursion-issue-105275.rs b/tests/ui/codegen/normalization-overflow/recursion-issue-105275.rs deleted file mode 100644 index 98bbfd4420dc6..0000000000000 --- a/tests/ui/codegen/normalization-overflow/recursion-issue-105275.rs +++ /dev/null @@ -1,28 +0,0 @@ -//@ build-fail -//@ compile-flags: -Copt-level=0 - -pub fn encode_num(n: u32, mut writer: Writer) -> Result<(), Writer::Error> { - if n > 15 { - encode_num(n / 16, &mut writer)?; - //~^ ERROR: reached the recursion limit while instantiating - } - Ok(()) -} - -pub trait ExampleWriter { - type Error; -} - -impl<'a, T: ExampleWriter> ExampleWriter for &'a mut T { - type Error = T::Error; -} - -struct Error; - -impl ExampleWriter for Error { - type Error = (); -} - -fn main() { - encode_num(69, &mut Error).unwrap(); -} diff --git a/tests/ui/codegen/normalization-overflow/recursion-issue-105275.stderr b/tests/ui/codegen/normalization-overflow/recursion-issue-105275.stderr deleted file mode 100644 index 94fba4621d0a0..0000000000000 --- a/tests/ui/codegen/normalization-overflow/recursion-issue-105275.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: reached the recursion limit while instantiating `encode_num::<&mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut &mut Error>` - --> $DIR/recursion-issue-105275.rs:6:9 - | -LL | encode_num(n / 16, &mut writer)?; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: `encode_num` defined here - --> $DIR/recursion-issue-105275.rs:4:1 - | -LL | pub fn encode_num(n: u32, mut writer: Writer) -> Result<(), Writer::Error> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/consts/const-blocks/migrate-fail.rs b/tests/ui/consts/const-blocks/migrate-fail.rs deleted file mode 100644 index e7dbb68d920e5..0000000000000 --- a/tests/ui/consts/const-blocks/migrate-fail.rs +++ /dev/null @@ -1,22 +0,0 @@ -#![allow(warnings)] - -// Some type that is not copyable. -struct Bar; - -mod non_constants { - use crate::Bar; - - fn no_impl_copy_empty_value_multiple_elements() { - let x = None; - let arr: [Option; 2] = [x; 2]; - //~^ ERROR the trait bound `Bar: Copy` is not satisfied [E0277] - } - - fn no_impl_copy_value_multiple_elements() { - let x = Some(Bar); - let arr: [Option; 2] = [x; 2]; - //~^ ERROR the trait bound `Bar: Copy` is not satisfied [E0277] - } -} - -fn main() {} diff --git a/tests/ui/consts/const-blocks/migrate-fail.stderr b/tests/ui/consts/const-blocks/migrate-fail.stderr deleted file mode 100644 index 3c116026e5804..0000000000000 --- a/tests/ui/consts/const-blocks/migrate-fail.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0277]: the trait bound `Bar: Copy` is not satisfied - --> $DIR/migrate-fail.rs:11:38 - | -LL | let arr: [Option; 2] = [x; 2]; - | ^ the trait `Copy` is not implemented for `Bar` - | - = note: required for `Option` to implement `Copy` - = note: the `Copy` trait is required because this value will be copied for each element of the array - = help: consider using `core::array::from_fn` to initialize the array - = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information -help: consider annotating `Bar` with `#[derive(Copy)]` - | -LL + #[derive(Copy)] -LL | struct Bar; - | - -error[E0277]: the trait bound `Bar: Copy` is not satisfied - --> $DIR/migrate-fail.rs:17:38 - | -LL | let arr: [Option; 2] = [x; 2]; - | ^ the trait `Copy` is not implemented for `Bar` - | - = note: required for `Option` to implement `Copy` - = note: the `Copy` trait is required because this value will be copied for each element of the array - = help: consider using `core::array::from_fn` to initialize the array - = help: see https://doc.rust-lang.org/stable/std/array/fn.from_fn.html for more information -help: consider annotating `Bar` with `#[derive(Copy)]` - | -LL + #[derive(Copy)] -LL | struct Bar; - | - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/consts/const-blocks/migrate-pass.rs b/tests/ui/consts/const-blocks/migrate-pass.rs deleted file mode 100644 index 629d4db0dc6f1..0000000000000 --- a/tests/ui/consts/const-blocks/migrate-pass.rs +++ /dev/null @@ -1,125 +0,0 @@ -//@ check-pass -#![allow(warnings)] - -// Some type that is not copyable. -struct Bar; - -mod constants { - use crate::Bar; - - fn no_impl_copy_empty_value_no_elements() { - const FOO: Option = None; - const ARR: [Option; 0] = [FOO; 0]; - } - - fn no_impl_copy_empty_value_single_element() { - const FOO: Option = None; - const ARR: [Option; 1] = [FOO; 1]; - } - - fn no_impl_copy_empty_value_multiple_elements() { - const FOO: Option = None; - const ARR: [Option; 2] = [FOO; 2]; - } - - fn no_impl_copy_value_no_elements() { - const FOO: Option = Some(Bar); - const ARR: [Option; 0] = [FOO; 0]; - } - - fn no_impl_copy_value_single_element() { - const FOO: Option = Some(Bar); - const ARR: [Option; 1] = [FOO; 1]; - } - - fn no_impl_copy_value_multiple_elements() { - const FOO: Option = Some(Bar); - const ARR: [Option; 2] = [FOO; 2]; - } - - fn impl_copy_empty_value_no_elements() { - const FOO: Option = None; - const ARR: [Option; 0] = [FOO; 0]; - } - - fn impl_copy_empty_value_one_element() { - const FOO: Option = None; - const ARR: [Option; 1] = [FOO; 1]; - } - - fn impl_copy_empty_value_multiple_elements() { - const FOO: Option = None; - const ARR: [Option; 2] = [FOO; 2]; - } - - fn impl_copy_value_no_elements() { - const FOO: Option = Some(4); - const ARR: [Option; 0] = [FOO; 0]; - } - - fn impl_copy_value_one_element() { - const FOO: Option = Some(4); - const ARR: [Option; 1] = [FOO; 1]; - } - - fn impl_copy_value_multiple_elements() { - const FOO: Option = Some(4); - const ARR: [Option; 2] = [FOO; 2]; - } -} - -mod non_constants { - use crate::Bar; - - fn no_impl_copy_empty_value_no_elements() { - let x = None; - let arr: [Option; 0] = [x; 0]; - } - - fn no_impl_copy_empty_value_single_element() { - let x = None; - let arr: [Option; 1] = [x; 1]; - } - - fn no_impl_copy_value_no_elements() { - let x = Some(Bar); - let arr: [Option; 0] = [x; 0]; - } - - fn no_impl_copy_value_single_element() { - let x = Some(Bar); - let arr: [Option; 1] = [x; 1]; - } - - fn impl_copy_empty_value_no_elements() { - let x: Option = None; - let arr: [Option; 0] = [x; 0]; - } - - fn impl_copy_empty_value_one_element() { - let x: Option = None; - let arr: [Option; 1] = [x; 1]; - } - - fn impl_copy_empty_value_multiple_elements() { - let x: Option = None; - let arr: [Option; 2] = [x; 2]; - } - - fn impl_copy_value_no_elements() { - let x: Option = Some(4); - let arr: [Option; 0] = [x; 0]; - } - - fn impl_copy_value_one_element() { - let x: Option = Some(4); - let arr: [Option; 1] = [x; 1]; - } - - fn impl_copy_value_multiple_elements() { - let x: Option = Some(4); - let arr: [Option; 2] = [x; 2]; - } -} - -fn main() {} diff --git a/tests/ui/consts/issue-29914-2.rs b/tests/ui/consts/issue-29914-2.rs index 36a82f5b95012..575cd30e229d9 100644 --- a/tests/ui/consts/issue-29914-2.rs +++ b/tests/ui/consts/issue-29914-2.rs @@ -1,6 +1,7 @@ //@ run-pass const ARR: [usize; 5] = [5, 4, 3, 2, 1]; +const BLA: usize = ARR[ARR[3]]; fn main() { - assert_eq!(3, ARR[ARR[3]]); + assert_eq!(3, BLA); } diff --git a/tests/ui/consts/issue-29914-3.rs b/tests/ui/consts/issue-29914-3.rs deleted file mode 100644 index 575cd30e229d9..0000000000000 --- a/tests/ui/consts/issue-29914-3.rs +++ /dev/null @@ -1,7 +0,0 @@ -//@ run-pass -const ARR: [usize; 5] = [5, 4, 3, 2, 1]; -const BLA: usize = ARR[ARR[3]]; - -fn main() { - assert_eq!(3, BLA); -} diff --git a/tests/ui/coroutine/derived-drop-parent-expr.rs b/tests/ui/coroutine/derived-drop-parent-expr.rs index cc217e4960e90..96872ab1cf9f7 100644 --- a/tests/ui/coroutine/derived-drop-parent-expr.rs +++ b/tests/ui/coroutine/derived-drop-parent-expr.rs @@ -1,6 +1,6 @@ //@ build-pass -//! Like drop-tracking-parent-expression, but also tests that this doesn't ICE when building MIR +//! Like parent-expression, but also tests that this doesn't ICE when building MIR #![feature(coroutines, stmt_expr_attributes)] fn assert_send(_thing: T) {} diff --git a/tests/ui/coroutine/drop-tracking-parent-expression.rs b/tests/ui/coroutine/drop-tracking-parent-expression.rs deleted file mode 100644 index 702cbc88ae4b0..0000000000000 --- a/tests/ui/coroutine/drop-tracking-parent-expression.rs +++ /dev/null @@ -1,70 +0,0 @@ -//@ dont-require-annotations: NOTE - -#![feature(coroutines, negative_impls, rustc_attrs, stmt_expr_attributes)] - -macro_rules! type_combinations { - ( - $( $name:ident => { $( $tt:tt )* } );* $(;)? - ) => { $( - mod $name { - $( $tt )* - - impl !Sync for Client {} - impl !Send for Client {} - } - - // Struct update syntax. This fails because the Client used in the update is considered - // dropped *after* the yield. - { - let g = #[coroutine] move || match drop($name::Client { ..$name::Client::default() }) { - //~^ NOTE `significant_drop::Client` which is not `Send` - //~| NOTE `insignificant_dtor::Client` which is not `Send` - //~| NOTE `derived_drop::Client` which is not `Send` - _ => yield, - }; - assert_send(g); - //~^ ERROR cannot be sent between threads - //~| ERROR cannot be sent between threads - //~| ERROR cannot be sent between threads - } - - // Simple owned value. This works because the Client is considered moved into `drop`, - // even though the temporary expression doesn't end until after the yield. - { - let g = #[coroutine] move || match drop($name::Client::default()) { - _ => yield, - }; - assert_send(g); - } - )* } -} - -fn assert_send(_thing: T) {} - -fn main() { - type_combinations!( - // OK - copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; - // NOT OK: MIR borrowck thinks that this is used after the yield, even though - // this has no `Drop` impl and only the drops of the fields are observable. - // FIXME: this should compile. - derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; - // NOT OK - significant_drop => { - #[derive(Default)] - pub struct Client; - impl Drop for Client { - fn drop(&mut self) {} - } - }; - // NOT OK (we need to agree with MIR borrowck) - insignificant_dtor => { - #[derive(Default)] - #[rustc_insignificant_dtor] - pub struct Client; - impl Drop for Client { - fn drop(&mut self) {} - } - }; - ); -} diff --git a/tests/ui/coroutine/drop-tracking-parent-expression.stderr b/tests/ui/coroutine/drop-tracking-parent-expression.stderr deleted file mode 100644 index fe8c17c12946d..0000000000000 --- a/tests/ui/coroutine/drop-tracking-parent-expression.stderr +++ /dev/null @@ -1,128 +0,0 @@ -error: coroutine cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:25:13 - | -LL | assert_send(g); - | ^^^^^^^^^^^^^^ coroutine is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | -help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:19:34: 19:41}`, the trait `Send` is not implemented for `derived_drop::Client` - --> $DIR/drop-tracking-parent-expression.rs:51:46 - | -LL | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; - | ^^^^^^^^^^^^^^^^^ -note: coroutine is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:23:22 - | -LL | let g = #[coroutine] move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `derived_drop::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:42:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: coroutine cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:25:13 - | -LL | assert_send(g); - | ^^^^^^^^^^^^^^ coroutine is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | -help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:19:34: 19:41}`, the trait `Send` is not implemented for `significant_drop::Client` - --> $DIR/drop-tracking-parent-expression.rs:55:13 - | -LL | pub struct Client; - | ^^^^^^^^^^^^^^^^^ -note: coroutine is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:23:22 - | -LL | let g = #[coroutine] move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `significant_drop::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:42:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: coroutine cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:25:13 - | -LL | assert_send(g); - | ^^^^^^^^^^^^^^ coroutine is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | -help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:19:34: 19:41}`, the trait `Send` is not implemented for `insignificant_dtor::Client` - --> $DIR/drop-tracking-parent-expression.rs:64:13 - | -LL | pub struct Client; - | ^^^^^^^^^^^^^^^^^ -note: coroutine is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:23:22 - | -LL | let g = #[coroutine] move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `insignificant_dtor::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:42:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 3 previous errors - diff --git a/tests/ui/cross-crate/tuple-like-structs-cross-crate-7899.rs b/tests/ui/cross-crate/tuple-like-structs-cross-crate-7899.rs deleted file mode 100644 index ce3ea7dd5796a..0000000000000 --- a/tests/ui/cross-crate/tuple-like-structs-cross-crate-7899.rs +++ /dev/null @@ -1,10 +0,0 @@ -// https://github.com/rust-lang/rust/issues/7899 -//@ run-pass -#![allow(unused_variables)] -//@ aux-build:aux-7899.rs - -extern crate aux_7899 as testcrate; - -fn main() { - let f = testcrate::V2(1.0f32, 2.0f32); -} diff --git a/tests/ui/error-codes/E0508-fail.rs b/tests/ui/error-codes/E0508-fail.rs deleted file mode 100644 index 072c3d66183e3..0000000000000 --- a/tests/ui/error-codes/E0508-fail.rs +++ /dev/null @@ -1,6 +0,0 @@ -struct NonCopy; - -fn main() { - let array = [NonCopy; 1]; - let _value = array[0]; //~ ERROR [E0508] -} diff --git a/tests/ui/error-codes/E0508-fail.stderr b/tests/ui/error-codes/E0508-fail.stderr deleted file mode 100644 index fcfac399e0df5..0000000000000 --- a/tests/ui/error-codes/E0508-fail.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array - --> $DIR/E0508-fail.rs:5:18 - | -LL | let _value = array[0]; - | ^^^^^^^^ - | | - | cannot move out of here - | move occurs because `array[_]` has type `NonCopy`, which does not implement the `Copy` trait - | -note: if `NonCopy` implemented `Clone`, you could clone the value - --> $DIR/E0508-fail.rs:1:1 - | -LL | struct NonCopy; - | ^^^^^^^^^^^^^^ consider implementing `Clone` for this type -... -LL | let _value = array[0]; - | -------- you could clone this value -help: consider borrowing here - | -LL | let _value = &array[0]; - | + - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0508`. diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs index 00de48278b27c..16039f177b4de 100644 --- a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs +++ b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs @@ -1,8 +1,13 @@ -struct Ref<'a, 'b> { a: &'a u32, b: &'b u32 } +// Regression test for #91831 -fn foo(mut y: Ref, x: &u32) { - y.b = x; - //~^ ERROR lifetime may not live long enough +struct Foo<'a>(&'a i32); + +impl<'a> Foo<'a> { + fn modify(&'a mut self) {} +} + +fn bar(foo: &mut Foo) { + foo.modify(); //~ ERROR lifetime may not live long enough } -fn main() { } +fn main() {} diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr index d07b821444ccc..02c0658ff1730 100644 --- a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr +++ b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr @@ -1,17 +1,20 @@ error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:4:5 + --> $DIR/ex3-both-anon-regions-one-is-struct-4.rs:10:5 | -LL | fn foo(mut y: Ref, x: &u32) { - | ----- - let's call the lifetime of this reference `'1` +LL | fn bar(foo: &mut Foo) { + | --- - let's call the lifetime of this reference `'1` | | - | has type `Ref<'_, '2>` -LL | y.b = x; - | ^^^^^^^ assignment requires that `'1` must outlive `'2` + | has type `&mut Foo<'2>` +LL | foo.modify(); + | ^^^^^^^^^^^^ argument requires that `'1` must outlive `'2` | + = note: requirement occurs because of a mutable reference to `Foo<'_>` + = note: mutable references are invariant over their type parameter + = help: see for more information about variance help: consider introducing a named lifetime parameter | -LL | fn foo<'a>(mut y: Ref<'a, 'a>, x: &'a u32) { - | ++++ ++++++++ ++ +LL | fn bar<'a>(foo: &'a mut Foo<'a>) { + | ++++ ++ ++++ error: aborting due to 1 previous error diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.rs b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.rs deleted file mode 100644 index 16039f177b4de..0000000000000 --- a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Regression test for #91831 - -struct Foo<'a>(&'a i32); - -impl<'a> Foo<'a> { - fn modify(&'a mut self) {} -} - -fn bar(foo: &mut Foo) { - foo.modify(); //~ ERROR lifetime may not live long enough -} - -fn main() {} diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.stderr b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.stderr deleted file mode 100644 index f02b65230b6eb..0000000000000 --- a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-5.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: lifetime may not live long enough - --> $DIR/ex3-both-anon-regions-one-is-struct-5.rs:10:5 - | -LL | fn bar(foo: &mut Foo) { - | --- - let's call the lifetime of this reference `'1` - | | - | has type `&mut Foo<'2>` -LL | foo.modify(); - | ^^^^^^^^^^^^ argument requires that `'1` must outlive `'2` - | - = note: requirement occurs because of a mutable reference to `Foo<'_>` - = note: mutable references are invariant over their type parameter - = help: see for more information about variance -help: consider introducing a named lifetime parameter - | -LL | fn bar<'a>(foo: &'a mut Foo<'a>) { - | ++++ ++ ++++ - -error: aborting due to 1 previous error - diff --git a/tests/ui/lint/auxiliary/stability_cfg2.rs b/tests/ui/lint/auxiliary/stability_cfg2.rs deleted file mode 100644 index ed69d26a9cb1e..0000000000000 --- a/tests/ui/lint/auxiliary/stability_cfg2.rs +++ /dev/null @@ -1,5 +0,0 @@ -//@ compile-flags:--cfg foo - -#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "none"))] -#![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))] -#![feature(staged_api)] diff --git a/tests/ui/parser/issues/issue-1802-2.rs b/tests/ui/parser/issues/issue-1802-2.rs deleted file mode 100644 index 3c34b0d8febbc..0000000000000 --- a/tests/ui/parser/issues/issue-1802-2.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn log(a: i32, b: i32) {} - -fn main() { - let error = 42; - log(error, 0b); - //~^ ERROR no valid digits found for number -} diff --git a/tests/ui/parser/issues/issue-1802-2.stderr b/tests/ui/parser/issues/issue-1802-2.stderr deleted file mode 100644 index 7c802e4bdf7b6..0000000000000 --- a/tests/ui/parser/issues/issue-1802-2.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0768]: no valid digits found for number - --> $DIR/issue-1802-2.rs:5:16 - | -LL | log(error, 0b); - | ^^ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0768`. diff --git a/tests/ui/tool-attributes/tool_lints_2018_preview.rs b/tests/ui/tool-attributes/tool_lints_2018_preview.rs deleted file mode 100644 index 458eca19ed6c7..0000000000000 --- a/tests/ui/tool-attributes/tool_lints_2018_preview.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ run-pass - -#![deny(unknown_lints)] - -#[allow(clippy::almost_swapped)] -fn main() {} diff --git a/tests/ui/type-alias-impl-trait/issue-58951-2.rs b/tests/ui/type-alias-impl-trait/issue-58951-2.rs deleted file mode 100644 index de6b9e741198b..0000000000000 --- a/tests/ui/type-alias-impl-trait/issue-58951-2.rs +++ /dev/null @@ -1,16 +0,0 @@ -//@ check-pass - -#![feature(type_alias_impl_trait)] - -pub type A = impl Iterator; - -#[define_opaque(A)] -pub fn def_a() -> A { - 0..1 -} - -pub fn use_a() { - def_a().map(|x| x); -} - -fn main() {} diff --git a/tests/ui/type-alias-impl-trait/issue-74761-2.rs b/tests/ui/type-alias-impl-trait/issue-74761-2.rs deleted file mode 100644 index e556025adee6e..0000000000000 --- a/tests/ui/type-alias-impl-trait/issue-74761-2.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![feature(impl_trait_in_assoc_type)] - -pub trait A { - type B; - fn f(&self) -> Self::B; -} -impl<'a, 'b> A for () { - //~^ ERROR the lifetime parameter `'a` is not constrained - //~| ERROR the lifetime parameter `'b` is not constrained - type B = impl core::fmt::Debug; - - fn f(&self) -> Self::B {} - //~^ ERROR expected generic lifetime parameter -} - -fn main() {} diff --git a/tests/ui/type-alias-impl-trait/issue-74761-2.stderr b/tests/ui/type-alias-impl-trait/issue-74761-2.stderr deleted file mode 100644 index 26babc29000c0..0000000000000 --- a/tests/ui/type-alias-impl-trait/issue-74761-2.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates - --> $DIR/issue-74761-2.rs:7:6 - | -LL | impl<'a, 'b> A for () { - | ^^ unconstrained lifetime parameter - -error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, self type, or predicates - --> $DIR/issue-74761-2.rs:7:10 - | -LL | impl<'a, 'b> A for () { - | ^^ unconstrained lifetime parameter - -error[E0792]: expected generic lifetime parameter, found `'_` - --> $DIR/issue-74761-2.rs:12:28 - | -LL | impl<'a, 'b> A for () { - | -- this generic parameter must be used with a generic lifetime parameter -... -LL | fn f(&self) -> Self::B {} - | ^^ - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0207, E0792. -For more information about an error, try `rustc --explain E0207`. diff --git a/tests/ui/unsized-locals/issue-30276-feature-flagged.rs b/tests/ui/unsized-locals/issue-30276-feature-flagged.rs deleted file mode 100644 index 6b67ebbec1c0c..0000000000000 --- a/tests/ui/unsized-locals/issue-30276-feature-flagged.rs +++ /dev/null @@ -1,6 +0,0 @@ -struct Test([i32]); - -fn main() { - let _x: fn(_) -> Test = Test; - //~^ ERROR the size for values of type `[i32]` cannot be known at compilation time -} diff --git a/tests/ui/unsized-locals/issue-30276-feature-flagged.stderr b/tests/ui/unsized-locals/issue-30276-feature-flagged.stderr deleted file mode 100644 index a7bf27a0c4acc..0000000000000 --- a/tests/ui/unsized-locals/issue-30276-feature-flagged.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0277]: the size for values of type `[i32]` cannot be known at compilation time - --> $DIR/issue-30276-feature-flagged.rs:4:29 - | -LL | let _x: fn(_) -> Test = Test; - | ^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `[i32]` - = note: all function arguments must have a statically known size - = help: unsized fn params are gated as an unstable feature - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0277`.