From 0b18b4fbbc5c0a60a1d373b5a1b30d21f55923d1 Mon Sep 17 00:00:00 2001 From: León Orell Valerian Liehr Date: Mon, 27 Jan 2025 02:28:04 +0100 Subject: Remove all dead files inside tests/ui/ --- src/tools/tidy/src/ui_tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 5ef07911429..d66ba157d10 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -17,7 +17,7 @@ use ignore::Walk; const ENTRY_LIMIT: u32 = 901; // FIXME: The following limits should be reduced eventually. -const ISSUES_ENTRY_LIMIT: u32 = 1662; +const ISSUES_ENTRY_LIMIT: u32 = 1658; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files -- cgit 1.4.1-3-g733a5 From c38951b28064f09ab73901b1de244654e1520072 Mon Sep 17 00:00:00 2001 From: León Orell Valerian Liehr Date: Mon, 27 Jan 2025 00:29:25 +0100 Subject: Make a previously unreachable UI test reachable --- src/tools/tidy/src/issues.txt | 1 - tests/ui/issues/auxiliary/issue-111011.rs | 10 ------ tests/ui/issues/auxiliary/issue-111011.stderr | 34 ------------------ .../dont-suggest-boxing-async-closure-body.rs | 12 +++++++ .../dont-suggest-boxing-async-closure-body.stderr | 41 ++++++++++++++++++++++ 5 files changed, 53 insertions(+), 45 deletions(-) delete mode 100644 tests/ui/issues/auxiliary/issue-111011.rs delete mode 100644 tests/ui/issues/auxiliary/issue-111011.stderr create mode 100644 tests/ui/suggestions/dont-suggest-boxing-async-closure-body.rs create mode 100644 tests/ui/suggestions/dont-suggest-boxing-async-closure-body.stderr (limited to 'src') diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 5865664fc89..839d23fb9a7 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -1385,7 +1385,6 @@ ui/issue-18502.rs ui/issue-24106.rs ui/issue-76387-llvm-miscompile.rs ui/issues-71798.rs -ui/issues/auxiliary/issue-111011.rs ui/issues/auxiliary/issue-11224.rs ui/issues/auxiliary/issue-11508.rs ui/issues/auxiliary/issue-11529.rs diff --git a/tests/ui/issues/auxiliary/issue-111011.rs b/tests/ui/issues/auxiliary/issue-111011.rs deleted file mode 100644 index 0c1a8ce1cf6..00000000000 --- a/tests/ui/issues/auxiliary/issue-111011.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ edition:2021 - -fn foo(x: impl FnOnce() -> Box) {} -// just to make sure async closures can still be suggested for boxing. -fn bar(x: Box X>) {} - -fn main() { - foo(async move || {}); //~ ERROR mismatched types - bar(async move || {}); //~ ERROR mismatched types -} diff --git a/tests/ui/issues/auxiliary/issue-111011.stderr b/tests/ui/issues/auxiliary/issue-111011.stderr deleted file mode 100644 index c0b48c5842f..00000000000 --- a/tests/ui/issues/auxiliary/issue-111011.stderr +++ /dev/null @@ -1,34 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-111011.rs:10:23 - | -LL | foo(async move || {}); - | ^^ expected `Box<_>`, found `async` closure body - | - = note: expected struct `Box<_>` - found `async` closure body `[async closure body@$DIR/issue-111011.rs:10:23: 10:25]` - = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html - -error[E0308]: mismatched types - --> $DIR/issue-111011.rs:11:9 - | -LL | bar(async move || {}); - | --- ^^^^^^^^^^^^^^^^ expected `Box _>`, found closure - | | - | arguments to this function are incorrect - | - = note: expected struct `Box<(dyn FnOnce() -> _ + 'static)>` - found closure `{closure@$DIR/issue-111011.rs:11:9: 11:22}` - = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html -note: function defined here - --> $DIR/issue-111011.rs:7:4 - | -LL | fn bar(x: Box X>) {} - | ^^^ ------------------------- -help: store this in the heap by calling `Box::new` - | -LL | bar(Box::new(async move || {})); - | +++++++++ + - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/suggestions/dont-suggest-boxing-async-closure-body.rs b/tests/ui/suggestions/dont-suggest-boxing-async-closure-body.rs new file mode 100644 index 00000000000..47a590668dd --- /dev/null +++ b/tests/ui/suggestions/dont-suggest-boxing-async-closure-body.rs @@ -0,0 +1,12 @@ +//@ edition:2021 +// issue: https://github.com/rust-lang/rust/issues/111011 + +fn foo(x: impl FnOnce() -> Box) {} +// just to make sure async closures can still be suggested for boxing. +fn bar(x: Box X>) {} + +fn main() { + foo(async move || {}); + //~^ ERROR expected `{async closure@dont-suggest-boxing-async-closure-body.rs:9:9}` to be a closure that returns `Box<_>` + bar(async move || {}); //~ ERROR mismatched types +} diff --git a/tests/ui/suggestions/dont-suggest-boxing-async-closure-body.stderr b/tests/ui/suggestions/dont-suggest-boxing-async-closure-body.stderr new file mode 100644 index 00000000000..db2a3b9a9c1 --- /dev/null +++ b/tests/ui/suggestions/dont-suggest-boxing-async-closure-body.stderr @@ -0,0 +1,41 @@ +error[E0271]: expected `{async closure@dont-suggest-boxing-async-closure-body.rs:9:9}` to be a closure that returns `Box<_>`, but it returns `{async closure body@$DIR/dont-suggest-boxing-async-closure-body.rs:9:23: 9:25}` + --> $DIR/dont-suggest-boxing-async-closure-body.rs:9:9 + | +LL | foo(async move || {}); + | --- ^^^^^^^^^^^^^^^^ expected `Box<_>`, found `async` closure body + | | + | required by a bound introduced by this call + | + = note: expected struct `Box<_>` + found `async` closure body `{async closure body@$DIR/dont-suggest-boxing-async-closure-body.rs:9:23: 9:25}` +note: required by a bound in `foo` + --> $DIR/dont-suggest-boxing-async-closure-body.rs:4:31 + | +LL | fn foo(x: impl FnOnce() -> Box) {} + | ^^^^^^ required by this bound in `foo` + +error[E0308]: mismatched types + --> $DIR/dont-suggest-boxing-async-closure-body.rs:11:9 + | +LL | bar(async move || {}); + | --- ^^^^^^^^^^^^^^^^ expected `Box _>`, found `{async closure@dont-suggest-boxing-async-closure-body.rs:11:9}` + | | + | arguments to this function are incorrect + | + = note: expected struct `Box<(dyn FnOnce() -> _ + 'static)>` + found closure `{async closure@$DIR/dont-suggest-boxing-async-closure-body.rs:11:9: 11:22}` + = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html +note: function defined here + --> $DIR/dont-suggest-boxing-async-closure-body.rs:6:4 + | +LL | fn bar(x: Box X>) {} + | ^^^ ------------------------- +help: store this in the heap by calling `Box::new` + | +LL | bar(Box::new(async move || {})); + | +++++++++ + + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0271, E0308. +For more information about an error, try `rustc --explain E0271`. -- cgit 1.4.1-3-g733a5