Skip to content

Commit a4ab6a5

Browse files
kud1inghuonw
authored andcommitted
---
yaml --- r: 94968 b: refs/heads/dist-snap c: d798e00 h: refs/heads/master v: v3
1 parent 3789355 commit a4ab6a5

File tree

32 files changed

+232
-400
lines changed

32 files changed

+232
-400
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: a94158ce64524b7e21e6c8ec23a6b762d45926fb
9+
refs/heads/dist-snap: d798e00337e72d5036a5c3cfd463c6ebb30d83d2
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/etc/emacs/rust-mode.el

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@
127127
(defconst rust-mode-keywords
128128
'("as"
129129
"break"
130-
"continue"
131130
"do"
132131
"else" "enum" "extern"
133132
"false" "fn" "for"

branches/dist-snap/src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
<keyword>assert</keyword>
4040
<keyword>break</keyword>
4141
<keyword>const</keyword>
42-
<keyword>continue</keyword>
4342
<keyword>do</keyword>
4443
<keyword>drop</keyword>
4544
<keyword>else</keyword>

branches/dist-snap/src/etc/kate/rust.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<list name="keywords">
1919
<item> as </item>
2020
<item> break </item>
21-
<item> continue </item>
2221
<item> do </item>
2322
<item> drop </item>
2423
<item> else </item>

branches/dist-snap/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ syn keyword rustOperator as
1818

1919
syn match rustAssert "\<assert\(\w\)*!" contained
2020
syn match rustFail "\<fail\(\w\)*!" contained
21-
syn keyword rustKeyword break continue do extern
21+
syn keyword rustKeyword break do extern
2222
syn keyword rustKeyword in if impl let log
2323
syn keyword rustKeyword for impl let log
2424
syn keyword rustKeyword loop mod once priv pub

branches/dist-snap/src/libextra/bitv.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ impl Bitv {
523523
* with the most significant bits of each byte coming first. Each
524524
* bit becomes true if equal to 1 or false if equal to 0.
525525
*/
526-
pub fn from_bytes(bytes: &[u8]) -> Bitv {
526+
pub fn from_utf8(bytes: &[u8]) -> Bitv {
527527
from_fn(bytes.len() * 8, |i| {
528528
let b = bytes[i / 8] as uint;
529529
let offset = i % 8;
@@ -1275,8 +1275,8 @@ mod tests {
12751275
}
12761276
12771277
#[test]
1278-
fn test_from_bytes() {
1279-
let bitv = from_bytes([0b10110110, 0b00000000, 0b11111111]);
1278+
fn test_from_utf8() {
1279+
let bitv = from_utf8([0b10110110, 0b00000000, 0b11111111]);
12801280
let str = ~"10110110" + "00000000" + "11111111";
12811281
assert_eq!(bitv.to_str(), str);
12821282
}
@@ -1302,7 +1302,7 @@ mod tests {
13021302
#[test]
13031303
fn test_to_bools() {
13041304
let bools = ~[false, false, true, false, false, true, true, false];
1305-
assert_eq!(from_bytes([0b00100110]).to_bools(), bools);
1305+
assert_eq!(from_utf8([0b00100110]).to_bools(), bools);
13061306
}
13071307
13081308
#[test]

branches/dist-snap/src/libextra/crypto/md5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static C4: [u32, ..16] = [
156156

157157

158158
/// The MD5 Digest algorithm
159-
pub struct Md5 {
159+
struct Md5 {
160160
priv length_bytes: u64,
161161
priv buffer: FixedBuffer64,
162162
priv state: Md5State,

branches/dist-snap/src/libextra/crypto/sha2.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ impl Engine512 {
230230
}
231231

232232

233-
/// The SHA-512 hash algorithm
234-
pub struct Sha512 {
233+
struct Sha512 {
235234
priv engine: Engine512
236235
}
237236

@@ -283,8 +282,7 @@ static H512: [u64, ..8] = [
283282
];
284283

285284

286-
/// The SHA-384 hash algorithm
287-
pub struct Sha384 {
285+
struct Sha384 {
288286
priv engine: Engine512
289287
}
290288

@@ -334,8 +332,7 @@ static H384: [u64, ..8] = [
334332
];
335333

336334

337-
/// The SHA-512 hash algorithm with digest truncated to 256 bits
338-
pub struct Sha512Trunc256 {
335+
struct Sha512Trunc256 {
339336
priv engine: Engine512
340337
}
341338

@@ -383,8 +380,7 @@ static H512_TRUNC_256: [u64, ..8] = [
383380
];
384381

385382

386-
/// The SHA-512 hash algorithm with digest truncated to 224 bits
387-
pub struct Sha512Trunc224 {
383+
struct Sha512Trunc224 {
388384
priv engine: Engine512
389385
}
390386

@@ -639,8 +635,7 @@ impl Engine256 {
639635
}
640636

641637

642-
/// The SHA-256 hash algorithm
643-
pub struct Sha256 {
638+
struct Sha256 {
644639
priv engine: Engine256
645640
}
646641

@@ -692,8 +687,7 @@ static H256: [u32, ..8] = [
692687
];
693688

694689

695-
/// The SHA-224 hash algorithm
696-
pub struct Sha224 {
690+
struct Sha224 {
697691
priv engine: Engine256
698692
}
699693

branches/dist-snap/src/libextra/getopts.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
//! Simple getopt alternative.
1212
//!
13-
//! Construct a vector of options, either by using reqopt, optopt, and optflag
14-
//! or by building them from components yourself, and pass them to getopts,
15-
//! along with a vector of actual arguments (not including argv[0]). You'll
13+
//! Construct a vector of options, either by using `reqopt`, `optopt`, and `optflag`
14+
//! or by building them from components yourself, and pass them to `getopts`,
15+
//! along with a vector of actual arguments (not including `argv[0]`). You'll
1616
//! either get a failure code back, or a match. You'll have to verify whether
17-
//! the amount of 'free' arguments in the match is what you expect. Use opt_*
17+
//! the amount of 'free' arguments in the match is what you expect. Use `opt_*`
1818
//! accessors to get argument values out of the matches object.
1919
//!
2020
//! Single-character options are expected to appear on the command line with a
@@ -27,7 +27,7 @@
2727
//!
2828
//! The following example shows simple command line parsing for an application
2929
//! that requires an input file to be specified, accepts an optional output
30-
//! file name following -o, and accepts both -h and --help as optional flags.
30+
//! file name following `-o`, and accepts both `-h` and `--help` as optional flags.
3131
//!
3232
//! ~~~{.rust}
3333
//! exter mod extra;

branches/dist-snap/src/libextra/ringbuf.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,6 @@ impl<T> RingBuf<T> {
143143
}
144144
}
145145

146-
/// Swap elements at indices `i` and `j`
147-
///
148-
/// `i` and `j` may be equal.
149-
///
150-
/// Fails if there is no element with the given index
151-
pub fn swap(&mut self, i: uint, j: uint) {
152-
assert!(i < self.len());
153-
assert!(j < self.len());
154-
let ri = self.raw_index(i);
155-
let rj = self.raw_index(j);
156-
self.elts.swap(ri, rj);
157-
}
158-
159146
/// Return index in underlying vec for a given logical element index
160147
fn raw_index(&self, idx: uint) -> uint {
161148
raw_index(self.lo, self.elts.len(), idx)
@@ -617,14 +604,6 @@ mod tests {
617604
assert_eq!(d.elts.capacity(), 64);
618605
}
619606

620-
#[test]
621-
fn test_swap() {
622-
let mut d: RingBuf<int> = range(0, 5).collect();
623-
d.pop_front();
624-
d.swap(0, 3);
625-
assert_eq!(d.iter().map(|&x|x).collect::<~[int]>(), ~[4, 2, 3, 1]);
626-
}
627-
628607
#[test]
629608
fn test_iter() {
630609
let mut d = RingBuf::new();

branches/dist-snap/src/libextra/url.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use std::to_bytes;
2121
use std::uint;
2222

2323
#[deriving(Clone, Eq)]
24-
pub struct Url {
24+
struct Url {
2525
scheme: ~str,
2626
user: Option<UserInfo>,
2727
host: ~str,
@@ -32,7 +32,7 @@ pub struct Url {
3232
}
3333

3434
#[deriving(Clone, Eq)]
35-
pub struct UserInfo {
35+
struct UserInfo {
3636
user: ~str,
3737
pass: Option<~str>
3838
}

branches/dist-snap/src/librustc/metadata/decoder.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -564,19 +564,19 @@ impl<'self> EachItemContext<'self> {
564564
}
565565
}
566566

567-
let mut continue_ = (self.callback)(*self.path_builder, def_like, vis);
567+
let mut continue = (self.callback)(*self.path_builder, def_like, vis);
568568

569569
let family = item_family(doc);
570570
if family == ForeignMod {
571571
// These are unnamed; pop the name now.
572572
self.pop_name(old_len)
573573
}
574574

575-
if continue_ {
575+
if continue {
576576
// Recurse if necessary.
577577
match family {
578578
Mod | ForeignMod | Trait | Impl => {
579-
continue_ = self.each_item_of_module(def_id);
579+
continue = self.each_item_of_module(def_id);
580580
}
581581
ImmStatic | MutStatic | Struct | UnsafeFn | Fn | ForeignFn |
582582
UnsafeStaticMethod | StaticMethod | Type | ForeignType |
@@ -589,7 +589,7 @@ impl<'self> EachItemContext<'self> {
589589
self.pop_name(old_len)
590590
}
591591

592-
continue_
592+
continue
593593
}
594594

595595
fn each_item_of_module(&mut self, def_id: ast::DefId) -> bool {
@@ -612,7 +612,7 @@ impl<'self> EachItemContext<'self> {
612612
}
613613

614614
fn each_child_of_module_or_crate(&mut self, item_doc: ebml::Doc) -> bool {
615-
let mut continue_ = true;
615+
let mut continue = true;
616616

617617
// Iterate over all children.
618618
do reader::tagged_docs(item_doc, tag_mod_child) |child_info_doc| {
@@ -654,16 +654,16 @@ impl<'self> EachItemContext<'self> {
654654
// Process this item.
655655

656656
let vis = item_visibility(child_item_doc);
657-
continue_ = self.process_item_and_pop_name(child_item_doc,
657+
continue = self.process_item_and_pop_name(child_item_doc,
658658
child_def_id,
659659
old_len,
660660
vis);
661661
}
662662
}
663-
continue_
663+
continue
664664
};
665665

666-
if !continue_ {
666+
if !continue {
667667
return false
668668
}
669669

@@ -705,18 +705,18 @@ impl<'self> EachItemContext<'self> {
705705
match maybe_find_item(def_id.node, other_crates_items) {
706706
None => { self.pop_name(old_len); }
707707
Some(reexported_item_doc) => {
708-
continue_ = self.process_item_and_pop_name(
708+
continue = self.process_item_and_pop_name(
709709
reexported_item_doc,
710710
def_id,
711711
old_len,
712712
ast::public);
713713
}
714714
}
715715

716-
continue_
716+
continue
717717
};
718718

719-
continue_
719+
continue
720720
}
721721
}
722722

branches/dist-snap/src/librustc/metadata/encoder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -521,12 +521,12 @@ fn encode_reexported_static_methods(ecx: &EncodeContext,
521521
/// * For newtype structs, iterates through the node ID of the constructor.
522522
fn each_auxiliary_node_id(item: @item, callback: &fn(NodeId) -> bool)
523523
-> bool {
524-
let mut continue_ = true;
524+
let mut continue = true;
525525
match item.node {
526526
item_enum(ref enum_def, _) => {
527527
for variant in enum_def.variants.iter() {
528-
continue_ = callback(variant.node.id);
529-
if !continue_ {
528+
continue = callback(variant.node.id);
529+
if !continue {
530530
break
531531
}
532532
}
@@ -537,15 +537,15 @@ fn each_auxiliary_node_id(item: @item, callback: &fn(NodeId) -> bool)
537537
Some(ctor_id) if struct_def.fields.len() > 0 &&
538538
struct_def.fields[0].node.kind ==
539539
ast::unnamed_field => {
540-
continue_ = callback(ctor_id);
540+
continue = callback(ctor_id);
541541
}
542542
_ => {}
543543
}
544544
}
545545
_ => {}
546546
}
547547

548-
continue_
548+
continue
549549
}
550550

551551
fn encode_reexports(ecx: &EncodeContext,

branches/dist-snap/src/librustc/middle/trans/controlflow.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use syntax::ast;
2525
use syntax::ast::Name;
2626
use syntax::ast_util;
2727
use syntax::codemap::Span;
28-
use syntax::visit::Visitor;
2928

3029
pub fn trans_block(bcx: @mut Block, b: &ast::Block, dest: expr::Dest) -> @mut Block {
3130
let _icx = push_ctxt("trans_block");
@@ -65,22 +64,12 @@ pub fn trans_if(bcx: @mut Block,
6564
// Drop branches that are known to be impossible
6665
if is_const(cond_val) && !is_undef(cond_val) {
6766
if const_to_uint(cond_val) == 1 {
68-
match els {
69-
Some(elexpr) => {
70-
let mut trans = TransItemVisitor { ccx: bcx.fcx.ccx };
71-
trans.visit_expr(elexpr, ());
72-
}
73-
None => {}
74-
}
7567
// if true { .. } [else { .. }]
7668
return do with_scope(bcx, thn.info(), "if_true_then") |bcx| {
7769
let bcx_out = trans_block(bcx, thn, dest);
7870
trans_block_cleanups(bcx_out, block_cleanups(bcx))
7971
}
8072
} else {
81-
let mut trans = TransItemVisitor { ccx: bcx.fcx.ccx } ;
82-
trans.visit_block(thn, ());
83-
8473
match els {
8574
// if false { .. } else { .. }
8675
Some(elexpr) => {

0 commit comments

Comments
 (0)