From 5e802dd1a1723b21ffcff3af7b7fb9169f18ab42 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Wed, 3 Dec 2025 23:18:11 +0900 Subject: [PATCH 1/5] moved and deleted test tests/ui/issues/issue-4935 is duplicated of tests/ui/argument-suggestions/suggest-better-removing-issue-126246.rs --- tests/ui/issues/issue-4935.rs | 7 ------- tests/ui/issues/issue-4935.stderr | 20 ------------------- .../assignment-mismatch-various-types.rs} | 0 .../assignment-mismatch-various-types.stderr} | 0 .../debug-print-basic-tuple.rs} | 0 .../ambiguous-num-type-method-call.rs} | 0 .../ambiguous-num-type-method-call.stderr} | 0 .../type-inference-unconstrained-none-2.rs} | 0 ...ype-inference-unconstrained-none-2.stderr} | 0 9 files changed, 27 deletions(-) delete mode 100644 tests/ui/issues/issue-4935.rs delete mode 100644 tests/ui/issues/issue-4935.stderr rename tests/ui/{issues/issue-3477.rs => mismatched_types/assignment-mismatch-various-types.rs} (100%) rename tests/ui/{issues/issue-3477.stderr => mismatched_types/assignment-mismatch-various-types.stderr} (100%) rename tests/ui/{issues/issue-3109.rs => str/debug-print-basic-tuple.rs} (100%) rename tests/ui/{issues/issue-51874.rs => type-inference/ambiguous-num-type-method-call.rs} (100%) rename tests/ui/{issues/issue-51874.stderr => type-inference/ambiguous-num-type-method-call.stderr} (100%) rename tests/ui/{issues/issue-5062.rs => type-inference/type-inference-unconstrained-none-2.rs} (100%) rename tests/ui/{issues/issue-5062.stderr => type-inference/type-inference-unconstrained-none-2.stderr} (100%) diff --git a/tests/ui/issues/issue-4935.rs b/tests/ui/issues/issue-4935.rs deleted file mode 100644 index ef8a3eb32abbe..0000000000000 --- a/tests/ui/issues/issue-4935.rs +++ /dev/null @@ -1,7 +0,0 @@ -// Regression test for issue #4935 - -fn foo(a: usize) {} -//~^ NOTE defined here -fn main() { foo(5, 6) } -//~^ ERROR function takes 1 argument but 2 arguments were supplied -//~| NOTE unexpected argument #2 of type `{integer}` diff --git a/tests/ui/issues/issue-4935.stderr b/tests/ui/issues/issue-4935.stderr deleted file mode 100644 index 918f74256c034..0000000000000 --- a/tests/ui/issues/issue-4935.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/issue-4935.rs:5:13 - | -LL | fn main() { foo(5, 6) } - | ^^^ - unexpected argument #2 of type `{integer}` - | -note: function defined here - --> $DIR/issue-4935.rs:3:4 - | -LL | fn foo(a: usize) {} - | ^^^ -help: remove the extra argument - | -LL - fn main() { foo(5, 6) } -LL + fn main() { foo(5) } - | - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0061`. diff --git a/tests/ui/issues/issue-3477.rs b/tests/ui/mismatched_types/assignment-mismatch-various-types.rs similarity index 100% rename from tests/ui/issues/issue-3477.rs rename to tests/ui/mismatched_types/assignment-mismatch-various-types.rs diff --git a/tests/ui/issues/issue-3477.stderr b/tests/ui/mismatched_types/assignment-mismatch-various-types.stderr similarity index 100% rename from tests/ui/issues/issue-3477.stderr rename to tests/ui/mismatched_types/assignment-mismatch-various-types.stderr diff --git a/tests/ui/issues/issue-3109.rs b/tests/ui/str/debug-print-basic-tuple.rs similarity index 100% rename from tests/ui/issues/issue-3109.rs rename to tests/ui/str/debug-print-basic-tuple.rs diff --git a/tests/ui/issues/issue-51874.rs b/tests/ui/type-inference/ambiguous-num-type-method-call.rs similarity index 100% rename from tests/ui/issues/issue-51874.rs rename to tests/ui/type-inference/ambiguous-num-type-method-call.rs diff --git a/tests/ui/issues/issue-51874.stderr b/tests/ui/type-inference/ambiguous-num-type-method-call.stderr similarity index 100% rename from tests/ui/issues/issue-51874.stderr rename to tests/ui/type-inference/ambiguous-num-type-method-call.stderr diff --git a/tests/ui/issues/issue-5062.rs b/tests/ui/type-inference/type-inference-unconstrained-none-2.rs similarity index 100% rename from tests/ui/issues/issue-5062.rs rename to tests/ui/type-inference/type-inference-unconstrained-none-2.rs diff --git a/tests/ui/issues/issue-5062.stderr b/tests/ui/type-inference/type-inference-unconstrained-none-2.stderr similarity index 100% rename from tests/ui/issues/issue-5062.stderr rename to tests/ui/type-inference/type-inference-unconstrained-none-2.stderr From 07b1dadf86041aa058a798e52d012ab2bbb85e39 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Wed, 3 Dec 2025 23:24:39 +0900 Subject: [PATCH 2/5] Added comment to `tests/ui/type-inference/ambiguous-num-type-method-call.rs` --- tests/ui/type-inference/ambiguous-num-type-method-call.rs | 2 ++ tests/ui/type-inference/ambiguous-num-type-method-call.stderr | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/ui/type-inference/ambiguous-num-type-method-call.rs b/tests/ui/type-inference/ambiguous-num-type-method-call.rs index d9d7e36b50e9b..ee3c95ba0843b 100644 --- a/tests/ui/type-inference/ambiguous-num-type-method-call.rs +++ b/tests/ui/type-inference/ambiguous-num-type-method-call.rs @@ -1,3 +1,5 @@ +//! regression test for + fn main() { let a = (1.0).pow(1.0); //~ ERROR can't call method `pow` on ambiguous numeric type } diff --git a/tests/ui/type-inference/ambiguous-num-type-method-call.stderr b/tests/ui/type-inference/ambiguous-num-type-method-call.stderr index 5c9331b4e1e1a..3a808c06aef1c 100644 --- a/tests/ui/type-inference/ambiguous-num-type-method-call.stderr +++ b/tests/ui/type-inference/ambiguous-num-type-method-call.stderr @@ -1,5 +1,5 @@ error[E0689]: can't call method `pow` on ambiguous numeric type `{float}` - --> $DIR/issue-51874.rs:2:19 + --> $DIR/ambiguous-num-type-method-call.rs:4:19 | LL | let a = (1.0).pow(1.0); | ^^^ From 245096b6aeb99929ebf2c8da8b7f8d83f74cc97d Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Wed, 3 Dec 2025 23:38:42 +0900 Subject: [PATCH 3/5] Added comment to `tests/ui/mismatched_types/assignment-mismatch-various-types.rs` merge `tests/ui/mismatched_types/main.rs` --- .../assignment-mismatch-various-types.rs | 7 +++++-- .../assignment-mismatch-various-types.stderr | 12 ++++++++++-- tests/ui/mismatched_types/main.rs | 4 ---- tests/ui/mismatched_types/main.stderr | 13 ------------- 4 files changed, 15 insertions(+), 21 deletions(-) delete mode 100644 tests/ui/mismatched_types/main.rs delete mode 100644 tests/ui/mismatched_types/main.stderr diff --git a/tests/ui/mismatched_types/assignment-mismatch-various-types.rs b/tests/ui/mismatched_types/assignment-mismatch-various-types.rs index eb94294d5a877..903bfd9756f01 100644 --- a/tests/ui/mismatched_types/assignment-mismatch-various-types.rs +++ b/tests/ui/mismatched_types/assignment-mismatch-various-types.rs @@ -1,6 +1,9 @@ +//! regression test for + fn main() { + let x: u32 = (); + //~^ ERROR mismatched types + let _p: char = 100; //~^ ERROR mismatched types - //~| NOTE expected `char`, found `u8` - //~| NOTE expected due to this } diff --git a/tests/ui/mismatched_types/assignment-mismatch-various-types.stderr b/tests/ui/mismatched_types/assignment-mismatch-various-types.stderr index 2a4d6d2449ed4..14356fe16d3d8 100644 --- a/tests/ui/mismatched_types/assignment-mismatch-various-types.stderr +++ b/tests/ui/mismatched_types/assignment-mismatch-various-types.stderr @@ -1,11 +1,19 @@ error[E0308]: mismatched types - --> $DIR/issue-3477.rs:2:20 + --> $DIR/assignment-mismatch-various-types.rs:4:18 + | +LL | let x: u32 = (); + | --- ^^ expected `u32`, found `()` + | | + | expected due to this + +error[E0308]: mismatched types + --> $DIR/assignment-mismatch-various-types.rs:7:20 | LL | let _p: char = 100; | ---- ^^^ expected `char`, found `u8` | | | expected due to this -error: aborting due to 1 previous error +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/mismatched_types/main.rs b/tests/ui/mismatched_types/main.rs deleted file mode 100644 index e2d09dc219922..0000000000000 --- a/tests/ui/mismatched_types/main.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - let x: u32 = ( //~ ERROR mismatched types - ); -} diff --git a/tests/ui/mismatched_types/main.stderr b/tests/ui/mismatched_types/main.stderr deleted file mode 100644 index 38146cef3475a..0000000000000 --- a/tests/ui/mismatched_types/main.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/main.rs:2:18 - | -LL | let x: u32 = ( - | ____________---___^ - | | | - | | expected due to this -LL | | ); - | |_____^ expected `u32`, found `()` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0308`. From cc230fb7636306e92c55c9c9b2ec9086cd2ebc5c Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Wed, 3 Dec 2025 23:40:06 +0900 Subject: [PATCH 4/5] Added comment to `tests\ui\str\debug-print-basic-tuple.rs` --- tests/ui/str/debug-print-basic-tuple.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ui/str/debug-print-basic-tuple.rs b/tests/ui/str/debug-print-basic-tuple.rs index 89beaa2222732..7e2b86f56293d 100644 --- a/tests/ui/str/debug-print-basic-tuple.rs +++ b/tests/ui/str/debug-print-basic-tuple.rs @@ -1,3 +1,4 @@ +//! regression test for //@ run-pass pub fn main() { println!("{:?}", ("hi there!", "you")); From d1bc6e3459bee4c318371b282d5e0a284e57d279 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Wed, 3 Dec 2025 23:43:21 +0900 Subject: [PATCH 5/5] Merged `tests\ui\type-inference\type-inference-unconstrained-none.rs` --- .../type-inference-unconstrained-none-2.rs | 2 -- .../type-inference-unconstrained-none-2.stderr | 14 -------------- .../type-inference-unconstrained-none.rs | 4 ++++ .../type-inference-unconstrained-none.stderr | 15 +++++++++++++-- 4 files changed, 17 insertions(+), 18 deletions(-) delete mode 100644 tests/ui/type-inference/type-inference-unconstrained-none-2.rs delete mode 100644 tests/ui/type-inference/type-inference-unconstrained-none-2.stderr diff --git a/tests/ui/type-inference/type-inference-unconstrained-none-2.rs b/tests/ui/type-inference/type-inference-unconstrained-none-2.rs deleted file mode 100644 index 2db0a8e25b462..0000000000000 --- a/tests/ui/type-inference/type-inference-unconstrained-none-2.rs +++ /dev/null @@ -1,2 +0,0 @@ -fn main() { format!("{:?}", None); } - //~^ ERROR type annotations needed [E0282] diff --git a/tests/ui/type-inference/type-inference-unconstrained-none-2.stderr b/tests/ui/type-inference/type-inference-unconstrained-none-2.stderr deleted file mode 100644 index 0839ece79aaff..0000000000000 --- a/tests/ui/type-inference/type-inference-unconstrained-none-2.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/issue-5062.rs:1:29 - | -LL | fn main() { format!("{:?}", None); } - | ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option` - | -help: consider specifying the generic argument - | -LL | fn main() { format!("{:?}", None::); } - | +++++ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/tests/ui/type-inference/type-inference-unconstrained-none.rs b/tests/ui/type-inference/type-inference-unconstrained-none.rs index 38a506763c761..5b24e866b5216 100644 --- a/tests/ui/type-inference/type-inference-unconstrained-none.rs +++ b/tests/ui/type-inference/type-inference-unconstrained-none.rs @@ -1,5 +1,9 @@ //! Regression test for . +fn foo() { + format!("{:?}", None); //~ ERROR type annotations needed [E0282] +} + fn main() { None; //~ ERROR type annotations needed [E0282] } diff --git a/tests/ui/type-inference/type-inference-unconstrained-none.stderr b/tests/ui/type-inference/type-inference-unconstrained-none.stderr index 80572b845e84f..54260c03b76a1 100644 --- a/tests/ui/type-inference/type-inference-unconstrained-none.stderr +++ b/tests/ui/type-inference/type-inference-unconstrained-none.stderr @@ -1,5 +1,16 @@ error[E0282]: type annotations needed - --> $DIR/type-inference-unconstrained-none.rs:4:5 + --> $DIR/type-inference-unconstrained-none.rs:4:21 + | +LL | format!("{:?}", None); + | ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option` + | +help: consider specifying the generic argument + | +LL | format!("{:?}", None::); + | +++++ + +error[E0282]: type annotations needed + --> $DIR/type-inference-unconstrained-none.rs:8:5 | LL | None; | ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option` @@ -9,6 +20,6 @@ help: consider specifying the generic argument LL | None::; | +++++ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0282`.