rust/tests/ui/suggestions/only-suggest-removal-of-conversion-method-calls.stderr
Esteban Küber 44d8ecbfb8 Only suggest removal of as_* and to_ conversion methods on E0308
Instead of

```
error[E0308]: mismatched types
 --> tests/ui/suggestions/only-suggest-removal-of-conversion-method-calls.rs:9:5
  |
4 | fn get_name() -> String {
  |                  ------ expected `String` because of return type
...
9 |     your_name.trim() //~ ERROR E0308
  |     ^^^^^^^^^^^^^^^^ expected `String`, found `&str`
  |
help: try removing the method call
  |
9 -     your_name.trim()
9 +     your_name
```

output

```
error[E0308]: mismatched types
  --> $DIR/only-suggest-removal-of-conversion-method-calls.rs:9:5
   |
LL | fn get_name() -> String {
   |                  ------ expected `String` because of return type
...
LL |     your_name.trim()
   |     ^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()`
   |     |
   |     expected `String`, found `&str`
```

Fix #114329.
2024-01-29 19:07:36 +00:00

15 lines
474 B
Plaintext

error[E0308]: mismatched types
--> $DIR/only-suggest-removal-of-conversion-method-calls.rs:9:5
|
LL | fn get_name() -> String {
| ------ expected `String` because of return type
...
LL | your_name.trim()
| ^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()`
| |
| expected `String`, found `&str`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.