]> git.proxmox.com Git - rustc.git/blame - src/test/ui/inference/cannot-infer-partial-try-return.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / inference / cannot-infer-partial-try-return.rs
CommitLineData
5869c6ff
XL
1struct QualifiedError<E>(E);
2
3impl<E, T> From<E> for QualifiedError<T>
4where
5 E: std::error::Error,
6 T: From<E>,
7{
8 fn from(e: E) -> QualifiedError<T> {
9 QualifiedError(e.into())
10 }
11}
12
13fn infallible() -> Result<(), std::convert::Infallible> {
14 Ok(())
15}
16
17fn main() {
18 let x = || -> Result<_, QualifiedError<_>> {
923072b8
FG
19 //~^ ERROR type annotations needed for `Result<(), QualifiedError<_>>`
20 infallible()?;
5869c6ff
XL
21 Ok(())
22 };
23}