]> git.lizzy.rs Git - rust.git/blob - src/test/ui/autobind.rs
Move generic error message to separate branches
[rust.git] / src / test / ui / autobind.rs
1 // run-pass
2
3 fn f<T>(x: Vec<T>) -> T { return x.into_iter().next().unwrap(); }
4
5 fn g<F>(act: F) -> isize where F: FnOnce(Vec<isize>) -> isize { return act(vec![1, 2, 3]); }
6
7 pub fn main() {
8     assert_eq!(g(f), 1);
9     let f1 = f;
10     assert_eq!(f1(vec!["x".to_string(), "y".to_string(), "z".to_string()]),
11                "x".to_string());
12 }