]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-18188.rs
Rollup merge of #91804 - woppopo:const_clone, r=oli-obk
[rust.git] / src / test / ui / issues / issue-18188.rs
1 // check-pass
2 // pretty-expanded FIXME #23616
3
4 pub trait Promisable: Send + Sync {}
5 impl<T: Send + Sync> Promisable for T {}
6
7 pub fn propagate<'a, T, E, F, G>(mut action: F)
8     -> Box<dyn FnMut(Result<T, E>) -> Result<T, E> + 'a>
9     where
10         T: Promisable + Clone + 'a,
11         E: Promisable + Clone + 'a,
12         F: FnMut(&T) -> Result<T, E> + Send + 'a,
13         G: FnMut(Result<T, E>) -> Result<T, E> + 'a {
14     Box::new(move |result: Result<T, E>| {
15         match result {
16             Ok(ref t) => action(t),
17             Err(ref e) => Err(e.clone()),
18         }
19     })
20 }
21
22 fn main() {}