1 #![feature(impl_trait_in_fn_trait_return)]
4 fn fine(x: impl Into<u32>) -> impl Into<u32> { x }
6 fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
7 //~^ ERROR nested `impl Trait` is not allowed
8 //~| ERROR the trait bound `impl Debug: From<impl Into<u32>>` is not satisfied
10 fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
11 //~^ ERROR nested `impl Trait` is not allowed
12 //~| `impl Trait` only allowed in function and inherent method return types
14 fn bad_in_arg_position(_: impl Into<impl Debug>) { }
15 //~^ ERROR nested `impl Trait` is not allowed
19 fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
20 //~^ ERROR nested `impl Trait` is not allowed
21 //~| ERROR the trait bound `impl Debug: From<impl Into<u32>>` is not satisfied
24 fn allowed_in_assoc_type() -> impl Iterator<Item=impl Fn()> {
25 vec![|| println!("woot")].into_iter()
28 fn allowed_in_ret_type() -> impl Fn() -> impl Into<u32> {