summary refs log tree commit diff
path: root/tests/ui/repeat-expr
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/repeat-expr
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/repeat-expr')
-rw-r--r--tests/ui/repeat-expr/repeat_count.stderr10
-rw-r--r--tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.stderr35
2 files changed, 27 insertions, 18 deletions
diff --git a/tests/ui/repeat-expr/repeat_count.stderr b/tests/ui/repeat-expr/repeat_count.stderr
index c4aebfb0e20..34e29e83666 100644
--- a/tests/ui/repeat-expr/repeat_count.stderr
+++ b/tests/ui/repeat-expr/repeat_count.stderr
@@ -6,8 +6,9 @@ LL |     let a = [0; n];
    |
 help: consider using `const` instead of `let`
    |
-LL |     const n: /* Type */ = 1;
-   |     ~~~~~  ++++++++++++
+LL -     let n = 1;
+LL +     const n: /* Type */ = 1;
+   |
 
 error[E0308]: mismatched types
   --> $DIR/repeat_count.rs:7:17
@@ -63,8 +64,9 @@ LL |     let f = [0; 4u8];
    |
 help: change the type of the numeric literal from `u8` to `usize`
    |
-LL |     let f = [0; 4usize];
-   |                  ~~~~~
+LL -     let f = [0; 4u8];
+LL +     let f = [0; 4usize];
+   |
 
 error: aborting due to 9 previous errors
 
diff --git a/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.stderr b/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.stderr
index 95eddbde9e6..ce2022374f7 100644
--- a/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.stderr
+++ b/tests/ui/repeat-expr/typo-in-repeat-expr-issue-80173.stderr
@@ -6,8 +6,9 @@ LL |     let a = ["a", 10];
    |
 help: replace the comma with a semicolon to create an array
    |
-LL |     let a = ["a"; 10];
-   |                 ~
+LL -     let a = ["a", 10];
+LL +     let a = ["a"; 10];
+   |
 
 error[E0308]: mismatched types
   --> $DIR/typo-in-repeat-expr-issue-80173.rs:20:20
@@ -17,8 +18,9 @@ LL |     let b = [Type, size_b];
    |
 help: replace the comma with a semicolon to create an array
    |
-LL |     let b = [Type; size_b];
-   |                  ~
+LL -     let b = [Type, size_b];
+LL +     let b = [Type; size_b];
+   |
 
 error[E0308]: mismatched types
   --> $DIR/typo-in-repeat-expr-issue-80173.rs:25:20
@@ -48,8 +50,9 @@ LL |     let f = ["f", get_size()];
    |
 help: replace the comma with a semicolon to create an array
    |
-LL |     let f = ["f"; get_size()];
-   |                 ~
+LL -     let f = ["f", get_size()];
+LL +     let f = ["f"; get_size()];
+   |
 
 error[E0308]: mismatched types
   --> $DIR/typo-in-repeat-expr-issue-80173.rs:40:19
@@ -65,8 +68,9 @@ LL |     let g = vec![String::new(), 10];
    |
 help: replace the comma with a semicolon to create a vector
    |
-LL |     let g = vec![String::new(); 10];
-   |                               ~
+LL -     let g = vec![String::new(), 10];
+LL +     let g = vec![String::new(); 10];
+   |
 
 error[E0308]: mismatched types
   --> $DIR/typo-in-repeat-expr-issue-80173.rs:49:24
@@ -76,8 +80,9 @@ LL |     let h = vec![Type, dyn_size];
    |
 help: replace the comma with a semicolon to create a vector
    |
-LL |     let h = vec![Type; dyn_size];
-   |                      ~
+LL -     let h = vec![Type, dyn_size];
+LL +     let h = vec![Type; dyn_size];
+   |
 
 error[E0308]: mismatched types
   --> $DIR/typo-in-repeat-expr-issue-80173.rs:53:24
@@ -87,8 +92,9 @@ LL |     let i = vec![Type, get_dyn_size()];
    |
 help: replace the comma with a semicolon to create a vector
    |
-LL |     let i = vec![Type; get_dyn_size()];
-   |                      ~
+LL -     let i = vec![Type, get_dyn_size()];
+LL +     let i = vec![Type; get_dyn_size()];
+   |
 
 error[E0308]: mismatched types
   --> $DIR/typo-in-repeat-expr-issue-80173.rs:57:23
@@ -98,8 +104,9 @@ LL |     let k = vec!['c', 10];
    |
 help: replace the comma with a semicolon to create a vector
    |
-LL |     let k = vec!['c'; 10];
-   |                     ~
+LL -     let k = vec!['c', 10];
+LL +     let k = vec!['c'; 10];
+   |
 
 error[E0308]: mismatched types
   --> $DIR/typo-in-repeat-expr-issue-80173.rs:61:24