Rollup merge of #149595 - reddevilmidzy:t9, r=Kivooeo

Tidying up `tests/ui/issues` tests [2/N]

> [!NOTE]
> Intermediate commits are intended to help review, but will be squashed add comment commit prior to merge.

part of rust-lang/rust#133895
This commit is contained in:
Matthias Krüger 2025-12-04 09:22:14 +01:00 committed by GitHub
commit 6e8e08cc32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 49 additions and 80 deletions

View file

@ -1,6 +0,0 @@
fn main() {
let _p: char = 100;
//~^ ERROR mismatched types
//~| NOTE expected `char`, found `u8`
//~| NOTE expected due to this
}

View file

@ -1,11 +0,0 @@
error[E0308]: mismatched types
--> $DIR/issue-3477.rs:2:20
|
LL | let _p: char = 100;
| ---- ^^^ expected `char`, found `u8`
| |
| expected due to this
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.

View file

@ -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}`

View file

@ -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`.

View file

@ -1,2 +0,0 @@
fn main() { format!("{:?}", None); }
//~^ ERROR type annotations needed [E0282]

View file

@ -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::<T>); }
| +++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0282`.

View file

@ -0,0 +1,9 @@
//! regression test for <https://github.com/rust-lang/rust/issues/3477>
fn main() {
let x: u32 = ();
//~^ ERROR mismatched types
let _p: char = 100;
//~^ ERROR mismatched types
}

View file

@ -0,0 +1,19 @@
error[E0308]: mismatched types
--> $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 2 previous errors
For more information about this error, try `rustc --explain E0308`.

View file

@ -1,4 +0,0 @@
fn main() {
let x: u32 = ( //~ ERROR mismatched types
);
}

View file

@ -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`.

View file

@ -1,3 +1,4 @@
//! regression test for <https://github.com/rust-lang/rust/issues/3109>
//@ run-pass
pub fn main() {
println!("{:?}", ("hi there!", "you"));

View file

@ -1,3 +1,5 @@
//! regression test for <https://github.com/rust-lang/rust/issues/51874>
fn main() {
let a = (1.0).pow(1.0); //~ ERROR can't call method `pow` on ambiguous numeric type
}

View file

@ -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);
| ^^^

View file

@ -1,5 +1,9 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/5062>.
fn foo() {
format!("{:?}", None); //~ ERROR type annotations needed [E0282]
}
fn main() {
None; //~ ERROR type annotations needed [E0282]
}

View file

@ -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::<T>);
| +++++
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::<T>;
| +++++
error: aborting due to 1 previous error
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0282`.