Teach diagnostics to have correctly padded lists
Make the suggestion list have a correct padding:
```
error[E0308]: mismatched types
--> file.rs:3:20
|
3 | let x: usize = "";
| ^^ expected usize, found reference
|
= note: expected type `usize`
= note: found type `&'static str`
= help: here are some functions which might fulfill your needs:
- .len()
- .foo()
- .bar()
```
This commit is contained in:
parent
7e38a89a7b
commit
43b10fa8ed
6 changed files with 49 additions and 17 deletions
|
|
@ -37,9 +37,9 @@ error[E0308]: mismatched types
|
|||
= note: expected type `()`
|
||||
= note: found type `std::result::Result<bool, std::io::Error>`
|
||||
= help: here are some functions which might fulfill your needs:
|
||||
- .unwrap()
|
||||
- .unwrap_err()
|
||||
- .unwrap_or_default()
|
||||
- .unwrap()
|
||||
- .unwrap_err()
|
||||
- .unwrap_or_default()
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ error[E0308]: mismatched types
|
|||
= note: expected type `usize`
|
||||
= note: found type `std::string::String`
|
||||
= help: here are some functions which might fulfill your needs:
|
||||
- .capacity()
|
||||
- .len()
|
||||
- .capacity()
|
||||
- .len()
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/coerce-suggestions.rs:23:19
|
||||
|
|
@ -19,10 +19,10 @@ error[E0308]: mismatched types
|
|||
= note: expected type `&str`
|
||||
= note: found type `std::string::String`
|
||||
= help: here are some functions which might fulfill your needs:
|
||||
- .as_str()
|
||||
- .trim()
|
||||
- .trim_left()
|
||||
- .trim_right()
|
||||
- .as_str()
|
||||
- .trim()
|
||||
- .trim_left()
|
||||
- .trim_right()
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/coerce-suggestions.rs:30:10
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue