]> git.lizzy.rs Git - rust.git/blob - tests/ui/last-use-in-block.rs
Rollup merge of #107576 - P1n3appl3:master, r=tmandry
[rust.git] / tests / ui / last-use-in-block.rs
1 // run-pass
2
3 #![allow(dead_code)]
4 #![allow(unused_parens)]
5 // Issue #1818
6
7
8 fn lp<T, F>(s: String, mut f: F) -> T where F: FnMut(String) -> T {
9     while false {
10         let r = f(s);
11         return (r);
12     }
13     panic!();
14 }
15
16 fn apply<T, F>(s: String, mut f: F) -> T where F: FnMut(String) -> T {
17     fn g<T, F>(s: String, mut f: F) -> T where F: FnMut(String) -> T {f(s)}
18     g(s, |v| { let r = f(v); r })
19 }
20
21 pub fn main() {}