1
Fork 0
rust/tests/ui/inference/char-as-str-single.stderr
Esteban Küber f0845adb0c Show diff suggestion format on verbose replacement
```
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
  --> $DIR/attempted-access-non-fatal.rs:7:15
   |
LL |     let _ = 2.l;
   |               ^
   |
help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix
   |
LL -     let _ = 2.l;
LL +     let _ = 2.0f64;
   |
```
2025-02-10 20:21:39 +00:00

59 lines
1.5 KiB
Text

error[E0308]: mismatched types
--> $DIR/char-as-str-single.rs:9:19
|
LL | let _: char = "a";
| ---- ^^^ expected `char`, found `&str`
| |
| expected due to this
|
help: if you meant to write a `char` literal, use single quotes
|
LL - let _: char = "a";
LL + let _: char = 'a';
|
error[E0308]: mismatched types
--> $DIR/char-as-str-single.rs:10:19
|
LL | let _: char = "人";
| ---- ^^^^ expected `char`, found `&str`
| |
| expected due to this
|
help: if you meant to write a `char` literal, use single quotes
|
LL - let _: char = "人";
LL + let _: char = '人';
|
error[E0308]: mismatched types
--> $DIR/char-as-str-single.rs:11:19
|
LL | let _: char = "'";
| ---- ^^^ expected `char`, found `&str`
| |
| expected due to this
|
help: if you meant to write a `char` literal, use single quotes
|
LL - let _: char = "'";
LL + let _: char = '\'';
|
error[E0308]: mismatched types
--> $DIR/char-as-str-single.rs:18:9
|
LL | match c {
| - this expression has type `char`
LL | "A" => {}
| ^^^ expected `char`, found `&str`
|
help: if you meant to write a `char` literal, use single quotes
|
LL - "A" => {}
LL + 'A' => {}
|
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.