]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closures/local-type-mix.rs
Auto merge of #84267 - dtolnay:ptrunit, r=nagisa
[rust.git] / src / test / ui / closures / local-type-mix.rs
1 // Check that using the parameter name in its type does not ICE.
2 // edition:2018
3
4 #![feature(async_closure)]
5
6 fn main() {
7     let _ = |x: x| x; //~ ERROR expected type
8     let _ = |x: bool| -> x { x }; //~ ERROR expected type
9     let _ = async move |x: x| x; //~ ERROR expected type
10     let _ = async move |x: bool| -> x { x }; //~ ERROR expected type
11 }
12
13 fn foo(x: x) {} //~ ERROR expected type
14 fn foo_ret(x: bool) -> x {} //~ ERROR expected type
15
16 async fn async_foo(x: x) {} //~ ERROR expected type
17 async fn async_foo_ret(x: bool) -> x {} //~ ERROR expected type