]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/while-let.rs
1 // Copyright 2014 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.
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.
11 use std
::collections
::BinaryHeap
;
13 fn make_pq() -> BinaryHeap
<int
> {
14 BinaryHeap
::from_vec(vec
![1i,2,3])
18 let mut pq
= make_pq();
20 while let Some(x
) = pq
.pop() {
27 'a
: while let Some(x
) = pq
.pop() {
37 'a
: while let Some(x
) = pq
.pop() {
45 let mut pq1
= make_pq();
47 while let Some(x
) = pq1
.pop() {
48 let mut pq2
= make_pq();
49 while let Some(y
) = pq2
.pop() {
53 assert_eq
!(sum
, 6i + 12 + 18);