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/unsized | |
| 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/unsized')
| -rw-r--r-- | tests/ui/unsized/box-instead-of-dyn-fn.stderr | 5 | ||||
| -rw-r--r-- | tests/ui/unsized/issue-91803.stderr | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/ui/unsized/box-instead-of-dyn-fn.stderr b/tests/ui/unsized/box-instead-of-dyn-fn.stderr index 1836d5dfffe..b666718262d 100644 --- a/tests/ui/unsized/box-instead-of-dyn-fn.stderr +++ b/tests/ui/unsized/box-instead-of-dyn-fn.stderr @@ -6,8 +6,9 @@ LL | fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> dyn Fn() + 'a { | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> impl Fn() + 'a { - | ~~~~ +LL - fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> dyn Fn() + 'a { +LL + fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> impl Fn() + 'a { + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL ~ fn print_on_or_the_other<'a>(a: i32, b: &'a String) -> Box<dyn Fn() + 'a> { diff --git a/tests/ui/unsized/issue-91803.stderr b/tests/ui/unsized/issue-91803.stderr index e0fde4b1c1b..037ec2ceaa5 100644 --- a/tests/ui/unsized/issue-91803.stderr +++ b/tests/ui/unsized/issue-91803.stderr @@ -6,8 +6,9 @@ LL | fn or<'a>(first: &'static dyn Foo<'a>) -> dyn Foo<'a> { | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn or<'a>(first: &'static dyn Foo<'a>) -> impl Foo<'a> { - | ~~~~ +LL - fn or<'a>(first: &'static dyn Foo<'a>) -> dyn Foo<'a> { +LL + fn or<'a>(first: &'static dyn Foo<'a>) -> impl Foo<'a> { + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL | fn or<'a>(first: &'static dyn Foo<'a>) -> Box<dyn Foo<'a>> { |
