about summary refs log tree commit diff
path: root/tests/debuginfo/enum-thinlto.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-01-29 19:07:36 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-01-29 19:07:36 +0000
commit44d8ecbfb85d1649a4267e33c847f79a125b99f9 (patch)
tree08ac1622c80cafc94c16380b68fbd5e0e229e341 /tests/debuginfo/enum-thinlto.rs
parentfb4bca04fa1bde2f7db1b31a59e066f7bebd7fc6 (diff)
downloadrust-44d8ecbfb85d1649a4267e33c847f79a125b99f9.tar.gz
rust-44d8ecbfb85d1649a4267e33c847f79a125b99f9.zip
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.
Diffstat (limited to 'tests/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions