about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEsteban Kuber <esteban@kuber.com.ar>2022-03-26 21:26:02 +0000
committerEsteban Kuber <esteban@kuber.com.ar>2022-04-04 21:06:33 +0000
commitac8cbbd200cfa77f03a8560f0305810e4f8f1375 (patch)
treed6756bd5fee07ccdd73f5026283c5a80343f1700 /src
parent3aac307ca62f6d6c5b3612d3dfe80b6eeae8ba15 (diff)
downloadrust-ac8cbbd200cfa77f03a8560f0305810e4f8f1375.tar.gz
rust-ac8cbbd200cfa77f03a8560f0305810e4f8f1375.zip
Fix #90970, doesn't address #87437
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr1
-rw-r--r--src/test/ui/impl-trait/cross-return-site-inference.stderr1
-rw-r--r--src/test/ui/impl-trait/nested_impl_trait.stderr2
-rw-r--r--src/test/ui/issues/issue-32709.stderr1
-rw-r--r--src/test/ui/kindck/kindck-impl-type-params.stderr2
-rw-r--r--src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs12
-rw-r--r--src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr23
7 files changed, 42 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr
index 4202cbae7eb..27f5dce9fb2 100644
--- a/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr
@@ -6,6 +6,7 @@ LL |     writes_to_specific_path(&cap);
    |     |
    |     required by a bound introduced by this call
    |
+   = help: the trait `Delegates<U>` is implemented for `T`
 note: required because of the requirements on the impl of `Contains<(), true>` for `&C`
   --> $DIR/issue-85848.rs:21:12
    |
diff --git a/src/test/ui/impl-trait/cross-return-site-inference.stderr b/src/test/ui/impl-trait/cross-return-site-inference.stderr
index 06afb938c5f..d458c7be783 100644
--- a/src/test/ui/impl-trait/cross-return-site-inference.stderr
+++ b/src/test/ui/impl-trait/cross-return-site-inference.stderr
@@ -7,6 +7,7 @@ LL |     Err("whoops")?;
    |                  ^ the trait `From<&str>` is not implemented for `impl Debug`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
+   = help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
    = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, &str>>` for `Result<(), impl Debug>`
 
 error[E0277]: the trait bound `impl Debug: From<&str>` is not satisfied
diff --git a/src/test/ui/impl-trait/nested_impl_trait.stderr b/src/test/ui/impl-trait/nested_impl_trait.stderr
index 26b48c7cdf7..bb4ae5e8282 100644
--- a/src/test/ui/impl-trait/nested_impl_trait.stderr
+++ b/src/test/ui/impl-trait/nested_impl_trait.stderr
@@ -52,6 +52,7 @@ error[E0277]: the trait bound `impl Debug: From<impl Into<u32>>` is not satisfie
 LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
    |                                              ^^^^^^^^^^^^^^^^^^^^^ the trait `From<impl Into<u32>>` is not implemented for `impl Debug`
    |
+   = help: the trait `Into<U>` is implemented for `T`
    = note: required because of the requirements on the impl of `Into<impl Debug>` for `impl Into<u32>`
 
 error[E0277]: the trait bound `impl Debug: From<impl Into<u32>>` is not satisfied
@@ -60,6 +61,7 @@ error[E0277]: the trait bound `impl Debug: From<impl Into<u32>>` is not satisfie
 LL |     fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
    |                                  ^^^^^^^^^^^^^^^^^^^^^ the trait `From<impl Into<u32>>` is not implemented for `impl Debug`
    |
+   = help: the trait `Into<U>` is implemented for `T`
    = note: required because of the requirements on the impl of `Into<impl Debug>` for `impl Into<u32>`
 
 error: aborting due to 8 previous errors
diff --git a/src/test/ui/issues/issue-32709.stderr b/src/test/ui/issues/issue-32709.stderr
index b4c3f148e32..ed5addcbec5 100644
--- a/src/test/ui/issues/issue-32709.stderr
+++ b/src/test/ui/issues/issue-32709.stderr
@@ -7,6 +7,7 @@ LL |     Err(5)?;
    |           ^ the trait `From<{integer}>` is not implemented for `()`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
+   = help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
    = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, {integer}>>` for `Result<i32, ()>`
 
 error: aborting due to previous error
diff --git a/src/test/ui/kindck/kindck-impl-type-params.stderr b/src/test/ui/kindck/kindck-impl-type-params.stderr
index 3558f0c9e62..64bbc841b33 100644
--- a/src/test/ui/kindck/kindck-impl-type-params.stderr
+++ b/src/test/ui/kindck/kindck-impl-type-params.stderr
@@ -80,6 +80,7 @@ error[E0277]: the trait bound `String: Copy` is not satisfied
 LL |     let a = t as Box<dyn Gettable<String>>;
    |             ^ the trait `Copy` is not implemented for `String`
    |
+   = help: the trait `Gettable<T>` is implemented for `S<T>`
 note: required because of the requirements on the impl of `Gettable<String>` for `S<String>`
   --> $DIR/kindck-impl-type-params.rs:14:32
    |
@@ -93,6 +94,7 @@ error[E0277]: the trait bound `Foo: Copy` is not satisfied
 LL |     let a: Box<dyn Gettable<Foo>> = t;
    |                                     ^ the trait `Copy` is not implemented for `Foo`
    |
+   = help: the trait `Gettable<T>` is implemented for `S<T>`
 note: required because of the requirements on the impl of `Gettable<Foo>` for `S<Foo>`
   --> $DIR/kindck-impl-type-params.rs:14:32
    |
diff --git a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs
new file mode 100644
index 00000000000..2720f94a3c1
--- /dev/null
+++ b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs
@@ -0,0 +1,12 @@
+fn strip_lf(s: &str) -> &str {
+    s.strip_suffix(b'\n').unwrap_or(s)
+    //~^ ERROR expected a `FnMut<(char,)>` closure, found `u8`
+    //~| NOTE expected an `FnMut<(char,)>` closure, found `u8`
+    //~| NOTE required by a bound introduced by this call
+    //~| HELP the trait `FnMut<(char,)>` is not implemented for `u8`
+    //~| HELP the following other types implement trait `Pattern<'_>`:
+    //~| NOTE required because of the requirements on the impl of `Pattern<'_>` for `u8`
+
+}
+
+fn main() {}
diff --git a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
new file mode 100644
index 00000000000..37cba4189d7
--- /dev/null
+++ b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
@@ -0,0 +1,23 @@
+error[E0277]: expected a `FnMut<(char,)>` closure, found `u8`
+  --> $DIR/assoc-fn-bound-root-obligation.rs:2:20
+   |
+LL |     s.strip_suffix(b'\n').unwrap_or(s)
+   |       ------------ ^^^^^ expected an `FnMut<(char,)>` closure, found `u8`
+   |       |
+   |       required by a bound introduced by this call
+   |
+   = help: the trait `FnMut<(char,)>` is not implemented for `u8`
+   = help: the following other types implement trait `Pattern<'_>`:
+             &'b String
+             &'b [char; N]
+             &'b [char]
+             &'b str
+             &'c &'b str
+             [char; N]
+             char
+             pattern::MultiCharEqPattern<C>
+   = note: required because of the requirements on the impl of `Pattern<'_>` for `u8`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.