Skip to content

Commit 856ef98

Browse files
committed
---
yaml --- r: 174731 b: refs/heads/snap-stage3 c: d5c8365 h: refs/heads/master i: 174729: a755594 174727: 7e1e385 v: v3
1 parent ca4e86f commit 856ef98

File tree

31 files changed

+98
-98
lines changed

31 files changed

+98
-98
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: a32249d4477f449646162bbad607c39d0ad7f3ca
4+
refs/heads/snap-stage3: d5c83652b33a6e5049699ccc7e6bd6fffb42c2b8
55
refs/heads/try: 08f6380a9f0b866796080094f44fe25ea5636547
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/librustc/lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ impl UnusedMut {
13291329
let ident = path1.node;
13301330
if let ast::BindByValue(ast::MutMutable) = mode {
13311331
if !token::get_ident(ident).get().starts_with("_") {
1332-
match mutables.entry(ident.name.uint()) {
1332+
match mutables.entry(ident.name.usize()) {
13331333
Vacant(entry) => { entry.insert(vec![id]); },
13341334
Occupied(mut entry) => { entry.get_mut().push(id); },
13351335
}

branches/snap-stage3/src/librustc/util/ppaux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ pub fn explain_region_and_span(cx: &ctxt, region: ty::Region)
164164
fn explain_span(cx: &ctxt, heading: &str, span: Span)
165165
-> (String, Option<Span>) {
166166
let lo = cx.sess.codemap().lookup_char_pos_adj(span.lo);
167-
(format!("the {} at {}:{}", heading, lo.line, lo.col.to_uint()),
167+
(format!("the {} at {}:{}", heading, lo.line, lo.col.to_usize()),
168168
Some(span))
169169
}
170170
}

branches/snap-stage3/src/librustc_resolve/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
19621962
let module_name = self.module_to_string(&*search_module);
19631963
let mut span = span;
19641964
let msg = if "???" == &module_name[] {
1965-
span.hi = span.lo + Pos::from_uint(segment_name.get().len());
1965+
span.hi = span.lo + Pos::from_usize(segment_name.get().len());
19661966

19671967
match search_parent_externals(name,
19681968
&self.current_module) {

branches/snap-stage3/src/librustc_trans/save/span_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ impl<'a> SpanUtils<'a> {
4040
format!("file_name,{},file_line,{},file_col,{},extent_start,{},extent_start_bytes,{},\
4141
file_line_end,{},file_col_end,{},extent_end,{},extent_end_bytes,{}",
4242
lo_loc.file.name,
43-
lo_loc.line, lo_loc.col.to_uint(), lo_pos.to_uint(), lo_pos_byte.to_uint(),
44-
hi_loc.line, hi_loc.col.to_uint(), hi_pos.to_uint(), hi_pos_byte.to_uint())
43+
lo_loc.line, lo_loc.col.to_usize(), lo_pos.to_usize(), lo_pos_byte.to_usize(),
44+
hi_loc.line, hi_loc.col.to_usize(), hi_pos.to_usize(), hi_pos_byte.to_usize())
4545
}
4646

4747
// sub_span starts at span.lo, so we need to adjust the positions etc.

branches/snap-stage3/src/librustc_trans/trans/common.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ pub fn return_type_is_void(ccx: &CrateContext, ty: Ty) -> bool {
275275
/// Generates a unique symbol based off the name given. This is used to create
276276
/// unique symbols for things like closures.
277277
pub fn gensym_name(name: &str) -> PathElem {
278-
let num = token::gensym(name).uint();
278+
let num = token::gensym(name).usize();
279279
// use one colon which will get translated to a period by the mangler, and
280280
// we're guaranteed that `num` is globally unique for this crate.
281281
PathName(token::gensym(&format!("{}:{}", name, num)[]))
@@ -848,7 +848,7 @@ pub fn C_cstr(cx: &CrateContext, s: InternedString, null_terminated: bool) -> Va
848848
!null_terminated as Bool);
849849

850850
let gsym = token::gensym("str");
851-
let buf = CString::from_vec(format!("str{}", gsym.uint()).into_bytes());
851+
let buf = CString::from_vec(format!("str{}", gsym.usize()).into_bytes());
852852
let g = llvm::LLVMAddGlobal(cx.llmod(), val_ty(sc).to_ref(), buf.as_ptr());
853853
llvm::LLVMSetInitializer(g, sc);
854854
llvm::LLVMSetGlobalConstant(g, True);
@@ -873,7 +873,7 @@ pub fn C_binary_slice(cx: &CrateContext, data: &[u8]) -> ValueRef {
873873
let lldata = C_bytes(cx, data);
874874

875875
let gsym = token::gensym("binary");
876-
let name = format!("binary{}", gsym.uint());
876+
let name = format!("binary{}", gsym.usize());
877877
let name = CString::from_vec(name.into_bytes());
878878
let g = llvm::LLVMAddGlobal(cx.llmod(), val_ty(lldata).to_ref(),
879879
name.as_ptr());

branches/snap-stage3/src/librustc_trans/trans/debuginfo.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,7 +1204,7 @@ pub fn set_source_location(fcx: &FunctionContext,
12041204

12051205
set_debug_location(cx, DebugLocation::new(scope,
12061206
loc.line,
1207-
loc.col.to_uint()));
1207+
loc.col.to_usize()));
12081208
} else {
12091209
set_debug_location(cx, UnknownLocation);
12101210
}
@@ -1719,7 +1719,7 @@ fn declare_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
17191719

17201720
set_debug_location(cx, DebugLocation::new(scope_metadata,
17211721
loc.line,
1722-
loc.col.to_uint()));
1722+
loc.col.to_usize()));
17231723
unsafe {
17241724
let instr = llvm::LLVMDIBuilderInsertDeclareAtEnd(
17251725
DIB(cx),
@@ -3282,7 +3282,7 @@ fn create_scope_map(cx: &CrateContext,
32823282
parent_scope,
32833283
file_metadata,
32843284
loc.line as c_uint,
3285-
loc.col.to_uint() as c_uint)
3285+
loc.col.to_usize() as c_uint)
32863286
};
32873287

32883288
scope_stack.push(ScopeStackEntry { scope_metadata: scope_metadata,
@@ -3404,7 +3404,7 @@ fn create_scope_map(cx: &CrateContext,
34043404
parent_scope,
34053405
file_metadata,
34063406
loc.line as c_uint,
3407-
loc.col.to_uint() as c_uint)
3407+
loc.col.to_usize() as c_uint)
34083408
};
34093409

34103410
scope_stack.push(ScopeStackEntry {

branches/snap-stage3/src/librustc_trans/trans/meth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ pub fn make_vtable<I: Iterator<Item=ValueRef>>(ccx: &CrateContext,
785785
unsafe {
786786
let tbl = C_struct(ccx, &components[], false);
787787
let sym = token::gensym("vtable");
788-
let buf = CString::from_vec(format!("vtable{}", sym.uint()).into_bytes());
788+
let buf = CString::from_vec(format!("vtable{}", sym.usize()).into_bytes());
789789
let vt_gvar = llvm::LLVMAddGlobal(ccx.llmod(), val_ty(tbl).to_ref(),
790790
buf.as_ptr());
791791
llvm::LLVMSetInitializer(vt_gvar, tbl);

branches/snap-stage3/src/librustdoc/clean/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,9 +1870,9 @@ impl Clean<Span> for syntax::codemap::Span {
18701870
Span {
18711871
filename: filename.to_string(),
18721872
loline: lo.line,
1873-
locol: lo.col.to_uint(),
1873+
locol: lo.col.to_usize(),
18741874
hiline: hi.line,
1875-
hicol: hi.col.to_uint(),
1875+
hicol: hi.col.to_usize(),
18761876
}
18771877
}
18781878
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl Ident {
9595

9696
pub fn encode_with_hygiene(&self) -> String {
9797
format!("\x00name_{},ctxt_{}\x00",
98-
self.name.uint(),
98+
self.name.usize(),
9999
self.ctxt)
100100
}
101101
}
@@ -181,7 +181,7 @@ impl Name {
181181
}
182182
}
183183

184-
pub fn uint(&self) -> usize {
184+
pub fn usize(&self) -> usize {
185185
let Name(nm) = *self;
186186
nm as usize
187187
}

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ use libc::c_uint;
3030
use serialize::{Encodable, Decodable, Encoder, Decoder};
3131

3232
pub trait Pos {
33-
fn from_uint(n: usize) -> Self;
34-
fn to_uint(&self) -> usize;
33+
fn from_usize(n: usize) -> Self;
34+
fn to_usize(&self) -> usize;
3535
}
3636

3737
/// A byte offset. Keep this small (currently 32-bits), as AST contains
@@ -49,44 +49,44 @@ pub struct CharPos(pub usize);
4949
// have been unsuccessful
5050

5151
impl Pos for BytePos {
52-
fn from_uint(n: usize) -> BytePos { BytePos(n as u32) }
53-
fn to_uint(&self) -> usize { let BytePos(n) = *self; n as usize }
52+
fn from_usize(n: usize) -> BytePos { BytePos(n as u32) }
53+
fn to_usize(&self) -> usize { let BytePos(n) = *self; n as usize }
5454
}
5555

5656
impl Add for BytePos {
5757
type Output = BytePos;
5858

5959
fn add(self, rhs: BytePos) -> BytePos {
60-
BytePos((self.to_uint() + rhs.to_uint()) as u32)
60+
BytePos((self.to_usize() + rhs.to_usize()) as u32)
6161
}
6262
}
6363

6464
impl Sub for BytePos {
6565
type Output = BytePos;
6666

6767
fn sub(self, rhs: BytePos) -> BytePos {
68-
BytePos((self.to_uint() - rhs.to_uint()) as u32)
68+
BytePos((self.to_usize() - rhs.to_usize()) as u32)
6969
}
7070
}
7171

7272
impl Pos for CharPos {
73-
fn from_uint(n: usize) -> CharPos { CharPos(n) }
74-
fn to_uint(&self) -> usize { let CharPos(n) = *self; n }
73+
fn from_usize(n: usize) -> CharPos { CharPos(n) }
74+
fn to_usize(&self) -> usize { let CharPos(n) = *self; n }
7575
}
7676

7777
impl Add for CharPos {
7878
type Output = CharPos;
7979

8080
fn add(self, rhs: CharPos) -> CharPos {
81-
CharPos(self.to_uint() + rhs.to_uint())
81+
CharPos(self.to_usize() + rhs.to_usize())
8282
}
8383
}
8484

8585
impl Sub for CharPos {
8686
type Output = CharPos;
8787

8888
fn sub(self, rhs: CharPos) -> CharPos {
89-
CharPos(self.to_uint() - rhs.to_uint())
89+
CharPos(self.to_usize() - rhs.to_usize())
9090
}
9191
}
9292

@@ -310,7 +310,7 @@ impl FileMap {
310310
let lines = self.lines.borrow();
311311
lines.get(line_number).map(|&line| {
312312
let begin: BytePos = line - self.start_pos;
313-
let begin = begin.to_uint();
313+
let begin = begin.to_usize();
314314
let slice = &self.src[begin..];
315315
match slice.find('\n') {
316316
Some(e) => &slice[..e],
@@ -351,7 +351,7 @@ impl CodeMap {
351351
let mut files = self.files.borrow_mut();
352352
let start_pos = match files.last() {
353353
None => 0,
354-
Some(last) => last.start_pos.to_uint() + last.src.len(),
354+
Some(last) => last.start_pos.to_usize() + last.src.len(),
355355
};
356356

357357
// Remove utf-8 BOM if any.
@@ -374,7 +374,7 @@ impl CodeMap {
374374
let filemap = Rc::new(FileMap {
375375
name: filename,
376376
src: src.to_string(),
377-
start_pos: Pos::from_uint(start_pos),
377+
start_pos: Pos::from_usize(start_pos),
378378
lines: RefCell::new(Vec::new()),
379379
multibyte_chars: RefCell::new(Vec::new()),
380380
});
@@ -389,7 +389,7 @@ impl CodeMap {
389389
(format!("<{}:{}:{}>",
390390
pos.file.name,
391391
pos.line,
392-
pos.col.to_uint() + 1)).to_string()
392+
pos.col.to_usize() + 1)).to_string()
393393
}
394394

395395
/// Lookup source information about a BytePos
@@ -417,9 +417,9 @@ impl CodeMap {
417417
return (format!("{}:{}:{}: {}:{}",
418418
lo.filename,
419419
lo.line,
420-
lo.col.to_uint() + 1,
420+
lo.col.to_usize() + 1,
421421
hi.line,
422-
hi.col.to_uint() + 1)).to_string()
422+
hi.col.to_usize() + 1)).to_string()
423423
}
424424

425425
pub fn span_to_filename(&self, sp: Span) -> FileName {
@@ -447,7 +447,7 @@ impl CodeMap {
447447
if begin.fm.start_pos != end.fm.start_pos {
448448
None
449449
} else {
450-
Some((&begin.fm.src[begin.pos.to_uint()..end.pos.to_uint()]).to_string())
450+
Some((&begin.fm.src[begin.pos.to_usize()..end.pos.to_usize()]).to_string())
451451
}
452452
}
453453

@@ -484,14 +484,14 @@ impl CodeMap {
484484
total_extra_bytes += mbc.bytes - 1;
485485
// We should never see a byte position in the middle of a
486486
// character
487-
assert!(bpos.to_uint() >= mbc.pos.to_uint() + mbc.bytes);
487+
assert!(bpos.to_usize() >= mbc.pos.to_usize() + mbc.bytes);
488488
} else {
489489
break;
490490
}
491491
}
492492

493-
assert!(map.start_pos.to_uint() + total_extra_bytes <= bpos.to_uint());
494-
CharPos(bpos.to_uint() - map.start_pos.to_uint() - total_extra_bytes)
493+
assert!(map.start_pos.to_usize() + total_extra_bytes <= bpos.to_usize());
494+
CharPos(bpos.to_usize() - map.start_pos.to_usize() - total_extra_bytes)
495495
}
496496

497497
fn lookup_filemap_idx(&self, pos: BytePos) -> usize {
@@ -520,13 +520,13 @@ impl CodeMap {
520520
}
521521
if a == 0 {
522522
panic!("position {} does not resolve to a source location",
523-
pos.to_uint());
523+
pos.to_usize());
524524
}
525525
a -= 1;
526526
}
527527
if a >= len {
528528
panic!("position {} does not resolve to a source location",
529-
pos.to_uint())
529+
pos.to_usize())
530530
}
531531

532532
return a;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ fn highlight_lines(err: &mut EmitterWriter,
475475
while num > 0u { num /= 10u; digits += 1u; }
476476

477477
// indent past |name:## | and the 0-offset column location
478-
let left = fm.name.len() + digits + lo.col.to_uint() + 3u;
478+
let left = fm.name.len() + digits + lo.col.to_usize() + 3u;
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.
@@ -502,7 +502,7 @@ fn highlight_lines(err: &mut EmitterWriter,
502502
let hi = cm.lookup_char_pos(sp.hi);
503503
if hi.col != lo.col {
504504
// the ^ already takes up one space
505-
let num_squigglies = hi.col.to_uint() - lo.col.to_uint() - 1u;
505+
let num_squigglies = hi.col.to_usize() - lo.col.to_usize() - 1us;
506506
for _ in range(0, num_squigglies) {
507507
s.push('~');
508508
}
@@ -551,7 +551,7 @@ fn custom_highlight_lines(w: &mut EmitterWriter,
551551
let last_line_start = format!("{}:{} ", fm.name, lines[lines.len()-1]+1);
552552
let hi = cm.lookup_char_pos(sp.hi);
553553
// Span seems to use half-opened interval, so subtract 1
554-
let skip = last_line_start.len() + hi.col.to_uint() - 1;
554+
let skip = last_line_start.len() + hi.col.to_usize() - 1;
555555
let mut s = String::new();
556556
for _ in range(0, skip) {
557557
s.push(' ');

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ pub trait AstBuilder {
134134

135135
fn expr_lit(&self, sp: Span, lit: ast::Lit_) -> P<ast::Expr>;
136136

137-
fn expr_uint(&self, span: Span, i: usize) -> P<ast::Expr>;
137+
fn expr_usize(&self, span: Span, i: usize) -> P<ast::Expr>;
138138
fn expr_int(&self, sp: Span, i: int) -> P<ast::Expr>;
139139
fn expr_u8(&self, sp: Span, u: u8) -> P<ast::Expr>;
140140
fn expr_bool(&self, sp: Span, value: bool) -> P<ast::Expr>;
@@ -579,7 +579,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
579579
fn expr_field_access(&self, sp: Span, expr: P<ast::Expr>, ident: ast::Ident) -> P<ast::Expr> {
580580
let field_name = token::get_ident(ident);
581581
let field_span = Span {
582-
lo: sp.lo - Pos::from_uint(field_name.get().len()),
582+
lo: sp.lo - Pos::from_usize(field_name.get().len()),
583583
hi: sp.hi,
584584
expn_id: sp.expn_id,
585585
};
@@ -589,7 +589,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
589589
}
590590
fn expr_tup_field_access(&self, sp: Span, expr: P<ast::Expr>, idx: usize) -> P<ast::Expr> {
591591
let field_span = Span {
592-
lo: sp.lo - Pos::from_uint(idx.to_string().len()),
592+
lo: sp.lo - Pos::from_usize(idx.to_string().len()),
593593
hi: sp.hi,
594594
expn_id: sp.expn_id,
595595
};
@@ -641,7 +641,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
641641
fn expr_lit(&self, sp: Span, lit: ast::Lit_) -> P<ast::Expr> {
642642
self.expr(sp, ast::ExprLit(P(respan(sp, lit))))
643643
}
644-
fn expr_uint(&self, span: Span, i: usize) -> P<ast::Expr> {
644+
fn expr_usize(&self, span: Span, i: usize) -> P<ast::Expr> {
645645
self.expr_lit(span, ast::LitInt(i as u64, ast::UnsignedIntLit(ast::TyUs(false))))
646646
}
647647
fn expr_int(&self, sp: Span, i: int) -> P<ast::Expr> {
@@ -710,7 +710,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
710710
let loc = self.codemap().lookup_char_pos(span.lo);
711711
let expr_file = self.expr_str(span,
712712
token::intern_and_get_ident(&loc.file.name[]));
713-
let expr_line = self.expr_uint(span, loc.line);
713+
let expr_line = self.expr_usize(span, loc.line);
714714
let expr_file_line_tuple = self.expr_tuple(span, vec!(expr_file, expr_line));
715715
let expr_file_line_ptr = self.expr_addr_of(span, expr_file_line_tuple);
716716
self.expr_call_global(

0 commit comments

Comments
 (0)