about summary refs log tree commit diff
path: root/tests/ui/array-slice-vec
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-02-11 02:35:06 +0000
committerbors <bors@rust-lang.org>2025-02-11 02:35:06 +0000
commitffa9afef183a3496a277c8da2e61403582a99508 (patch)
treebf1e5eab83cd6cd41a8e671f4d8b95a6893dca90 /tests/ui/array-slice-vec
parent6171d944aea415a3023d4262e0895aa3b18c771f (diff)
parentf0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d (diff)
downloadrust-ffa9afef183a3496a277c8da2e61403582a99508.tar.gz
rust-ffa9afef183a3496a277c8da2e61403582a99508.zip
Auto merge of #127541 - estebank:diff-suggestions, r=petrochenkov
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;
   |
```

before:
```
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.0f64;
   |               ~~~~
```
r? `@oli-obk`
Diffstat (limited to 'tests/ui/array-slice-vec')
-rw-r--r--tests/ui/array-slice-vec/suggest-array-length.stderr20
1 files changed, 12 insertions, 8 deletions
diff --git a/tests/ui/array-slice-vec/suggest-array-length.stderr b/tests/ui/array-slice-vec/suggest-array-length.stderr
index b71be306780..14d10832e36 100644
--- a/tests/ui/array-slice-vec/suggest-array-length.stderr
+++ b/tests/ui/array-slice-vec/suggest-array-length.stderr
@@ -6,8 +6,9 @@ LL |     const Foo: [i32; _] = [1, 2, 3];
    |
 help: replace this with a fully-specified type
    |
-LL |     const Foo: [i32; 3] = [1, 2, 3];
-   |                ~~~~~~~~
+LL -     const Foo: [i32; _] = [1, 2, 3];
+LL +     const Foo: [i32; 3] = [1, 2, 3];
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
   --> $DIR/suggest-array-length.rs:7:26
@@ -17,8 +18,9 @@ LL |     const REF_FOO: &[u8; _] = &[1];
    |
 help: replace this with a fully-specified type
    |
-LL |     const REF_FOO: &[u8; 1] = &[1];
-   |                    ~~~~~~~~
+LL -     const REF_FOO: &[u8; _] = &[1];
+LL +     const REF_FOO: &[u8; 1] = &[1];
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
   --> $DIR/suggest-array-length.rs:9:26
@@ -28,8 +30,9 @@ LL |     static Statik: [i32; _] = [1, 2, 3];
    |
 help: replace this with a fully-specified type
    |
-LL |     static Statik: [i32; 3] = [1, 2, 3];
-   |                    ~~~~~~~~
+LL -     static Statik: [i32; _] = [1, 2, 3];
+LL +     static Statik: [i32; 3] = [1, 2, 3];
+   |
 
 error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
   --> $DIR/suggest-array-length.rs:11:30
@@ -39,8 +42,9 @@ LL |     static REF_STATIK: &[u8; _] = &[1];
    |
 help: replace this with a fully-specified type
    |
-LL |     static REF_STATIK: &[u8; 1] = &[1];
-   |                        ~~~~~~~~
+LL -     static REF_STATIK: &[u8; _] = &[1];
+LL +     static REF_STATIK: &[u8; 1] = &[1];
+   |
 
 error[E0658]: using `_` for array lengths is unstable
   --> $DIR/suggest-array-length.rs:13:20