]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/type-mismatch-error.rs
Extend invalid floating point literal suffix suggestion
[rust.git] / src / test / ui / generator / type-mismatch-error.rs
1 //! Test that we get the expected type mismatch error instead of "closure is expected to take 0
2 //! arguments" (which got introduced after implementing resume arguments).
3
4 #![feature(generators, generator_trait)]
5
6 use std::ops::Generator;
7
8 fn f<G: Generator>(_: G, _: G::Return) {}
9
10 fn main() {
11     f(
12         |a: u8| {
13             if false {
14                 yield ();
15             } else {
16                 a
17                 //~^ error: `if` and `else` have incompatible types
18             }
19         },
20         0u8,
21     );
22 }