]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/cross-return-site-inference.stderr
Rollup merge of #95504 - jyn514:library-alias, r=Mark-Simulacrum
[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    = help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
11    = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, &str>>` for `Result<(), impl Debug>`
12
13 error[E0277]: the trait bound `impl Debug: From<&str>` is not satisfied
14   --> $DIR/cross-return-site-inference.rs:37:16
15    |
16 LL |     return Err(From::from("foo"));
17    |                ^^^^^^^^^^ the trait `From<&str>` is not implemented for `impl Debug`
18
19 error[E0277]: the trait bound `impl Debug: From<&str>` is not satisfied
20   --> $DIR/cross-return-site-inference.rs:42:9
21    |
22 LL |     Err(From::from("foo"))
23    |         ^^^^^^^^^^ the trait `From<&str>` is not implemented for `impl Debug`
24
25 error: aborting due to 3 previous errors
26
27 For more information about this error, try `rustc --explain E0277`.