priority_queue: implement simple iterator
priority_queue: implement simple iterator

Remove PriorityQueue::each and replace it with PriorityQueue::iter,
which ultimately calls into vec::VecIterator via PriorityQueueIterator.
Implement iterator::Iterator for PriorityQueueIterator.  Now you should
be able to do:

  extern mod extra;
  let mut pq = extra::priority_queue::PriorityQueue::new();
  pq.push(5);
  pq.push(6);
  pq.push(3);
  for pq.iter().advance |el| {
      println(fmt!("%d", *el));
  }

just like you iterate over vectors, hashmaps, hashsets etc.  Note that
the iteration order is arbitrary (as before with PriorityQueue::each),
and _not_ the order you get when you pop() repeatedly.

Add an in-file test to guard this.

Reported-by: Daniel Micay <28efa798da98745d6a98078b320edd33f229eda6@gmail.com>
Signed-off-by: Ramkumar Ramachandra <5c355d1d38066ed0c5de420d67c1b5ed0687c4bd@gmail.com>

ruud-v-a/rust,vhbit/rust,rprichard/rust,nwin/rust,ejjeong/rust,servo/rust,victorvde/rust,untitaker/rust,zubron/rust,GBGamer/rust,pelmers/rust,aneeshusa/rust,erickt/rust,XMPPwocky/rust,AerialX/rust-rt-minimal,untitaker/rust,pythonesque/rust,omasanori/rust,kmcallister/rust,defuz/rust,kimroen/rust,krzysz00/rust,KokaKiwi/rust,nwin/rust,aepsil0n/rust,kmcallister/rust,kimroen/rust,stepancheg/rust-ide-rust,l0kod/rust,servo/rust,pshc/rust,nham/rust,hauleth/rust,jroesch/rust,j16r/rust,ruud-v-a/rust,AerialX/rust,pshc/rust,ebfull/rand,servo/rust,fabricedesre/rust,zubron/rust,quornian/rust,carols10cents/rust,ejjeong/rust,mdinger/rust,aidancully/rust,emk/rust,mahkoh/rust,robertg/rust,jroesch/rust,LeoTestard/rust,aturon/rust,richo/rust,mahkoh/rust,avdi/rust,nwin/rust,SiegeLord/rust,defuz/rust,TheNeikos/rust,gifnksm/rust,kmcallister/rust,andars/rust,rohitjoshi/rust,reem/rust,victorvde/rust,aturon/rust,0x73/rust,ktossell/rust,jroesch/rust,nwin/rust,ejjeong/rust,rprichard/rust,carols10cents/rust,omasanori/rust,cllns/rust,ejjeong/rust,XMPPwocky/rust,kimroen/rust,mahkoh/rust,pelmers/rust,pshc/rust,richo/rust,sae-bom/rust,mdinger/rust,aneeshusa/rust,miniupnp/rust,zubron/rust,Ryman/rust,l0kod/rust,fabricedesre/rust,dinfuehr/rust,ktossell/rust,jashank/rust,omasanori/rust,P1start/rust,seanrivera/rust,zaeleus/rust,defuz/rust,stepancheg/rust-ide-rust,AerialX/rust-rt-minimal,seanrivera/rust,j16r/rust,ruud-v-a/rust,kimroen/rust,mvdnes/rust,pythonesque/rust,XMPPwocky/rust,untitaker/rust,P1start/rust,P1start/rust,reem/rust,KokaKiwi/rust,sarojaba/rust-doc-korean,zachwick/rust,zaeleus/rust,l0kod/rust,0x73/rust,jbclements/rust,aturon/rust,aepsil0n/rust,P1start/rust,bombless/rust,AerialX/rust-rt-minimal,untitaker/rust,GBGamer/rust,AerialX/rust-rt-minimal,ktossell/rust,kimroen/rust,TheNeikos/rust,servo/rust,mvdnes/rust,mdinger/rust,victorvde/rust,sarojaba/rust-doc-korean,miniupnp/rust,jroesch/rust,fabricedesre/rust,philyoon/rust,seanrivera/rust,hauleth/rust,rprichard/rust,krzysz00/rust,sae-bom/rust,Ryman/rust,hauleth/rust,GBGamer/rust,zaeleus/rust,pczarn/rust,pythonesque/rust,mahkoh/rust,philyoon/rust,P1start/rust,jbclements/rust,l0kod/rust,ebfull/rust,cllns/rust,andars/rust,vhbit/rust,aneeshusa/rust,j16r/rust,LeoTestard/rust,jroesch/rust,Ryman/rust,erickt/rust,KokaKiwi/rust,jbclements/rust,aepsil0n/rust,seanrivera/rust,carols10cents/rust,erickt/rust,michaelballantyne/rust-gpu,emk/rust,SiegeLord/rust,erickt/rust,sae-bom/rust,barosl/rust,defuz/rust,bombless/rust,avdi/rust,mvdnes/rust,stepancheg/rust-ide-rust,mitsuhiko/rust,stepancheg/rust-ide-rust,ruud-v-a/rust,bombless/rust-docs-chinese,mvdnes/rust,cllns/rust,krzysz00/rust,quornian/rust,0x73/rust,ebfull/rust,nwin/rust,ruud-v-a/rust,jashank/rust,ebfull/rust,barosl/rust,rohitjoshi/rust,ktossell/rust,shepmaster/rand,vhbit/rust,ebfull/rust,vhbit/rust,pczarn/rust,carols10cents/rust,j16r/rust,gifnksm/rust,cllns/rust,emk/rust,robertg/rust,zubron/rust,defuz/rust,SiegeLord/rust,kwantam/rust,michaelballantyne/rust-gpu,jroesch/rust,rohitjoshi/rust,kmcallister/rust,gifnksm/rust,l0kod/rust,kmcallister/rust,andars/rust,vhbit/rust,XMPPwocky/rust,miniupnp/rust,jroesch/rust,krzysz00/rust,pelmers/rust,graydon/rust,quornian/rust,mihneadb/rust,emk/rust,fabricedesre/rust,pczarn/rust,miniupnp/rust,aturon/rust,mihneadb/rust,dwillmer/rust,reem/rust,kwantam/rust,mihneadb/rust,sarojaba/rust-doc-korean,richo/rust,servo/rust,TheNeikos/rust,graydon/rust,mihneadb/rust,krzysz00/rust,miniupnp/rust,waynenilsen/rand,kimroen/rust,aturon/rust,untitaker/rust,miniupnp/rust,rprichard/rust,avdi/rust,jbclements/rust,TheNeikos/rust,rohitjoshi/rust,ruud-v-a/rust,erickt/rust,nwin/rust,zaeleus/rust,dinfuehr/rust,achanda/rand,emk/rust,KokaKiwi/rust,sarojaba/rust-doc-korean,pczarn/rust,aidancully/rust,philyoon/rust,kmcallister/rust,LeoTestard/rust,quornian/rust,graydon/rust,omasanori/rust,aepsil0n/rust,jbclements/rust,mitsuhiko/rust,zaeleus/rust,jbclements/rust,LeoTestard/rust,sarojaba/rust-doc-korean,bluss/rand,sae-bom/rust,mahkoh/rust,gifnksm/rust,mitsuhiko/rust,pshc/rust,cllns/rust,dinfuehr/rust,l0kod/rust,zachwick/rust,rprichard/rust,mitsuhiko/rust,michaelballantyne/rust-gpu,ejjeong/rust,zachwick/rust,stepancheg/rust-ide-rust,reem/rust,pshc/rust,servo/rust,stepancheg/rust-ide-rust,bombless/rust,AerialX/rust,mdinger/rust,zachwick/rust,mitsuhiko/rust,aturon/rust,bombless/rust,zubron/rust,AerialX/rust,gifnksm/rust,emk/rust,ebfull/rust,sae-bom/rust,mihneadb/rust,GBGamer/rust,sarojaba/rust-doc-korean,robertg/rust,dwillmer/rust,mvdnes/rust,pshc/rust,aneeshusa/rust,pythonesque/rust,dinfuehr/rust,l0kod/rust,kwantam/rust,TheNeikos/rust,andars/rust,pelmers/rust,zaeleus/rust,hauleth/rust,avdi/rust,nham/rust,victorvde/rust,vhbit/rust,aidancully/rust,jashank/rust,fabricedesre/rust,SiegeLord/rust,graydon/rust,carols10cents/rust,retep998/rand,mahkoh/rust,robertg/rust,mdinger/rust,KokaKiwi/rust,pczarn/rust,nwin/rust,quornian/rust,cllns/rust,GrahamDennis/rand,SiegeLord/rust,nwin/rust,ktossell/rust,omasanori/rust,carols10cents/rust,zubron/rust,ejjeong/rust,pythonesque/rust,nham/rust,robertg/rust,gifnksm/rust,0x73/rust,pelmers/rust,0x73/rust,nham/rust,jashank/rust,P1start/rust,philyoon/rust,sae-bom/rust,stepancheg/rust-ide-rust,krzysz00/rust,Ryman/rust,kmcallister/rust,pshc/rust,j16r/rust,andars/rust,GBGamer/rust,philyoon/rust,rprichard/rust,vhbit/rust,pythonesque/rust,fabricedesre/rust,miniupnp/rust,jbclements/rust,AerialX/rust,jashank/rust,graydon/rust,kwantam/rust,rohitjoshi/rust,mitsuhiko/rust,andars/rust,avdi/rust,AerialX/rust-rt-minimal,graydon/rust,seanrivera/rust,barosl/rust,quornian/rust,nham/rust,michaelballantyne/rust-gpu,vhbit/rust,avdi/rust,zachwick/rust,zachwick/rust,reem/rust,kimroen/rust,erickt/rust,aneeshusa/rust,dinfuehr/rust,emk/rust,0x73/rust,ktossell/rust,michaelballantyne/rust-gpu,arthurprs/rand,reem/rust,barosl/rust,AerialX/rust,pczarn/rust,robertg/rust,kwantam/rust,LeoTestard/rust,j16r/rust,jbclements/rust,kwantam/rust,Ryman/rust,zubron/rust,jroesch/rust,bombless/rust,mvdnes/rust,GBGamer/rust,zubron/rust,omasanori/rust,sarojaba/rust-doc-korean,jashank/rust,richo/rust,dwillmer/rust,victorvde/rust,j16r/rust,aepsil0n/rust,LeoTestard/rust,michaelballantyne/rust-gpu,TheNeikos/rust,AerialX/rust-rt-minimal,richo/rust,barosl/rust,seanrivera/rust,dwillmer/rust,SiegeLord/rust,barosl/rust,dwillmer/rust,KokaKiwi/rust,mihneadb/rust,Ryman/rust,jashank/rust,hauleth/rust,servo/rust,GBGamer/rust,michaelballantyne/rust-gpu,XMPPwocky/rust,pczarn/rust,mdinger/rust,barosl/rust,dwillmer/rust,richo/rust,pythonesque/rust,jashank/rust,ktossell/rust,XMPPwocky/rust,dwillmer/rust,P1start/rust,victorvde/rust,GBGamer/rust,AerialX/rust,ebfull/rust,dwillmer/rust,untitaker/rust,erickt/rust,LeoTestard/rust,dinfuehr/rust,pshc/rust,nham/rust,aidancully/rust,quornian/rust,pelmers/rust,hauleth/rust,fabricedesre/rust,aneeshusa/rust,defuz/rust,mitsuhiko/rust,bombless/rust,aidancully/rust,aturon/rust,jbclements/rust,nham/rust,aepsil0n/rust,rohitjoshi/rust,philyoon/rust,SiegeLord/rust,bhickey/rand,huonw/rand,l0kod/rust,aidancully/rust,Ryman/rust,0x73/rust,miniupnp/rust