diff options
| author | Paul Collier <paul@paulcollier.ca> | 2015-01-17 23:33:05 +0000 |
|---|---|---|
| committer | Paul Collier <paul@paulcollier.ca> | 2015-01-17 23:45:29 +0000 |
| commit | a32249d4477f449646162bbad607c39d0ad7f3ca (patch) | |
| tree | fd561fde4f3f7bc60796ecd3683c1ad1c173f403 /src/libsyntax/ext | |
| parent | 89c4e3792ddc5b45706ea0e919806a248f7a87c3 (diff) | |
| download | rust-a32249d4477f449646162bbad607c39d0ad7f3ca.tar.gz rust-a32249d4477f449646162bbad607c39d0ad7f3ca.zip | |
libsyntax: uint types to usize
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/base.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/build.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/decodable.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/encodable.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/generic/mod.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/format.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/mtwt.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_parser.rs | 18 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/transcribe.rs | 8 |
10 files changed, 35 insertions, 35 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index f2498abfa6a..9128bc05f6f 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -548,7 +548,7 @@ pub struct ExtCtxt<'a> { pub exported_macros: Vec<ast::MacroDef>, pub syntax_env: SyntaxEnv, - pub recursion_count: uint, + pub recursion_count: usize, } impl<'a> ExtCtxt<'a> { diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index c34142aec39..d960186cdd8 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -116,7 +116,7 @@ pub trait AstBuilder { fn expr_mut_addr_of(&self, sp: Span, e: P<ast::Expr>) -> P<ast::Expr>; fn expr_field_access(&self, span: Span, expr: P<ast::Expr>, ident: ast::Ident) -> P<ast::Expr>; fn expr_tup_field_access(&self, sp: Span, expr: P<ast::Expr>, - idx: uint) -> P<ast::Expr>; + idx: usize) -> P<ast::Expr>; fn expr_call(&self, span: Span, expr: P<ast::Expr>, args: Vec<P<ast::Expr>>) -> P<ast::Expr>; fn expr_call_ident(&self, span: Span, id: ast::Ident, args: Vec<P<ast::Expr>>) -> P<ast::Expr>; fn expr_call_global(&self, sp: Span, fn_path: Vec<ast::Ident>, @@ -134,7 +134,7 @@ pub trait AstBuilder { fn expr_lit(&self, sp: Span, lit: ast::Lit_) -> P<ast::Expr>; - fn expr_uint(&self, span: Span, i: uint) -> P<ast::Expr>; + fn expr_uint(&self, span: Span, i: usize) -> P<ast::Expr>; fn expr_int(&self, sp: Span, i: int) -> P<ast::Expr>; fn expr_u8(&self, sp: Span, u: u8) -> P<ast::Expr>; fn expr_bool(&self, sp: Span, value: bool) -> P<ast::Expr>; @@ -587,7 +587,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { let id = Spanned { node: ident, span: field_span }; self.expr(sp, ast::ExprField(expr, id)) } - fn expr_tup_field_access(&self, sp: Span, expr: P<ast::Expr>, idx: uint) -> P<ast::Expr> { + fn expr_tup_field_access(&self, sp: Span, expr: P<ast::Expr>, idx: usize) -> P<ast::Expr> { let field_span = Span { lo: sp.lo - Pos::from_uint(idx.to_string().len()), hi: sp.hi, @@ -641,7 +641,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> { fn expr_lit(&self, sp: Span, lit: ast::Lit_) -> P<ast::Expr> { self.expr(sp, ast::ExprLit(P(respan(sp, lit)))) } - fn expr_uint(&self, span: Span, i: uint) -> P<ast::Expr> { + fn expr_uint(&self, span: Span, i: usize) -> P<ast::Expr> { self.expr_lit(span, ast::LitInt(i as u64, ast::UnsignedIntLit(ast::TyUs(false)))) } fn expr_int(&self, sp: Span, i: int) -> P<ast::Expr> { diff --git a/src/libsyntax/ext/deriving/decodable.rs b/src/libsyntax/ext/deriving/decodable.rs index f73023ddd1e..6a41874b935 100644 --- a/src/libsyntax/ext/deriving/decodable.rs +++ b/src/libsyntax/ext/deriving/decodable.rs @@ -179,14 +179,14 @@ fn decodable_substructure(cx: &mut ExtCtxt, trait_span: Span, /// Create a decoder for a single enum variant/struct: /// - `outer_pat_path` is the path to this enum variant/struct -/// - `getarg` should retrieve the `uint`-th field with name `@str`. +/// - `getarg` should retrieve the `usize`-th field with name `@str`. fn decode_static_fields<F>(cx: &mut ExtCtxt, trait_span: Span, outer_pat_path: ast::Path, fields: &StaticFields, mut getarg: F) -> P<Expr> where - F: FnMut(&mut ExtCtxt, Span, InternedString, uint) -> P<Expr>, + F: FnMut(&mut ExtCtxt, Span, InternedString, usize) -> P<Expr>, { match *fields { Unnamed(ref fields) => { diff --git a/src/libsyntax/ext/deriving/encodable.rs b/src/libsyntax/ext/deriving/encodable.rs index 616390467f0..496aec556f1 100644 --- a/src/libsyntax/ext/deriving/encodable.rs +++ b/src/libsyntax/ext/deriving/encodable.rs @@ -16,7 +16,7 @@ //! //! ```ignore //! #[derive(Encodable, Decodable)] -//! struct Node { id: uint } +//! struct Node { id: usize } //! ``` //! //! would generate two implementations like: diff --git a/src/libsyntax/ext/deriving/generic/mod.rs b/src/libsyntax/ext/deriving/generic/mod.rs index 161b27d7abb..27199de0ea8 100644 --- a/src/libsyntax/ext/deriving/generic/mod.rs +++ b/src/libsyntax/ext/deriving/generic/mod.rs @@ -294,7 +294,7 @@ pub enum SubstructureFields<'a> { /// Matching variants of the enum: variant index, ast::Variant, /// fields: the field name is only non-`None` in the case of a struct /// variant. - EnumMatching(uint, &'a ast::Variant, Vec<FieldInfo>), + EnumMatching(usize, &'a ast::Variant, Vec<FieldInfo>), /// Non-matching variants of the enum, but with all state hidden from /// the consequent code. The first component holds `Ident`s for all of @@ -915,7 +915,7 @@ impl<'a> MethodDef<'a> { .collect::<Vec<ast::Ident>>(); // The `vi_idents` will be bound, solely in the catch-all, to - // a series of let statements mapping each self_arg to a uint + // a series of let statements mapping each self_arg to a usize // corresponding to its variant index. let vi_idents: Vec<ast::Ident> = self_arg_names.iter() .map(|name| { let vi_suffix = format!("{}_vi", &name[]); @@ -1039,7 +1039,7 @@ impl<'a> MethodDef<'a> { }).collect(); // Build a series of let statements mapping each self_arg - // to a uint corresponding to its variant index. + // to a usize corresponding to its variant index. // i.e. for `enum E<T> { A, B(1), C(T, T) }`, and a deriving // with three Self args, builds three statements: // diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index c95bdeefd45..1fd0334c016 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -1311,7 +1311,7 @@ fn new_span(cx: &ExtCtxt, sp: Span) -> Span { pub struct ExpansionConfig { pub crate_name: String, pub enable_quotes: bool, - pub recursion_limit: uint, + pub recursion_limit: usize, } impl ExpansionConfig { @@ -1595,7 +1595,7 @@ mod test { // in principle, you might want to control this boolean on a per-varref basis, // but that would make things even harder to understand, and might not be // necessary for thorough testing. - type RenamingTest = (&'static str, Vec<Vec<uint>>, bool); + type RenamingTest = (&'static str, Vec<Vec<usize>>, bool); #[test] fn automatic_renaming () { @@ -1749,7 +1749,7 @@ mod test { } // run one of the renaming tests - fn run_renaming_test(t: &RenamingTest, test_idx: uint) { + fn run_renaming_test(t: &RenamingTest, test_idx: usize) { let invalid_name = token::special_idents::invalid.name; let (teststr, bound_connections, bound_ident_check) = match *t { (ref str,ref conns, bic) => (str.to_string(), conns.clone(), bic) diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index f512b33f024..684ae84872b 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -31,7 +31,7 @@ enum ArgumentType { } enum Position { - Exact(uint), + Exact(usize), Named(String), } @@ -61,11 +61,11 @@ struct Context<'a, 'b:'a> { /// Stays `true` if all formatting parameters are default (as in "{}{}"). all_pieces_simple: bool, - name_positions: HashMap<String, uint>, + name_positions: HashMap<String, usize>, /// Updated as arguments are consumed or methods are entered - nest_level: uint, - next_arg: uint, + nest_level: usize, + next_arg: usize, } /// Parses the arguments from the given list of tokens, returning None diff --git a/src/libsyntax/ext/mtwt.rs b/src/libsyntax/ext/mtwt.rs index ae8ff118fcc..9bcb026a550 100644 --- a/src/libsyntax/ext/mtwt.rs +++ b/src/libsyntax/ext/mtwt.rs @@ -187,7 +187,7 @@ fn resolve_internal(id: Ident, } let resolved = { - let result = (*table.table.borrow())[id.ctxt as uint]; + let result = (*table.table.borrow())[id.ctxt as usize]; match result { EmptyCtxt => id.name, // ignore marks here: @@ -231,7 +231,7 @@ fn marksof_internal(ctxt: SyntaxContext, let mut result = Vec::new(); let mut loopvar = ctxt; loop { - let table_entry = (*table.table.borrow())[loopvar as uint]; + let table_entry = (*table.table.borrow())[loopvar as usize]; match table_entry { EmptyCtxt => { return result; @@ -258,7 +258,7 @@ fn marksof_internal(ctxt: SyntaxContext, /// FAILS when outside is not a mark. pub fn outer_mark(ctxt: SyntaxContext) -> Mrk { with_sctable(|sctable| { - match (*sctable.table.borrow())[ctxt as uint] { + match (*sctable.table.borrow())[ctxt as usize] { Mark(mrk, _) => mrk, _ => panic!("can't retrieve outer mark when outside is not a mark") } @@ -330,7 +330,7 @@ mod tests { let mut result = Vec::new(); loop { let table = table.table.borrow(); - match (*table)[sc as uint] { + match (*table)[sc as usize] { EmptyCtxt => {return result;}, Mark(mrk,tail) => { result.push(M(mrk)); diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 9eda4bcef99..75d904a4632 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -110,14 +110,14 @@ enum TokenTreeOrTokenTreeVec { } impl TokenTreeOrTokenTreeVec { - fn len(&self) -> uint { + fn len(&self) -> usize { match self { &TtSeq(ref v) => v.len(), &Tt(ref tt) => tt.len(), } } - fn get_tt(&self, index: uint) -> TokenTree { + fn get_tt(&self, index: usize) -> TokenTree { match self { &TtSeq(ref v) => v[index].clone(), &Tt(ref tt) => tt.get_tt(index), @@ -129,7 +129,7 @@ impl TokenTreeOrTokenTreeVec { #[derive(Clone)] struct MatcherTtFrame { elts: TokenTreeOrTokenTreeVec, - idx: uint, + idx: usize, } #[derive(Clone)] @@ -137,16 +137,16 @@ pub struct MatcherPos { stack: Vec<MatcherTtFrame>, top_elts: TokenTreeOrTokenTreeVec, sep: Option<Token>, - idx: uint, + idx: usize, up: Option<Box<MatcherPos>>, matches: Vec<Vec<Rc<NamedMatch>>>, - match_lo: uint, - match_cur: uint, - match_hi: uint, + match_lo: usize, + match_cur: usize, + match_hi: usize, sp_lo: BytePos, } -pub fn count_names(ms: &[TokenTree]) -> uint { +pub fn count_names(ms: &[TokenTree]) -> usize { ms.iter().fold(0, |count, elt| { count + match elt { &TtSequence(_, ref seq) => { @@ -206,7 +206,7 @@ pub enum NamedMatch { pub fn nameize(p_s: &ParseSess, ms: &[TokenTree], res: &[Rc<NamedMatch>]) -> HashMap<Ident, Rc<NamedMatch>> { fn n_rec(p_s: &ParseSess, m: &TokenTree, res: &[Rc<NamedMatch>], - ret_val: &mut HashMap<Ident, Rc<NamedMatch>>, idx: &mut uint) { + ret_val: &mut HashMap<Ident, Rc<NamedMatch>>, idx: &mut usize) { match m { &TtSequence(_, ref seq) => { for next_m in seq.tts.iter() { diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index 94b8356130a..7936b9fcfc7 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -27,7 +27,7 @@ use std::collections::HashMap; #[derive(Clone)] struct TtFrame { forest: TokenTree, - idx: uint, + idx: usize, dotdotdoted: bool, sep: Option<Token>, } @@ -43,8 +43,8 @@ pub struct TtReader<'a> { // Some => return imported_from as the next token crate_name_next: Option<Span>, - repeat_idx: Vec<uint>, - repeat_len: Vec<uint>, + repeat_idx: Vec<usize>, + repeat_len: Vec<usize>, /* cached: */ pub cur_tok: Token, pub cur_span: Span, @@ -124,7 +124,7 @@ fn lookup_cur_matched(r: &TtReader, name: Ident) -> Option<Rc<NamedMatch>> { #[derive(Clone)] enum LockstepIterSize { LisUnconstrained, - LisConstraint(uint, Ident), + LisConstraint(usize, Ident), LisContradiction(String), } |
