]> git.proxmox.com Git - rustc.git/blame - src/test/ui/inference/issue-104649.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / inference / issue-104649.rs
CommitLineData
487cf647
FG
1type Result<T, E = Error> = ::std::result::Result<T, E>;
2struct Error;
3
4trait ForEach {
5 type Input;
6 fn for_each<F, U>(self, f: F)
7 where
8 F: FnOnce(Self::Input) -> U;
9}
10
11impl<T> ForEach for A<T> {
12 type Input = T;
13 fn for_each<F, U>(self, f: F)
14 where
15 F: FnOnce(Self::Input) -> U,
16 {
17 todo!()
18 }
19}
20
21struct A<T>(T);
22
23fn main() {
24 let a = A(Result::Ok(Result::Ok(()))); //~ ERROR type annotations needed
25 a.for_each(|a: Result<_>| {
26 let f = || match a {
27 Ok(Ok(a)) => {}
28 Ok(Err(a)) => {}
29 Err(a) => {}
30 };
31 });
32}