From f0eae8f1c19a051ab750383e479f979c32d4598a Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 7 Sep 2012 14:50:47 -0700 Subject: Convert field terminators to commas. Stop parsing semis. --- src/rustc/back/link.rs | 4 +-- src/rustc/middle/liveness.rs | 32 ++++++++--------- src/rustc/middle/mem_categorization.rs | 4 +-- src/rustc/middle/region.rs | 10 +++--- src/rustc/middle/resolve.rs | 14 ++++---- src/rustc/middle/trans/alt.rs | 14 ++++---- src/rustc/middle/trans/callee.rs | 14 ++++---- src/rustc/middle/trans/closure.rs | 4 +-- src/rustc/middle/trans/common.rs | 10 +++--- src/rustc/middle/trans/datum.rs | 12 +++---- src/rustc/middle/trans/tvec.rs | 8 ++--- src/rustc/middle/ty.rs | 20 +++++------ src/rustc/middle/typeck/check.rs | 26 +++++++------- src/rustc/middle/typeck/infer.rs | 6 ++-- src/rustc/middle/typeck/infer/combine.rs | 6 ++-- .../middle/typeck/infer/region_var_bindings.rs | 40 +++++++++++----------- src/rustc/middle/typeck/infer/unify.rs | 10 +++--- src/rustc/middle/typeck/rscope.rs | 4 +-- 18 files changed, 119 insertions(+), 119 deletions(-) (limited to 'src/rustc') diff --git a/src/rustc/back/link.rs b/src/rustc/back/link.rs index afd94e4f437..2a9c792da14 100644 --- a/src/rustc/back/link.rs +++ b/src/rustc/back/link.rs @@ -77,8 +77,8 @@ mod jit { } struct Closure { - code: *(); - env: *(); + code: *(), + env: *(), } fn exec(sess: session, diff --git a/src/rustc/middle/liveness.rs b/src/rustc/middle/liveness.rs index bb3d1d26d65..9aca98f61e5 100644 --- a/src/rustc/middle/liveness.rs +++ b/src/rustc/middle/liveness.rs @@ -241,10 +241,10 @@ enum LocalKind { } struct LocalInfo { - id: node_id; - ident: ident; - is_mutbl: bool; - kind: LocalKind; + id: node_id, + ident: ident, + is_mutbl: bool, + kind: LocalKind, } enum VarKind { @@ -268,18 +268,18 @@ fn relevant_def(def: def) -> Option { } struct IrMaps { - tcx: ty::ctxt; - method_map: typeck::method_map; - last_use_map: last_use_map; - - mut num_live_nodes: uint; - mut num_vars: uint; - live_node_map: hashmap; - variable_map: hashmap; - field_map: hashmap; - capture_map: hashmap; - mut var_kinds: ~[VarKind]; - mut lnks: ~[LiveNodeKind]; + tcx: ty::ctxt, + method_map: typeck::method_map, + last_use_map: last_use_map, + + mut num_live_nodes: uint, + mut num_vars: uint, + live_node_map: hashmap, + variable_map: hashmap, + field_map: hashmap, + capture_map: hashmap, + mut var_kinds: ~[VarKind], + mut lnks: ~[LiveNodeKind], } fn IrMaps(tcx: ty::ctxt, method_map: typeck::method_map, diff --git a/src/rustc/middle/mem_categorization.rs b/src/rustc/middle/mem_categorization.rs index 77e234770e6..7440d37ae5d 100644 --- a/src/rustc/middle/mem_categorization.rs +++ b/src/rustc/middle/mem_categorization.rs @@ -415,8 +415,8 @@ impl ty::ctxt: get_type_for_node { } struct mem_categorization_ctxt { - tcx: ty::ctxt; - method_map: typeck::method_map; + tcx: ty::ctxt, + method_map: typeck::method_map, } impl &mem_categorization_ctxt { diff --git a/src/rustc/middle/region.rs b/src/rustc/middle/region.rs index 514a816a63a..9b1065cf863 100644 --- a/src/rustc/middle/region.rs +++ b/src/rustc/middle/region.rs @@ -42,11 +42,11 @@ Encodes the bounding lifetime for a given AST node: type region_map = hashmap; struct ctxt { - sess: session; - def_map: resolve::DefMap; + sess: session, + def_map: resolve::DefMap, // Generated maps: - region_map: region_map; + region_map: region_map, // Generally speaking, expressions are parented to their innermost // enclosing block. But some kinds of expressions serve as @@ -55,7 +55,7 @@ struct ctxt { // the condition in a while loop is always a parent. In those // cases, we add the node id of such an expression to this set so // that when we visit it we can view it as a parent. - root_exprs: hashmap; + root_exprs: hashmap, // The parent scope is the innermost block, statement, call, or alt // expression during the execution of which the current expression @@ -88,7 +88,7 @@ struct ctxt { // Here, the first argument `&**x` will be a borrow of the `~int`, // but the second argument overwrites that very value! Bad. // (This test is borrowck-pure-scope-in-call.rs, btw) - parent: parent; + parent: parent, } /// Returns true if `subscope` is equal to or is lexically nested inside diff --git a/src/rustc/middle/resolve.rs b/src/rustc/middle/resolve.rs index 375d0c95809..1b7f2d60bd7 100644 --- a/src/rustc/middle/resolve.rs +++ b/src/rustc/middle/resolve.rs @@ -67,8 +67,8 @@ use str_eq = str::eq; type DefMap = hashmap; struct binding_info { - span: span; - binding_mode: binding_mode; + span: span, + binding_mode: binding_mode, } // Map from the name in a pattern to its binding mode. @@ -100,9 +100,9 @@ type ExportMap = hashmap; type ExportMap2 = hashmap; struct Export2 { - name: ~str; // The name of the target. - def_id: def_id; // The definition of the target. - reexport: bool; // Whether this is a reexport. + name: ~str, // The name of the target. + def_id: def_id, // The definition of the target. + reexport: bool, // Whether this is a reexport. } enum PatternBindingMode { @@ -493,8 +493,8 @@ impl Privacy : cmp::Eq { // Records a possibly-private definition. struct Definition { - privacy: Privacy; - def: def; + privacy: Privacy, + def: def, } // Records the definitions (at most one for each namespace) that a name is diff --git a/src/rustc/middle/trans/alt.rs b/src/rustc/middle/trans/alt.rs index 6884bc48d62..fb7c8fae337 100644 --- a/src/rustc/middle/trans/alt.rs +++ b/src/rustc/middle/trans/alt.rs @@ -72,9 +72,9 @@ fn variant_opt(tcx: ty::ctxt, pat_id: ast::node_id) -> opt { } struct binding { - val: ValueRef; - mode: ast::binding_mode; - ty: ty::t; + val: ValueRef, + mode: ast::binding_mode, + ty: ty::t } type bind_map = ~[{ @@ -683,10 +683,10 @@ fn compile_submatch(bcx: block, m: match_, vals: ~[ValueRef], } struct phi_binding { - pat_id: ast::node_id; - phi_val: ValueRef; - mode: ast::binding_mode; - ty: ty::t; + pat_id: ast::node_id, + phi_val: ValueRef, + mode: ast::binding_mode, + ty: ty::t } type phi_bindings_list = ~[phi_binding]; diff --git a/src/rustc/middle/trans/callee.rs b/src/rustc/middle/trans/callee.rs index db6e9832ffd..a92f8c9adf6 100644 --- a/src/rustc/middle/trans/callee.rs +++ b/src/rustc/middle/trans/callee.rs @@ -21,14 +21,14 @@ use util::common::indenter; // item. Note that this is just the fn-ptr and is not a Rust closure // value (which is a pair). struct FnData { - llfn: ValueRef; + llfn: ValueRef, } struct MethodData { - llfn: ValueRef; - llself: ValueRef; - self_ty: ty::t; - self_mode: ast::rmode; + llfn: ValueRef, + llself: ValueRef, + self_ty: ty::t, + self_mode: ast::rmode } enum CalleeData { @@ -38,8 +38,8 @@ enum CalleeData { } struct Callee { - bcx: block; - data: CalleeData; + bcx: block, + data: CalleeData } fn trans(bcx: block, expr: @ast::expr) -> Callee { diff --git a/src/rustc/middle/trans/closure.rs b/src/rustc/middle/trans/closure.rs index 57fcf66c701..056f432fcd5 100644 --- a/src/rustc/middle/trans/closure.rs +++ b/src/rustc/middle/trans/closure.rs @@ -100,8 +100,8 @@ enum EnvAction { } struct EnvValue { - action: EnvAction; - datum: Datum; + action: EnvAction, + datum: Datum } impl EnvAction { diff --git a/src/rustc/middle/trans/common.rs b/src/rustc/middle/trans/common.rs index dd82707fb27..f4a3af08734 100644 --- a/src/rustc/middle/trans/common.rs +++ b/src/rustc/middle/trans/common.rs @@ -176,9 +176,9 @@ type crate_ctxt = { // Types used for llself. struct ValSelfData { - v: ValueRef; - t: ty::t; - is_owned: bool; + v: ValueRef, + t: ty::t, + is_owned: bool } enum local_val { local_mem(ValueRef), local_imm(ValueRef), } @@ -527,8 +527,8 @@ fn mk_block(llbb: BasicBlockRef, parent: Option, -kind: block_kind, const first_real_arg: uint = 2u; struct Result { - bcx: block; - val: ValueRef; + bcx: block, + val: ValueRef } fn rslt(bcx: block, val: ValueRef) -> Result { diff --git a/src/rustc/middle/trans/datum.rs b/src/rustc/middle/trans/datum.rs index f70284ba547..b45b4e6bdba 100644 --- a/src/rustc/middle/trans/datum.rs +++ b/src/rustc/middle/trans/datum.rs @@ -100,24 +100,24 @@ enum CopyAction { struct Datum { /// The llvm value. This is either a pointer to the Rust value or /// the value itself, depending on `mode` below. - val: ValueRef; + val: ValueRef, /// The rust type of the value. - ty: ty::t; + ty: ty::t, /// Indicates whether this is by-ref or by-value. - mode: DatumMode; + mode: DatumMode, /// How did this value originate? This is particularly important /// if the value is MOVED or prematurely DROPPED, because it /// describes how to cancel the cleanup that was scheduled before. /// See the def'n of the `DatumSource` type. - source: DatumSource; + source: DatumSource } struct DatumBlock { - bcx: block; - datum: Datum; + bcx: block, + datum: Datum, } enum DatumMode { diff --git a/src/rustc/middle/trans/tvec.rs b/src/rustc/middle/trans/tvec.rs index 33072f87db9..7be4f8e645a 100644 --- a/src/rustc/middle/trans/tvec.rs +++ b/src/rustc/middle/trans/tvec.rs @@ -118,10 +118,10 @@ fn make_drop_glue_unboxed(bcx: block, vptr: ValueRef, vec_ty: ty::t) -> } struct VecTypes { - vec_ty: ty::t; - unit_ty: ty::t; - llunit_ty: TypeRef; - llunit_size: ValueRef; + vec_ty: ty::t, + unit_ty: ty::t, + llunit_ty: TypeRef, + llunit_size: ValueRef } impl VecTypes { diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index 87bd192427a..4c81ccd2142 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -406,10 +406,10 @@ impl fn_proto : cmp::Eq { * - `bounds` is the parameter bounds on the function's upvars. * - `ret_style` indicates whether the function returns a value or fails. */ struct FnMeta { - purity: ast::purity; - proto: fn_proto; - bounds: @~[param_bound]; - ret_style: ret_style; + purity: ast::purity, + proto: fn_proto, + bounds: @~[param_bound], + ret_style: ret_style } /** @@ -419,8 +419,8 @@ struct FnMeta { * - `inputs` is the list of arguments and their modes. * - `output` is the return type. */ struct FnSig { - inputs: ~[arg]; - output: t; + inputs: ~[arg], + output: t } /** @@ -429,8 +429,8 @@ struct FnSig { * by the meta information because, in some cases, the * meta information is inferred. */ struct FnTyBase { - meta: M; - sig: FnSig; + meta: M, + sig: FnSig } type FnTy = FnTyBase; @@ -556,8 +556,8 @@ enum terr_vstore_kind { } struct expected_found { - expected: T; - found: T; + expected: T, + found: T } // Data structures used in type unification diff --git a/src/rustc/middle/typeck/check.rs b/src/rustc/middle/typeck/check.rs index 177fa297237..96d9bf1e2e5 100644 --- a/src/rustc/middle/typeck/check.rs +++ b/src/rustc/middle/typeck/check.rs @@ -97,22 +97,22 @@ type self_info = { /// `bar()` will each have their own `fn_ctxt`, but they will /// share the inherited fields. struct inherited { - infcx: infer::infer_ctxt; - locals: hashmap; - node_types: hashmap; - node_type_substs: hashmap; - borrowings: hashmap; + infcx: infer::infer_ctxt, + locals: hashmap, + node_types: hashmap, + node_type_substs: hashmap, + borrowings: hashmap, } struct fn_ctxt { // var_bindings, locals and next_var_id are shared // with any nested functions that capture the environment // (and with any functions whose environment is being captured). - self_impl_def_id: Option; - ret_ty: ty::t; + self_impl_def_id: Option, + ret_ty: ty::t, // Used by loop bodies that return from the outer function - indirect_ret_ty: Option; - purity: ast::purity; + indirect_ret_ty: Option, + purity: ast::purity, // Sometimes we generate region pointers where the precise region // to use is not known. For example, an expression like `&x.f` @@ -127,13 +127,13 @@ struct fn_ctxt { // inference selects the ultimate value. Finally, borrowck is // charged with guaranteeing that the value whose address was taken // can actually be made to live as long as it needs to live. - mut region_lb: ast::node_id; + mut region_lb: ast::node_id, - in_scope_regions: isr_alist; + in_scope_regions: isr_alist, - inh: @inherited; + inh: @inherited, - ccx: @crate_ctxt; + ccx: @crate_ctxt, } fn blank_inherited(ccx: @crate_ctxt) -> @inherited { diff --git a/src/rustc/middle/typeck/infer.rs b/src/rustc/middle/typeck/infer.rs index 07752df7b45..cbda05a4012 100644 --- a/src/rustc/middle/typeck/infer.rs +++ b/src/rustc/middle/typeck/infer.rs @@ -507,9 +507,9 @@ fn rollback_to( } struct Snapshot { - ty_var_bindings_len: uint; - int_var_bindings_len: uint; - region_vars_snapshot: uint; + ty_var_bindings_len: uint, + int_var_bindings_len: uint, + region_vars_snapshot: uint, } impl infer_ctxt { diff --git a/src/rustc/middle/typeck/infer/combine.rs b/src/rustc/middle/typeck/infer/combine.rs index 8199d7058ff..2bfabd807a2 100644 --- a/src/rustc/middle/typeck/infer/combine.rs +++ b/src/rustc/middle/typeck/infer/combine.rs @@ -79,9 +79,9 @@ trait combine { } struct combine_fields { - infcx: infer_ctxt; - a_is_expected: bool; - span: span; + infcx: infer_ctxt, + a_is_expected: bool, + span: span, } fn expected_found( diff --git a/src/rustc/middle/typeck/infer/region_var_bindings.rs b/src/rustc/middle/typeck/infer/region_var_bindings.rs index 96d0cf9c110..be87558ee5b 100644 --- a/src/rustc/middle/typeck/infer/region_var_bindings.rs +++ b/src/rustc/middle/typeck/infer/region_var_bindings.rs @@ -350,8 +350,8 @@ impl Constraint: cmp::Eq { } struct TwoRegions { - a: region; - b: region; + a: region, + b: region, } impl TwoRegions: cmp::Eq { @@ -371,12 +371,12 @@ enum UndoLogEntry { type CombineMap = hashmap; struct RegionVarBindings { - tcx: ty::ctxt; - var_spans: DVec; - values: Cell<~[ty::region]>; - constraints: hashmap; - lubs: CombineMap; - glbs: CombineMap; + tcx: ty::ctxt, + var_spans: DVec, + values: Cell<~[ty::region]>, + constraints: hashmap, + lubs: CombineMap, + glbs: CombineMap, // The undo log records actions that might later be undone. // @@ -386,7 +386,7 @@ struct RegionVarBindings { // actively snapshotting. The reason for this is that otherwise // we end up adding entries for things like the lower bound on // a variable and so forth, which can never be rolled back. - undo_log: DVec; + undo_log: DVec } fn RegionVarBindings(tcx: ty::ctxt) -> RegionVarBindings { @@ -770,26 +770,26 @@ impl Classification : cmp::Eq { enum GraphNodeValue { NoValue, Value(region), ErrorValue } struct GraphNode { - span: span; - mut classification: Classification; - mut value: GraphNodeValue; - head_edge: [mut uint * 2]; // FIXME(#3226)--should not need mut + span: span, + mut classification: Classification, + mut value: GraphNodeValue, + head_edge: [mut uint * 2], // FIXME(#3226)--should not need mut } struct GraphEdge { - next_edge: [mut uint * 2]; // FIXME(#3226)--should not need mut - constraint: Constraint; - span: span; + next_edge: [mut uint * 2], // FIXME(#3226)--should not need mut + constraint: Constraint, + span: span, } struct Graph { - nodes: ~[GraphNode]; - edges: ~[GraphEdge]; + nodes: ~[GraphNode], + edges: ~[GraphEdge], } struct SpannedRegion { - region: region; - span: span; + region: region, + span: span, } type TwoRegionsMap = hashmap; diff --git a/src/rustc/middle/typeck/infer/unify.rs b/src/rustc/middle/typeck/infer/unify.rs index 65cbcdcb40a..36c3093874a 100644 --- a/src/rustc/middle/typeck/infer/unify.rs +++ b/src/rustc/middle/typeck/infer/unify.rs @@ -9,14 +9,14 @@ enum var_value { } struct vals_and_bindings { - vals: SmallIntMap>; - mut bindings: ~[(V, var_value)]; + vals: SmallIntMap>, + mut bindings: ~[(V, var_value)], } struct node { - root: V; - possible_types: T; - rank: uint; + root: V, + possible_types: T, + rank: uint, } impl infer_ctxt { diff --git a/src/rustc/middle/typeck/rscope.rs b/src/rustc/middle/typeck/rscope.rs index 32864a2d51f..3826d3e527c 100644 --- a/src/rustc/middle/typeck/rscope.rs +++ b/src/rustc/middle/typeck/rscope.rs @@ -60,8 +60,8 @@ impl @anon_rscope: region_scope { } struct binding_rscope { - base: region_scope; - mut anon_bindings: uint; + base: region_scope, + mut anon_bindings: uint, } fn in_binding_rscope(self: RS) -> @binding_rscope { -- cgit 1.4.1-3-g733a5