Added comment to

`tests/ui/mismatched_types/assignment-mismatch-various-types.rs`

merge `tests/ui/mismatched_types/main.rs`
This commit is contained in:
reddevilmidzy 2025-12-03 23:38:42 +09:00
parent 07b1dadf86
commit 245096b6ae
4 changed files with 15 additions and 21 deletions

View file

@ -1,6 +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
//~| NOTE expected `char`, found `u8`
//~| NOTE expected due to this
}

View file

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

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