]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/cross-return-site-inference.stderr
Auto merge of #95031 - compiler-errors:param-env-cache, r=Aaron1011
[rust.git] / src / test / ui / impl-trait / cross-return-site-inference.stderr
1 error[E0277]: `?` couldn't convert the error to `impl Debug`
2   --> $DIR/cross-return-site-inference.rs:32:18
3    |
4 LL | fn muh() -> Result<(), impl std::fmt::Debug> {
5    |             -------------------------------- expected `impl Debug` because of this
6 LL |     Err("whoops")?;
7    |                  ^ the trait `From<&str>` is not implemented for `impl Debug`
8    |
9    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
10    = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, &str>>` for `Result<(), impl Debug>`
11
12 error[E0277]: the trait bound `impl Debug: From<&str>` is not satisfied
13   --> $DIR/cross-return-site-inference.rs:37:16
14    |
15 LL |     return Err(From::from("foo"));
16    |                ^^^^^^^^^^ the trait `From<&str>` is not implemented for `impl Debug`
17
18 error[E0277]: the trait bound `impl Debug: From<&str>` is not satisfied
19   --> $DIR/cross-return-site-inference.rs:42:9
20    |
21 LL |     Err(From::from("foo"))
22    |         ^^^^^^^^^^ the trait `From<&str>` is not implemented for `impl Debug`
23
24 error: aborting due to 3 previous errors
25
26 For more information about this error, try `rustc --explain E0277`.