auto merge of #8204 : kballard/rust/str-into-owned, r=graydon
auto merge of #8204 : kballard/rust/str-into-owned, r=graydon

The method .into_owned() is meant to be used as an optimization when you
need to get a ~str from a Str, but don't want to unnecessarily copy it
if it's already a ~str.

This is meant to ease functions that look like

  fn foo<S: Str>(strs: &[S])

Previously they could work with the strings as slices using .as_slice(),
but producing ~str required copying the string, even if the vector
turned out be a &[~str] already.

I don't have any concrete uses for this yet, since the one conversion I've done to `&[S]` so far (see PR #8203) didn't actually need owned strings. But having this here may make using `Str` more attractive.

It also may be worth adding an `into_managed()` function, but that one is less obviously useful than `into_owned()`.

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