diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-07-09 22:30:26 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2025-02-10 20:21:39 +0000 |
| commit | f0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d (patch) | |
| tree | e97d87013709bda13934fdc452a2a459a069876a /tests/ui/rust-2021 | |
| parent | 8c04e395952022a451138dc4dbead6dd6ae65203 (diff) | |
| download | rust-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/rust-2021')
5 files changed, 21 insertions, 14 deletions
diff --git a/tests/ui/rust-2021/future-prelude-collision-shadow.stderr b/tests/ui/rust-2021/future-prelude-collision-shadow.stderr index d9c0fa47eca..966613e12b5 100644 --- a/tests/ui/rust-2021/future-prelude-collision-shadow.stderr +++ b/tests/ui/rust-2021/future-prelude-collision-shadow.stderr @@ -14,8 +14,9 @@ LL + use std::convert::TryInto; | help: there is a method `into` with a similar name | -LL | let _: u32 = 3u8.into().unwrap(); - | ~~~~ +LL - let _: u32 = 3u8.try_into().unwrap(); +LL + let _: u32 = 3u8.into().unwrap(); + | error: aborting due to 1 previous error diff --git a/tests/ui/rust-2021/ice-return-unsized-can-impl-2.stderr b/tests/ui/rust-2021/ice-return-unsized-can-impl-2.stderr index b8a9a5c8129..ac19f91881d 100644 --- a/tests/ui/rust-2021/ice-return-unsized-can-impl-2.stderr +++ b/tests/ui/rust-2021/ice-return-unsized-can-impl-2.stderr @@ -7,8 +7,9 @@ LL | fn concrete(b: B) -> B; = note: `B` it is dyn-incompatible, so it can't be `dyn` help: use a new generic type parameter, constrained by `B` | -LL | fn concrete<T: B>(b: T) -> B; - | ++++++ ~ +LL - fn concrete(b: B) -> B; +LL + fn concrete<T: B>(b: T) -> B; + | help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference | LL | fn concrete(b: impl B) -> B; @@ -34,8 +35,9 @@ LL | fn f(a: A) -> A; = note: `A` it is dyn-incompatible, so it can't be `dyn` help: use a new generic type parameter, constrained by `A` | -LL | fn f<T: A>(a: T) -> A; - | ++++++ ~ +LL - fn f(a: A) -> A; +LL + fn f<T: A>(a: T) -> A; + | help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference | LL | fn f(a: impl A) -> A; diff --git a/tests/ui/rust-2021/ice-return-unsized-can-impl.stderr b/tests/ui/rust-2021/ice-return-unsized-can-impl.stderr index c0969570e92..463c6892ca2 100644 --- a/tests/ui/rust-2021/ice-return-unsized-can-impl.stderr +++ b/tests/ui/rust-2021/ice-return-unsized-can-impl.stderr @@ -7,8 +7,9 @@ LL | fn g(new: B) -> B; = note: `B` it is dyn-incompatible, so it can't be `dyn` help: use a new generic type parameter, constrained by `B` | -LL | fn g<T: B>(new: T) -> B; - | ++++++ ~ +LL - fn g(new: B) -> B; +LL + fn g<T: B>(new: T) -> B; + | help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference | LL | fn g(new: impl B) -> B; diff --git a/tests/ui/rust-2021/ice-unsized-fn-params-2.stderr b/tests/ui/rust-2021/ice-unsized-fn-params-2.stderr index d35c8ab3e42..7f837bbe50f 100644 --- a/tests/ui/rust-2021/ice-unsized-fn-params-2.stderr +++ b/tests/ui/rust-2021/ice-unsized-fn-params-2.stderr @@ -7,8 +7,9 @@ LL | fn guard(_s: Copy) -> bool { = note: `Copy` it is dyn-incompatible, so it can't be `dyn` help: use a new generic type parameter, constrained by `Copy` | -LL | fn guard<T: Copy>(_s: T) -> bool { - | +++++++++ ~ +LL - fn guard(_s: Copy) -> bool { +LL + fn guard<T: Copy>(_s: T) -> bool { + | help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference | LL | fn guard(_s: impl Copy) -> bool { diff --git a/tests/ui/rust-2021/ice-unsized-fn-params.stderr b/tests/ui/rust-2021/ice-unsized-fn-params.stderr index d56e9981a28..c31500ba800 100644 --- a/tests/ui/rust-2021/ice-unsized-fn-params.stderr +++ b/tests/ui/rust-2021/ice-unsized-fn-params.stderr @@ -7,8 +7,9 @@ LL | fn g(b: B) -> B; = note: `B` it is dyn-incompatible, so it can't be `dyn` help: use a new generic type parameter, constrained by `B` | -LL | fn g<T: B>(b: T) -> B; - | ++++++ ~ +LL - fn g(b: B) -> B; +LL + fn g<T: B>(b: T) -> B; + | help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference | LL | fn g(b: impl B) -> B; @@ -34,8 +35,9 @@ LL | fn f(a: A) -> A; = note: `A` it is dyn-incompatible, so it can't be `dyn` help: use a new generic type parameter, constrained by `A` | -LL | fn f<T: A>(a: T) -> A; - | ++++++ ~ +LL - fn f(a: A) -> A; +LL + fn f<T: A>(a: T) -> A; + | help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference | LL | fn f(a: impl A) -> A; |
