1
Fork 0
rust/tests/ui/cast/cast_lit_suffix-issue-138392.stderr
xizheyin bc6047a5a7
Use lit span when suggesting suffix lit cast
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-14 20:44:49 +08:00

31 lines
848 B
Text

error[E0308]: mismatched types
--> $DIR/cast_lit_suffix-issue-138392.rs:4:18
|
LL | let _x: u8 = (4i32);
| -- ^^^^^^ expected `u8`, found `i32`
| |
| expected due to this
|
help: change the type of the numeric literal from `i32` to `u8`
|
LL - let _x: u8 = (4i32);
LL + let _x: u8 = (4u8);
|
error[E0308]: mismatched types
--> $DIR/cast_lit_suffix-issue-138392.rs:5:18
|
LL | let _y: u8 = (4.0f32);
| -- ^^^^^^^^ expected `u8`, found `f32`
| |
| expected due to this
|
help: change the type of the numeric literal from `f32` to `u8`
|
LL - let _y: u8 = (4.0f32);
LL + let _y: u8 = (4u8);
|
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.