about summary refs log tree commit diff
path: root/tests/ui/trait-bounds
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-11-28 18:43:28 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-12-07 21:26:20 +0000
commitd13c34828e4bc0924f7e27bae994f9afecaf0ab4 (patch)
tree16f36afad2817d252a1e6dc10c5b87f1a950718f /tests/ui/trait-bounds
parent68253e14ee3d0e81881bc908b07b5ba141daf226 (diff)
downloadrust-d13c34828e4bc0924f7e27bae994f9afecaf0ab4.tar.gz
rust-d13c34828e4bc0924f7e27bae994f9afecaf0ab4.zip
reword trait bound suggestion message to include the bounds
Diffstat (limited to 'tests/ui/trait-bounds')
-rw-r--r--tests/ui/trait-bounds/restrict-assoc-type-of-generic-bound.stderr2
-rw-r--r--tests/ui/trait-bounds/unstable-trait-suggestion.rs2
-rw-r--r--tests/ui/trait-bounds/unstable-trait-suggestion.stderr2
3 files changed, 3 insertions, 3 deletions
diff --git a/tests/ui/trait-bounds/restrict-assoc-type-of-generic-bound.stderr b/tests/ui/trait-bounds/restrict-assoc-type-of-generic-bound.stderr
index 7aa32557af2..c1dda283d9d 100644
--- a/tests/ui/trait-bounds/restrict-assoc-type-of-generic-bound.stderr
+++ b/tests/ui/trait-bounds/restrict-assoc-type-of-generic-bound.stderr
@@ -11,7 +11,7 @@ LL |     return a.bar();
    = note: expected type parameter `B`
              found associated type `<A as MyTrait>::T`
    = note: the caller chooses a type for `B` which can be different from `<A as MyTrait>::T`
-help: consider further restricting this bound
+help: consider further restricting this bound with trait `<T = B>`
    |
 LL | pub fn foo<A: MyTrait<T = B>, B>(a: A) -> B {
    |                      +++++++
diff --git a/tests/ui/trait-bounds/unstable-trait-suggestion.rs b/tests/ui/trait-bounds/unstable-trait-suggestion.rs
index fff61e4a6f5..c49e2a34033 100644
--- a/tests/ui/trait-bounds/unstable-trait-suggestion.rs
+++ b/tests/ui/trait-bounds/unstable-trait-suggestion.rs
@@ -9,7 +9,7 @@ pub trait Unstable {}
 fn foo<T: Unstable>(_: T) {}
 
 #[stable(feature = "unit_test", since = "1.0.0")]
-pub fn demo<T>(t: T) { //~ HELP consider restricting type parameter `T` but it is an `unstable` trait
+pub fn demo<T>(t: T) { //~ HELP consider restricting type parameter `T` with unstable trait `Unstable`
     foo(t) //~ ERROR E0277
 }
 fn main() {}
diff --git a/tests/ui/trait-bounds/unstable-trait-suggestion.stderr b/tests/ui/trait-bounds/unstable-trait-suggestion.stderr
index 7b5e9f8d124..a326965b683 100644
--- a/tests/ui/trait-bounds/unstable-trait-suggestion.stderr
+++ b/tests/ui/trait-bounds/unstable-trait-suggestion.stderr
@@ -11,7 +11,7 @@ note: required by a bound in `foo`
    |
 LL | fn foo<T: Unstable>(_: T) {}
    |           ^^^^^^^^ required by this bound in `foo`
-help: consider restricting type parameter `T` but it is an `unstable` trait
+help: consider restricting type parameter `T` with unstable trait `Unstable`
    |
 LL | pub fn demo<T: Unstable>(t: T) {
    |              ++++++++++