diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-11-28 22:20:44 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-12-07 21:37:15 +0000 |
| commit | cb4db0a6c6ef642c13f7f08d449acde0336a2c8c (patch) | |
| tree | 8af15f172471bfb64b3fa1a1a4d6a7d6e1b20e93 /tests | |
| parent | d860e5b088a0030c55b8850d10ab231d86fc2969 (diff) | |
| download | rust-cb4db0a6c6ef642c13f7f08d449acde0336a2c8c.tar.gz rust-cb4db0a6c6ef642c13f7f08d449acde0336a2c8c.zip | |
Account for `impl Trait` in "add bound" suggestion message
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/suggestions/bound-suggestions.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/suggestions/clone-bounds-121524.rs | 2 | ||||
| -rw-r--r-- | tests/ui/suggestions/clone-bounds-121524.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/suggestions/restrict-type-argument.stderr | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/tests/ui/suggestions/bound-suggestions.stderr b/tests/ui/suggestions/bound-suggestions.stderr index be0ff66092e..e30deb11398 100644 --- a/tests/ui/suggestions/bound-suggestions.stderr +++ b/tests/ui/suggestions/bound-suggestions.stderr @@ -5,7 +5,7 @@ LL | println!("{:?}", t); | ^ `impl Sized` cannot be formatted using `{:?}` because it doesn't implement `Debug` | = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) -help: consider further restricting type parameter `impl Sized` with trait `Debug` +help: consider restricting opaque type `impl Sized` with trait `Debug` | LL | fn test_impl(t: impl Sized + std::fmt::Debug) { | +++++++++++++++++ diff --git a/tests/ui/suggestions/clone-bounds-121524.rs b/tests/ui/suggestions/clone-bounds-121524.rs index 7bc3bfe0117..b7760584ebb 100644 --- a/tests/ui/suggestions/clone-bounds-121524.rs +++ b/tests/ui/suggestions/clone-bounds-121524.rs @@ -6,7 +6,7 @@ trait DoesAThing {} impl DoesAThing for ThingThatDoesAThing {} fn clones_impl_ref_inline(thing: &impl DoesAThing) { - //~^ HELP consider further restricting type parameter `impl DoesAThing` with trait `Clone` + //~^ HELP consider restricting opaque type `impl DoesAThing` with trait `Clone` drops_impl_owned(thing.clone()); //~ ERROR E0277 //~^ NOTE copies the reference //~| NOTE the trait `DoesAThing` is not implemented for `&impl DoesAThing` diff --git a/tests/ui/suggestions/clone-bounds-121524.stderr b/tests/ui/suggestions/clone-bounds-121524.stderr index 92897d87188..bdba8d7e472 100644 --- a/tests/ui/suggestions/clone-bounds-121524.stderr +++ b/tests/ui/suggestions/clone-bounds-121524.stderr @@ -9,7 +9,7 @@ note: this `clone()` copies the reference, which does not do anything, because ` | LL | drops_impl_owned(thing.clone()); | ^^^^^ -help: consider further restricting type parameter `impl DoesAThing` with trait `Clone` +help: consider restricting opaque type `impl DoesAThing` with trait `Clone` | LL | fn clones_impl_ref_inline(thing: &impl DoesAThing + Clone) { | +++++++ diff --git a/tests/ui/suggestions/restrict-type-argument.stderr b/tests/ui/suggestions/restrict-type-argument.stderr index dc647fefc28..4b6da8a9cd9 100644 --- a/tests/ui/suggestions/restrict-type-argument.stderr +++ b/tests/ui/suggestions/restrict-type-argument.stderr @@ -11,7 +11,7 @@ note: required by a bound in `is_send` | LL | fn is_send<T: Send>(val: T) {} | ^^^^ required by this bound in `is_send` -help: consider further restricting type parameter `impl Sync` with trait `Send` +help: consider restricting opaque type `impl Sync` with trait `Send` | LL | fn use_impl_sync(val: impl Sync + std::marker::Send) { | +++++++++++++++++++ |
