]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.rs
Update tests
[rust.git] / src / test / ui / closures / closure-expected-type / expect-region-supply-region-2.rs
1 #![allow(warnings)]
2
3 fn closure_expecting_bound<F>(_: F)
4 where
5     F: FnOnce(&u32),
6 {
7 }
8
9 fn expect_bound_supply_named<'x>() {
10     let mut f: Option<&u32> = None;
11
12     // Here we give a type annotation that `x` should be free. We get
13     // an error because of that.
14     closure_expecting_bound(|x: &'x u32| {
15         //~^ ERROR mismatched types
16         //~| ERROR mismatched types
17
18         // Borrowck doesn't get a chance to run, but if it did it should error
19         // here.
20         f = Some(x);
21     });
22 }
23
24 fn main() {}