Graydon Hoare | d1affff | 2012-12-11 01:32:48 | [diff] [blame] | 1 | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT |
| 2 | // file at the top-level directory of this distribution and at |
| 3 | // http://rust-lang.org/COPYRIGHT. |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 6 | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 7 | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 8 | // option. This file may not be copied, modified, or distributed |
| 9 | // except according to those terms. |
| 10 | |
Sean Moon | bd4ee7c | 2013-05-08 17:34:47 | [diff] [blame] | 11 | // Issue #825: Should recheck the loop condition after continuing |
Graydon Hoare | 89c8ef7 | 2013-02-02 03:43:17 | [diff] [blame] | 12 | pub fn main() { |
Tobias Bucher | 7f64fe4 | 2015-01-25 21:05:03 | [diff] [blame] | 13 | let mut i = 1; |
Graydon Hoare | 8b58095 | 2011-12-22 22:42:52 | [diff] [blame] | 14 | while i > 0 { |
Patrick Walton | 1e91595 | 2013-03-29 01:39:09 | [diff] [blame] | 15 | assert!((i > 0)); |
Alex Crichton | cc6ec8d | 2014-03-09 06:11:44 | [diff] [blame] | 16 | println!("{}", i); |
Graydon Hoare | 8b58095 | 2011-12-22 22:42:52 | [diff] [blame] | 17 | i -= 1; |
Brian Anderson | 88272a4 | 2013-09-26 00:56:54 | [diff] [blame] | 18 | continue; |
Graydon Hoare | 8b58095 | 2011-12-22 22:42:52 | [diff] [blame] | 19 | } |
| 20 | } |