summaryrefslogtreecommitdiffstats
path: root/tests/ui/for-loop-while/loop-diverges.rs
blob: f657bf9e0b3bc50665a49a3a4d2c7ad655990227 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// run-pass
#![allow(unused_parens)]
// pretty-expanded FIXME #23616

/* Make sure a loop{} can be the tailexpr in the body
of a diverging function */

fn forever() -> ! {
  loop{}
}

pub fn main() {
  if (1 == 2) { forever(); }
}