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