Skip to content

Commit 4edf3fc

Browse files
committed
---
yaml --- r: 174734 b: refs/heads/snap-stage3 c: 3c32cd1 h: refs/heads/master v: v3
1 parent 3b4e068 commit 4edf3fc

File tree

17 files changed

+157
-157
lines changed

17 files changed

+157
-157
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: a0f86de49748b472d4d189d9688b0d856c000914
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 591337431df612dd4e0df8d46b6291358085ac7c
4+
refs/heads/snap-stage3: 3c32cd1be27f321658382e39d34f5d993d99ae8b
55
refs/heads/try: 08f6380a9f0b866796080094f44fe25ea5636547
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/libsyntax/ast_util.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -322,15 +322,15 @@ pub fn struct_field_visibility(field: ast::StructField) -> Visibility {
322322
pub fn operator_prec(op: ast::BinOp) -> usize {
323323
match op {
324324
// 'as' sits here with 12
325-
BiMul | BiDiv | BiRem => 11u,
326-
BiAdd | BiSub => 10u,
327-
BiShl | BiShr => 9u,
328-
BiBitAnd => 8u,
329-
BiBitXor => 7u,
330-
BiBitOr => 6u,
331-
BiLt | BiLe | BiGe | BiGt | BiEq | BiNe => 3u,
332-
BiAnd => 2u,
333-
BiOr => 1u
325+
BiMul | BiDiv | BiRem => 11us,
326+
BiAdd | BiSub => 10us,
327+
BiShl | BiShr => 9us,
328+
BiBitAnd => 8us,
329+
BiBitXor => 7us,
330+
BiBitOr => 6us,
331+
BiLt | BiLe | BiGe | BiGt | BiEq | BiNe => 3us,
332+
BiAnd => 2us,
333+
BiOr => 1us
334334
}
335335
}
336336

branches/snap-stage3/src/libsyntax/codemap.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ impl CodeMap {
430430
let lo = self.lookup_char_pos(sp.lo);
431431
let hi = self.lookup_char_pos(sp.hi);
432432
let mut lines = Vec::new();
433-
for i in range(lo.line - 1u, hi.line as usize) {
433+
for i in range(lo.line - 1us, hi.line as usize) {
434434
lines.push(i);
435435
};
436436
FileLines {file: lo.file, lines: lines}
@@ -498,10 +498,10 @@ impl CodeMap {
498498
let files = self.files.borrow();
499499
let files = &*files;
500500
let len = files.len();
501-
let mut a = 0u;
501+
let mut a = 0us;
502502
let mut b = len;
503-
while b - a > 1u {
504-
let m = (a + b) / 2u;
503+
while b - a > 1us {
504+
let m = (a + b) / 2us;
505505
if files[m].start_pos > pos {
506506
b = m;
507507
} else {
@@ -537,12 +537,12 @@ impl CodeMap {
537537

538538
let files = self.files.borrow();
539539
let f = (*files)[idx].clone();
540-
let mut a = 0u;
540+
let mut a = 0us;
541541
{
542542
let lines = f.lines.borrow();
543543
let mut b = lines.len();
544-
while b - a > 1u {
545-
let m = (a + b) / 2u;
544+
while b - a > 1us {
545+
let m = (a + b) / 2us;
546546
if (*lines)[m] > pos { b = m; } else { a = m; }
547547
}
548548
}
@@ -551,7 +551,7 @@ impl CodeMap {
551551

552552
fn lookup_pos(&self, pos: BytePos) -> Loc {
553553
let FileMapAndLine {fm: f, line: a} = self.lookup_line(pos);
554-
let line = a + 1u; // Line numbers start at 1
554+
let line = a + 1us; // Line numbers start at 1
555555
let chpos = self.bytepos_to_file_charpos(pos);
556556
let linebpos = (*f.lines.borrow())[a];
557557
let linechpos = self.bytepos_to_file_charpos(linebpos);
@@ -762,7 +762,7 @@ mod test {
762762

763763
assert_eq!(file_lines.file.name, "blork.rs");
764764
assert_eq!(file_lines.lines.len(), 1);
765-
assert_eq!(file_lines.lines[0], 1u);
765+
assert_eq!(file_lines.lines[0], 1us);
766766
}
767767

768768
#[test]

branches/snap-stage3/src/libsyntax/diagnostic.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use term::WriterWrapper;
2626
use term;
2727

2828
/// maximum number of lines we will print for each error; arbitrary.
29-
static MAX_LINES: usize = 6u;
29+
static MAX_LINES: usize = 6us;
3030

3131
#[derive(Clone, Copy)]
3232
pub enum RenderSpan {
@@ -151,20 +151,20 @@ impl Handler {
151151
self.bump_err_count();
152152
}
153153
pub fn bump_err_count(&self) {
154-
self.err_count.set(self.err_count.get() + 1u);
154+
self.err_count.set(self.err_count.get() + 1us);
155155
}
156156
pub fn err_count(&self) -> usize {
157157
self.err_count.get()
158158
}
159159
pub fn has_errors(&self) -> bool {
160-
self.err_count.get()> 0u
160+
self.err_count.get() > 0us
161161
}
162162
pub fn abort_if_errors(&self) {
163163
let s;
164164
match self.err_count.get() {
165-
0u => return,
166-
1u => s = "aborting due to previous error".to_string(),
167-
_ => {
165+
0us => return,
166+
1us => s = "aborting due to previous error".to_string(),
167+
_ => {
168168
s = format!("aborting due to {} previous errors",
169169
self.err_count.get());
170170
}
@@ -448,7 +448,7 @@ fn highlight_lines(err: &mut EmitterWriter,
448448
let mut elided = false;
449449
let mut display_lines = &lines.lines[];
450450
if display_lines.len() > MAX_LINES {
451-
display_lines = &display_lines[0u..MAX_LINES];
451+
display_lines = &display_lines[0us..MAX_LINES];
452452
elided = true;
453453
}
454454
// Print the offending lines
@@ -459,32 +459,32 @@ fn highlight_lines(err: &mut EmitterWriter,
459459
}
460460
}
461461
if elided {
462-
let last_line = display_lines[display_lines.len() - 1u];
463-
let s = format!("{}:{} ", fm.name, last_line + 1u);
462+
let last_line = display_lines[display_lines.len() - 1us];
463+
let s = format!("{}:{} ", fm.name, last_line + 1us);
464464
try!(write!(&mut err.dst, "{0:1$}...\n", "", s.len()));
465465
}
466466

467467
// FIXME (#3260)
468468
// If there's one line at fault we can easily point to the problem
469-
if lines.lines.len() == 1u {
469+
if lines.lines.len() == 1us {
470470
let lo = cm.lookup_char_pos(sp.lo);
471-
let mut digits = 0u;
472-
let mut num = (lines.lines[0] + 1u) / 10u;
471+
let mut digits = 0us;
472+
let mut num = (lines.lines[0] + 1us) / 10us;
473473

474474
// how many digits must be indent past?
475-
while num > 0u { num /= 10u; digits += 1u; }
475+
while num > 0us { num /= 10us; digits += 1us; }
476476

477477
// indent past |name:## | and the 0-offset column location
478-
let left = fm.name.len() + digits + lo.col.to_usize() + 3u;
478+
let left = fm.name.len() + digits + lo.col.to_usize() + 3us;
479479
let mut s = String::new();
480480
// Skip is the number of characters we need to skip because they are
481481
// part of the 'filename:line ' part of the previous line.
482-
let skip = fm.name.len() + digits + 3u;
482+
let skip = fm.name.len() + digits + 3us;
483483
for _ in range(0, skip) {
484484
s.push(' ');
485485
}
486486
if let Some(orig) = fm.get_line(lines.lines[0]) {
487-
for pos in range(0u, left - skip) {
487+
for pos in range(0us, left - skip) {
488488
let cur_char = orig.as_bytes()[pos] as char;
489489
// Whenever a tab occurs on the previous line, we insert one on
490490
// the error-point-squiggly-line as well (instead of a space).

branches/snap-stage3/src/libsyntax/ext/deriving/generic/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ impl<'a> MethodDef<'a> {
748748
let mut raw_fields = Vec::new(); // ~[[fields of self],
749749
// [fields of next Self arg], [etc]]
750750
let mut patterns = Vec::new();
751-
for i in range(0u, self_args.len()) {
751+
for i in range(0us, self_args.len()) {
752752
let struct_path= cx.path(DUMMY_SP, vec!( type_ident ));
753753
let (pat, ident_expr) =
754754
trait_.create_struct_pattern(cx,
@@ -837,8 +837,8 @@ impl<'a> MethodDef<'a> {
837837
/// (&A2(ref __self_0),
838838
/// &A2(ref __arg_1_0)) => (*__self_0).eq(&(*__arg_1_0)),
839839
/// _ => {
840-
/// let __self_vi = match *self { A1(..) => 0u, A2(..) => 1u };
841-
/// let __arg_1_vi = match *__arg_1 { A1(..) => 0u, A2(..) => 1u };
840+
/// let __self_vi = match *self { A1(..) => 0us, A2(..) => 1us };
841+
/// let __arg_1_vi = match *__arg_1 { A1(..) => 0us, A2(..) => 1us };
842842
/// false
843843
/// }
844844
/// }
@@ -882,8 +882,8 @@ impl<'a> MethodDef<'a> {
882882
/// (Variant2, Variant2, Variant2) => ... // delegate Matching on Variant2
883883
/// ...
884884
/// _ => {
885-
/// let __this_vi = match this { Variant1 => 0u, Variant2 => 1u, ... };
886-
/// let __that_vi = match that { Variant1 => 0u, Variant2 => 1u, ... };
885+
/// let __this_vi = match this { Variant1 => 0us, Variant2 => 1us, ... };
886+
/// let __that_vi = match that { Variant1 => 0us, Variant2 => 1us, ... };
887887
/// ... // catch-all remainder can inspect above variant index values.
888888
/// }
889889
/// }
@@ -1045,13 +1045,13 @@ impl<'a> MethodDef<'a> {
10451045
//
10461046
// ```
10471047
// let __self0_vi = match self {
1048-
// A => 0u, B(..) => 1u, C(..) => 2u
1048+
// A => 0us, B(..) => 1us, C(..) => 2us
10491049
// };
10501050
// let __self1_vi = match __arg1 {
1051-
// A => 0u, B(..) => 1u, C(..) => 2u
1051+
// A => 0us, B(..) => 1us, C(..) => 2us
10521052
// };
10531053
// let __self2_vi = match __arg2 {
1054-
// A => 0u, B(..) => 1u, C(..) => 2u
1054+
// A => 0us, B(..) => 1us, C(..) => 2us
10551055
// };
10561056
// ```
10571057
let mut index_let_stmts: Vec<P<ast::Stmt>> = Vec::new();

branches/snap-stage3/src/libsyntax/ext/expand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ fn expand_mac_invoc<T, F, G>(mac: ast::Mac, span: codemap::Span,
273273
// in this file.
274274
// Token-tree macros:
275275
MacInvocTT(pth, tts, _) => {
276-
if pth.segments.len() > 1u {
276+
if pth.segments.len() > 1us {
277277
fld.cx.span_err(pth.span,
278278
"expected macro name without module \
279279
separators");
@@ -844,7 +844,7 @@ fn expand_pat(p: P<ast::Pat>, fld: &mut MacroExpander) -> P<ast::Pat> {
844844
},
845845
_ => unreachable!()
846846
};
847-
if pth.segments.len() > 1u {
847+
if pth.segments.len() > 1us {
848848
fld.cx.span_err(pth.span, "expected macro name without module separators");
849849
return DummyResult::raw_pat(span);
850850
}

branches/snap-stage3/src/libsyntax/ext/quote.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ fn expand_tts(cx: &ExtCtxt, sp: Span, tts: &[ast::TokenTree])
716716
// try removing it when enough of them are gone.
717717

718718
let mut p = cx.new_parser_from_tts(tts);
719-
p.quote_depth += 1u;
719+
p.quote_depth += 1us;
720720

721721
let cx_expr = p.parse_expr();
722722
if !p.eat(&token::Comma) {

branches/snap-stage3/src/libsyntax/ext/tt/macro_parser.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ pub fn initial_matcher_pos(ms: Rc<Vec<TokenTree>>, sep: Option<Token>, lo: ByteP
171171
stack: vec![],
172172
top_elts: TtSeq(ms),
173173
sep: sep,
174-
idx: 0u,
174+
idx: 0us,
175175
up: None,
176176
matches: matches,
177-
match_lo: 0u,
178-
match_cur: 0u,
177+
match_lo: 0us,
178+
match_cur: 0us,
179179
match_hi: match_idx_hi,
180180
sp_lo: lo
181181
}
@@ -238,7 +238,7 @@ pub fn nameize(p_s: &ParseSess, ms: &[TokenTree], res: &[Rc<NamedMatch>])
238238
}
239239
}
240240
let mut ret_val = HashMap::new();
241-
let mut idx = 0u;
241+
let mut idx = 0us;
242242
for m in ms.iter() { n_rec(p_s, m, res, &mut ret_val, &mut idx) }
243243
ret_val
244244
}
@@ -383,7 +383,7 @@ pub fn parse(sess: &ParseSess,
383383
if seq.op == ast::ZeroOrMore {
384384
let mut new_ei = ei.clone();
385385
new_ei.match_cur += seq.num_captures;
386-
new_ei.idx += 1u;
386+
new_ei.idx += 1us;
387387
//we specifically matched zero repeats.
388388
for idx in range(ei.match_cur, ei.match_cur + seq.num_captures) {
389389
(&mut new_ei.matches[idx]).push(Rc::new(MatchedSeq(vec![], sp)));
@@ -398,7 +398,7 @@ pub fn parse(sess: &ParseSess,
398398
cur_eis.push(box MatcherPos {
399399
stack: vec![],
400400
sep: seq.separator.clone(),
401-
idx: 0u,
401+
idx: 0us,
402402
matches: matches,
403403
match_lo: ei_t.match_cur,
404404
match_cur: ei_t.match_cur,
@@ -442,20 +442,20 @@ pub fn parse(sess: &ParseSess,
442442

443443
/* error messages here could be improved with links to orig. rules */
444444
if token_name_eq(&tok, &token::Eof) {
445-
if eof_eis.len() == 1u {
445+
if eof_eis.len() == 1us {
446446
let mut v = Vec::new();
447447
for dv in (&mut eof_eis[0]).matches.iter_mut() {
448448
v.push(dv.pop().unwrap());
449449
}
450450
return Success(nameize(sess, ms, &v[]));
451-
} else if eof_eis.len() > 1u {
451+
} else if eof_eis.len() > 1us {
452452
return Error(sp, "ambiguity: multiple successful parses".to_string());
453453
} else {
454454
return Failure(sp, "unexpected end of macro invocation".to_string());
455455
}
456456
} else {
457-
if (bb_eis.len() > 0u && next_eis.len() > 0u)
458-
|| bb_eis.len() > 1u {
457+
if (bb_eis.len() > 0us && next_eis.len() > 0us)
458+
|| bb_eis.len() > 1us {
459459
let nts = bb_eis.iter().map(|ei| {
460460
match ei.top_elts.get_tt(ei.idx) {
461461
TtToken(_, MatchNt(bind, name, _, _)) => {
@@ -469,12 +469,12 @@ pub fn parse(sess: &ParseSess,
469469
"local ambiguity: multiple parsing options: \
470470
built-in NTs {} or {} other options.",
471471
nts, next_eis.len()).to_string());
472-
} else if bb_eis.len() == 0u && next_eis.len() == 0u {
472+
} else if bb_eis.len() == 0us && next_eis.len() == 0us {
473473
return Failure(sp, format!("no rules expected the token `{}`",
474474
pprust::token_to_string(&tok)).to_string());
475-
} else if next_eis.len() > 0u {
475+
} else if next_eis.len() > 0us {
476476
/* Now process the next token */
477-
while next_eis.len() > 0u {
477+
while next_eis.len() > 0us {
478478
cur_eis.push(next_eis.pop().unwrap());
479479
}
480480
rdr.next_token();
@@ -488,7 +488,7 @@ pub fn parse(sess: &ParseSess,
488488
let match_cur = ei.match_cur;
489489
(&mut ei.matches[match_cur]).push(Rc::new(MatchedNonterminal(
490490
parse_nt(&mut rust_parser, name_string.get()))));
491-
ei.idx += 1u;
491+
ei.idx += 1us;
492492
ei.match_cur += 1;
493493
}
494494
_ => panic!()
@@ -501,16 +501,16 @@ pub fn parse(sess: &ParseSess,
501501
}
502502
}
503503

504-
assert!(cur_eis.len() > 0u);
504+
assert!(cur_eis.len() > 0us);
505505
}
506506
}
507507

508508
pub fn parse_nt(p: &mut Parser, name: &str) -> Nonterminal {
509509
match name {
510510
"tt" => {
511-
p.quote_depth += 1u; //but in theory, non-quoted tts might be useful
511+
p.quote_depth += 1us; //but in theory, non-quoted tts might be useful
512512
let res = token::NtTT(P(p.parse_token_tree()));
513-
p.quote_depth -= 1u;
513+
p.quote_depth -= 1us;
514514
return res;
515515
}
516516
_ => {}

branches/snap-stage3/src/libsyntax/ext/tt/transcribe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan {
223223
r.repeat_len.pop();
224224
}
225225
} else { /* repeat */
226-
*r.repeat_idx.last_mut().unwrap() += 1u;
226+
*r.repeat_idx.last_mut().unwrap() += 1us;
227227
r.stack.last_mut().unwrap().idx = 0;
228228
match r.stack.last().unwrap().sep.clone() {
229229
Some(tk) => {

0 commit comments

Comments
 (0)