about summary refs log tree commit diff
path: root/tests/ui/structs-enums
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-07-09 22:30:26 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-02-10 20:21:39 +0000
commitf0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d (patch)
treee97d87013709bda13934fdc452a2a459a069876a /tests/ui/structs-enums
parent8c04e395952022a451138dc4dbead6dd6ae65203 (diff)
downloadrust-f0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d.tar.gz
rust-f0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d.zip
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;
   |
```
Diffstat (limited to 'tests/ui/structs-enums')
-rw-r--r--tests/ui/structs-enums/issue-103869.stderr5
-rw-r--r--tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr5
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/ui/structs-enums/issue-103869.stderr b/tests/ui/structs-enums/issue-103869.stderr
index 2334e5e9712..10e0f29f876 100644
--- a/tests/ui/structs-enums/issue-103869.stderr
+++ b/tests/ui/structs-enums/issue-103869.stderr
@@ -10,8 +10,9 @@ LL |     vec: Vec<usize>,
    = help: enum variants can be `Variant`, `Variant = <integer>`, `Variant(Type, ..., TypeN)` or `Variant { fields: Types }`
 help: perhaps you meant to use `struct` here
    |
-LL | struct VecOrMap {
-   | ~~~~~~
+LL - enum VecOrMap {
+LL + struct VecOrMap {
+   |
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr b/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr
index 664a00e3303..231bada006c 100644
--- a/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr
+++ b/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.stderr
@@ -6,8 +6,9 @@ LL |     if let Some(Foo::Bar {_}) = foo {}
    |
 help: to omit remaining fields, use `..`
    |
-LL |     if let Some(Foo::Bar {..}) = foo {}
-   |                           ~~
+LL -     if let Some(Foo::Bar {_}) = foo {}
+LL +     if let Some(Foo::Bar {..}) = foo {}
+   |
 
 error: aborting due to 1 previous error