Convert field terminators to commas. Stop parsing semis.

This commit is contained in:
Brian Anderson 2012-09-07 14:50:47 -07:00
parent 3078830934
commit f0eae8f1c1
91 changed files with 283 additions and 283 deletions

View file

@ -33,7 +33,7 @@ export future_pipe;
#[doc = "The future type"]
struct Future<A> {
/*priv*/ mut state: FutureState<A>;
/*priv*/ mut state: FutureState<A>,
}
priv enum FutureState<A> {

View file

@ -176,15 +176,15 @@ fn default_state() -> State {
}
struct SipState {
k0: u64;
k1: u64;
mut length: uint; // how many bytes we've processed
mut v0: u64; // hash state
mut v1: u64;
mut v2: u64;
mut v3: u64;
tail: [mut u8]/8; // unprocessed bytes
mut ntail: uint; // how many bytes in tail are valid
k0: u64,
k1: u64,
mut length: uint, // how many bytes we've processed
mut v0: u64, // hash state
mut v1: u64,
mut v2: u64,
mut v3: u64,
tail: [mut u8]/8, // unprocessed bytes
mut ntail: uint, // how many bytes in tail are valid
}
#[inline(always)]

View file

@ -20,8 +20,8 @@ export Managed;
enum Mode { ReadOnly, Mutable, Immutable }
struct Data<T> {
priv mut value: T;
priv mut mode: Mode;
priv mut value: T,
priv mut mode: Mode
}
type Managed<T> = @Data<T>;

View file

@ -5,15 +5,15 @@
use cmp::Eq;
struct WindowsPath {
host: Option<~str>;
device: Option<~str>;
is_absolute: bool;
components: ~[~str];
host: Option<~str>,
device: Option<~str>,
is_absolute: bool,
components: ~[~str],
}
struct PosixPath {
is_absolute: bool;
components: ~[~str];
is_absolute: bool,
components: ~[~str],
}
trait GenericPath {

View file

@ -465,7 +465,7 @@ fn try_recv<T: send, Tbuffer: send>(+p: RecvPacketBuffered<T, Tbuffer>)
let p = unsafe { &*p_ };
struct DropState {
p: &PacketHeader;
p: &PacketHeader,
drop {
if task::failing() {

View file

@ -30,16 +30,16 @@ mod linear {
const initial_capacity: uint = 32u; // 2^5
struct Bucket<K:Eq Hash,V> {
hash: uint;
key: K;
value: V;
hash: uint,
key: K,
value: V,
}
struct LinearMap<K:Eq Hash,V> {
k0: u64;
k1: u64;
resize_at: uint;
size: uint;
buckets: ~[Option<Bucket<K,V>>];
k0: u64,
k1: u64,
resize_at: uint,
size: uint,
buckets: ~[Option<Bucket<K,V>>],
}
// FIXME(#3148) -- we could rewrite found_entry

View file

@ -28,8 +28,8 @@ enum TypeDesc = {
/// The representation of a Rust closure
struct Closure {
code: *();
env: *();
code: *(),
env: *(),
}
#[abi = "cdecl"]

View file

@ -86,15 +86,15 @@ unsafe fn copy_lifetime<S,T>(_ptr: &a/S, ptr: &T) -> &a/T {
type UnwrapProto = ~mut Option<(pipes::ChanOne<()>, pipes::PortOne<bool>)>;
struct ArcData<T> {
mut count: libc::intptr_t;
mut unwrapper: libc::uintptr_t; // either a UnwrapProto or 0
mut count: libc::intptr_t,
mut unwrapper: libc::uintptr_t, // either a UnwrapProto or 0
// FIXME(#3224) should be able to make this non-option to save memory, and
// in unwrap() use "let ~ArcData { data: result, _ } = thing" to unwrap it
mut data: Option<T>;
mut data: Option<T>,
}
struct ArcDestruct<T> {
mut data: *libc::c_void;
mut data: *libc::c_void,
drop unsafe {
if self.data.is_null() {
return; // Happens when destructing an unwrapper's handle.
@ -140,8 +140,8 @@ fn ArcDestruct<T>(data: *libc::c_void) -> ArcDestruct<T> {
unsafe fn unwrap_shared_mutable_state<T: send>(+rc: SharedMutableState<T>)
-> T {
struct DeathThroes<T> {
mut ptr: Option<~ArcData<T>>;
mut response: Option<pipes::ChanOne<bool>>;
mut ptr: Option<~ArcData<T>>,
mut response: Option<pipes::ChanOne<bool>>,
drop unsafe {
let response = option::swap_unwrap(&mut self.response);
// In case we get killed early, we need to tell the person who
@ -312,11 +312,11 @@ impl LittleLock {
}
}
struct ExData<T: send> { lock: LittleLock; mut failed: bool; mut data: T; }
struct ExData<T: send> { lock: LittleLock, mut failed: bool, mut data: T, }
/**
* An arc over mutable data that is protected by a lock. For library use only.
*/
struct Exclusive<T: send> { x: SharedMutableState<ExData<T>>; }
struct Exclusive<T: send> { x: SharedMutableState<ExData<T>> }
fn exclusive<T:send >(+user_data: T) -> Exclusive<T> {
let data = ExData {

View file

@ -54,7 +54,7 @@ fn replace<T>(dest: &mut T, +src: T) -> T {
/// A non-copyable dummy type.
struct NonCopyable {
i: ();
i: (),
drop { }
}

View file

@ -19,7 +19,7 @@ export RWARC, rw_arc_with_condvars, RWWriteMode, RWReadMode;
export unwrap_rw_arc;
/// As sync::condvar, a mechanism for unlock-and-descheduling and signalling.
struct Condvar { is_mutex: bool; failed: &mut bool; cond: &sync::Condvar; }
struct Condvar { is_mutex: bool, failed: &mut bool, cond: &sync::Condvar }
impl &Condvar {
/// Atomically exit the associated ARC and block until a signal is sent.
@ -69,7 +69,7 @@ impl &Condvar {
****************************************************************************/
/// An atomically reference counted wrapper for shared immutable state.
struct ARC<T: const send> { x: SharedMutableState<T>; }
struct ARC<T: const send> { x: SharedMutableState<T> }
/// Create an atomically reference counted wrapper.
fn ARC<T: const send>(+data: T) -> ARC<T> {
@ -114,9 +114,9 @@ fn unwrap<T: const send>(+rc: ARC<T>) -> T {
****************************************************************************/
#[doc(hidden)]
struct MutexARCInner<T: send> { lock: Mutex; failed: bool; data: T; }
struct MutexARCInner<T: send> { lock: Mutex, failed: bool, data: T }
/// An ARC with mutable data protected by a blocking mutex.
struct MutexARC<T: send> { x: SharedMutableState<MutexARCInner<T>>; }
struct MutexARC<T: send> { x: SharedMutableState<MutexARCInner<T>> }
/// Create a mutex-protected ARC with the supplied data.
fn MutexARC<T: send>(+user_data: T) -> MutexARC<T> {
@ -222,7 +222,7 @@ fn check_poison(is_mutex: bool, failed: bool) {
#[doc(hidden)]
struct PoisonOnFail {
failed: &mut bool;
failed: &mut bool,
drop {
/* assert !*self.failed; -- might be false in case of cond.wait() */
if task::failing() { *self.failed = true; }
@ -240,7 +240,7 @@ fn PoisonOnFail(failed: &r/mut bool) -> PoisonOnFail/&r {
****************************************************************************/
#[doc(hidden)]
struct RWARCInner<T: const send> { lock: RWlock; failed: bool; data: T; }
struct RWARCInner<T: const send> { lock: RWlock, failed: bool, data: T }
/**
* A dual-mode ARC protected by a reader-writer lock. The data can be accessed
* mutably or immutably, and immutably-accessing tasks may run concurrently.
@ -248,8 +248,8 @@ struct RWARCInner<T: const send> { lock: RWlock; failed: bool; data: T; }
* Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested.
*/
struct RWARC<T: const send> {
x: SharedMutableState<RWARCInner<T>>;
mut cant_nest: ();
x: SharedMutableState<RWARCInner<T>>,
mut cant_nest: ()
}
/// Create a reader/writer ARC with the supplied data.

View file

@ -51,9 +51,9 @@ struct Arena {
// The head is seperated out from the list as a unbenchmarked
// microoptimization, to avoid needing to case on the list to
// access the head.
priv mut head: Chunk;
priv mut pod_head: Chunk;
priv mut chunks: @List<Chunk>;
priv mut head: Chunk,
priv mut pod_head: Chunk,
priv mut chunks: @List<Chunk>,
drop {
unsafe {
destroy_chunk(self.head);

View file

@ -5,7 +5,7 @@
/// Similar to a mutable option type, but friendlier.
struct Cell<T> {
mut value: Option<T>;
mut value: Option<T>
}
/// Creates a new full cell with the given value.

View file

@ -14,8 +14,8 @@ export DuplexStream;
/// An extension of `pipes::stream` that allows both sending and receiving.
struct DuplexStream<T: send, U: send> : Channel<T>, Recv<U>, Selectable {
priv chan: Chan<T>;
priv port: Port <U>;
priv chan: Chan<T>,
priv port: Port <U>,
fn send(+x: T) {
self.chan.send(x)

View file

@ -113,17 +113,17 @@ mod chained {
const initial_capacity: uint = 32u; // 2^5
struct entry<K, V> {
hash: uint;
key: K;
value: V;
mut next: Option<@entry<K, V>>;
hash: uint,
key: K,
value: V,
mut next: Option<@entry<K, V>>
}
struct hashmap_<K, V> {
mut count: uint;
mut chains: ~[mut Option<@entry<K,V>>];
hasher: hashfn<K>;
eqer: eqfn<K>;
mut count: uint,
mut chains: ~[mut Option<@entry<K,V>>],
hasher: hashfn<K>,
eqer: eqfn<K>
}
type t<K, V> = @hashmap_<K, V>;

View file

@ -24,8 +24,8 @@ type WaitEnd = pipes::PortOne<()>;
type SignalEnd = pipes::ChanOne<()>;
// A doubly-ended queue of waiting tasks.
#[doc(hidden)]
struct Waitqueue { head: pipes::Port<SignalEnd>;
tail: pipes::Chan<SignalEnd>; }
struct Waitqueue { head: pipes::Port<SignalEnd>,
tail: pipes::Chan<SignalEnd> }
fn new_waitqueue() -> Waitqueue {
let (block_tail, block_head) = pipes::stream();
@ -63,11 +63,11 @@ fn broadcast_waitqueue(q: &Waitqueue) -> uint {
// The building-block used to make semaphores, mutexes, and rwlocks.
#[doc(hidden)]
struct SemInner<Q> {
mut count: int;
waiters: Waitqueue;
mut count: int,
waiters: Waitqueue,
// Can be either unit or another waitqueue. Some sems shouldn't come with
// a condition variable attached, others should.
blocked: Q;
blocked: Q
}
#[doc(hidden)]
enum Sem<Q: send> = Exclusive<SemInner<Q>>;
@ -153,7 +153,7 @@ impl &Sem<~[mut Waitqueue]> {
// FIXME(#3136) should go inside of access()
#[doc(hidden)]
struct SemRelease {
sem: &Sem<()>;
sem: &Sem<()>,
drop { self.sem.release(); }
}
@ -165,7 +165,7 @@ fn SemRelease(sem: &r/Sem<()>) -> SemRelease/&r {
#[doc(hidden)]
struct SemAndSignalRelease {
sem: &Sem<~[mut Waitqueue]>;
sem: &Sem<~[mut Waitqueue]>,
drop { self.sem.release(); }
}
@ -177,7 +177,7 @@ fn SemAndSignalRelease(sem: &r/Sem<~[mut Waitqueue]>)
}
/// A mechanism for atomic-unlock-and-deschedule blocking and signalling.
struct Condvar { priv sem: &Sem<~[mut Waitqueue]>; drop { } }
struct Condvar { priv sem: &Sem<~[mut Waitqueue]>, drop { } }
impl &Condvar {
/**
@ -245,7 +245,7 @@ impl &Condvar {
// mutex during unwinding. As long as the wrapper (mutex, etc) is
// bounded in when it gets released, this shouldn't hang forever.
struct SemAndSignalReacquire {
sem: &Sem<~[mut Waitqueue]>;
sem: &Sem<~[mut Waitqueue]>,
drop unsafe {
// Needs to succeed, instead of itself dying.
do task::unkillable {
@ -338,7 +338,7 @@ impl &Sem<~[mut Waitqueue]> {
****************************************************************************/
/// A counting, blocking, bounded-waiting semaphore.
struct Semaphore { priv sem: Sem<()>; }
struct Semaphore { priv sem: Sem<()> }
/// Create a new semaphore with the specified count.
fn semaphore(count: int) -> Semaphore {
@ -377,7 +377,7 @@ impl &Semaphore {
* A task which fails while holding a mutex will unlock the mutex as it
* unwinds.
*/
struct Mutex { priv sem: Sem<~[mut Waitqueue]>; }
struct Mutex { priv sem: Sem<~[mut Waitqueue]> }
/// Create a new mutex, with one associated condvar.
fn Mutex() -> Mutex { mutex_with_condvars(1) }
@ -412,8 +412,8 @@ impl &Mutex {
#[doc(hidden)]
struct RWlockInner {
read_mode: bool;
read_count: uint;
read_mode: bool,
read_count: uint
}
/**
@ -424,9 +424,9 @@ struct RWlockInner {
* unwinds.
*/
struct RWlock {
/* priv */ order_lock: Semaphore;
/* priv */ access_lock: Sem<~[mut Waitqueue]>;
/* priv */ state: Exclusive<RWlockInner>;
/* priv */ order_lock: Semaphore,
/* priv */ access_lock: Sem<~[mut Waitqueue]>,
/* priv */ state: Exclusive<RWlockInner>
}
/// Create a new rwlock, with one associated condvar.
@ -584,7 +584,7 @@ impl &RWlock {
// FIXME(#3136) should go inside of read()
#[doc(hidden)]
struct RWlockReleaseRead {
lock: &RWlock;
lock: &RWlock,
drop unsafe {
do task::unkillable {
let mut last_reader = false;
@ -613,7 +613,7 @@ fn RWlockReleaseRead(lock: &r/RWlock) -> RWlockReleaseRead/&r {
// FIXME(#3136) should go inside of downgrade()
#[doc(hidden)]
struct RWlockReleaseDowngrade {
lock: &RWlock;
lock: &RWlock,
drop unsafe {
do task::unkillable {
let mut writer_or_last_reader = false;
@ -647,9 +647,9 @@ fn RWlockReleaseDowngrade(lock: &r/RWlock) -> RWlockReleaseDowngrade/&r {
}
/// The "write permission" token used for rwlock.write_downgrade().
struct RWlockWriteMode { /* priv */ lock: &RWlock; drop { } }
struct RWlockWriteMode { /* priv */ lock: &RWlock, drop { } }
/// The "read permission" token used for rwlock.write_downgrade().
struct RWlockReadMode { priv lock: &RWlock; drop { } }
struct RWlockReadMode { priv lock: &RWlock, drop { } }
impl &RWlockWriteMode {
/// Access the pre-downgrade rwlock in write mode.
@ -956,7 +956,7 @@ mod tests {
assert woken == 0;
}
struct SendOnFailure {
c: pipes::Chan<()>;
c: pipes::Chan<()>,
drop { self.c.send(()); }
}

View file

@ -15,10 +15,10 @@ use io::*;
use codemap::span;
struct gather_item {
lo: uint;
hi: uint;
e: @ast::expr;
constr: ~str;
lo: uint,
hi: uint,
e: @ast::expr,
constr: ~str
}
type aq_ctxt = @{lo: uint, gather: DVec<gather_item>};

View file

@ -2731,7 +2731,7 @@ struct parser {
!self.token_is_pound_or_doc_comment(self.token) {
let a_var = self.parse_instance_var(vis);
match self.token {
token::SEMI | token::COMMA => {
token::COMMA => {
self.bump();
}
token::RBRACE => {}

View file

@ -77,8 +77,8 @@ mod jit {
}
struct Closure {
code: *();
env: *();
code: *(),
env: *(),
}
fn exec(sess: session,

View file

@ -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<RelevantDef> {
}
struct IrMaps {
tcx: ty::ctxt;
method_map: typeck::method_map;
last_use_map: last_use_map;
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<node_id, LiveNode>;
variable_map: hashmap<node_id, Variable>;
field_map: hashmap<ident, Variable>;
capture_map: hashmap<node_id, @~[CaptureInfo]>;
mut var_kinds: ~[VarKind];
mut lnks: ~[LiveNodeKind];
mut num_live_nodes: uint,
mut num_vars: uint,
live_node_map: hashmap<node_id, LiveNode>,
variable_map: hashmap<node_id, Variable>,
field_map: hashmap<ident, Variable>,
capture_map: hashmap<node_id, @~[CaptureInfo]>,
mut var_kinds: ~[VarKind],
mut lnks: ~[LiveNodeKind],
}
fn IrMaps(tcx: ty::ctxt, method_map: typeck::method_map,

View file

@ -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 {

View file

@ -42,11 +42,11 @@ Encodes the bounding lifetime for a given AST node:
type region_map = hashmap<ast::node_id, ast::node_id>;
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<ast::node_id, ()>;
root_exprs: hashmap<ast::node_id, ()>,
// 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

View file

@ -67,8 +67,8 @@ use str_eq = str::eq;
type DefMap = hashmap<node_id,def>;
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<node_id, ~[Export]>;
type ExportMap2 = hashmap<node_id, ~[Export2]>;
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

View file

@ -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];

View file

@ -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 {

View file

@ -100,8 +100,8 @@ enum EnvAction {
}
struct EnvValue {
action: EnvAction;
datum: Datum;
action: EnvAction,
datum: Datum
}
impl EnvAction {

View file

@ -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<block>, -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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<M: cmp::Eq> {
meta: M;
sig: FnSig;
meta: M,
sig: FnSig
}
type FnTy = FnTyBase<FnMeta>;
@ -556,8 +556,8 @@ enum terr_vstore_kind {
}
struct expected_found<T> {
expected: T;
found: T;
expected: T,
found: T
}
// Data structures used in type unification

View file

@ -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<ast::node_id, TyVid>;
node_types: hashmap<ast::node_id, ty::t>;
node_type_substs: hashmap<ast::node_id, ty::substs>;
borrowings: hashmap<ast::node_id, ty::borrow>;
infcx: infer::infer_ctxt,
locals: hashmap<ast::node_id, TyVid>,
node_types: hashmap<ast::node_id, ty::t>,
node_type_substs: hashmap<ast::node_id, ty::substs>,
borrowings: hashmap<ast::node_id, ty::borrow>,
}
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<ast::def_id>;
ret_ty: ty::t;
self_impl_def_id: Option<ast::def_id>,
ret_ty: ty::t,
// Used by loop bodies that return from the outer function
indirect_ret_ty: Option<ty::t>;
purity: ast::purity;
indirect_ret_ty: Option<ty::t>,
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 {

View file

@ -507,9 +507,9 @@ fn rollback_to<V:copy vid, T:copy>(
}
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 {

View file

@ -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<C: combine,T>(

View file

@ -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<TwoRegions, RegionVid>;
struct RegionVarBindings {
tcx: ty::ctxt;
var_spans: DVec<span>;
values: Cell<~[ty::region]>;
constraints: hashmap<Constraint, span>;
lubs: CombineMap;
glbs: CombineMap;
tcx: ty::ctxt,
var_spans: DVec<span>,
values: Cell<~[ty::region]>,
constraints: hashmap<Constraint, span>,
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<UndoLogEntry>;
undo_log: DVec<UndoLogEntry>
}
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<TwoRegions, ()>;

View file

@ -9,14 +9,14 @@ enum var_value<V:copy, T:copy> {
}
struct vals_and_bindings<V:copy, T:copy> {
vals: SmallIntMap<var_value<V, T>>;
mut bindings: ~[(V, var_value<V, T>)];
vals: SmallIntMap<var_value<V, T>>,
mut bindings: ~[(V, var_value<V, T>)],
}
struct node<V:copy, T:copy> {
root: V;
possible_types: T;
rank: uint;
root: V,
possible_types: T,
rank: uint,
}
impl infer_ctxt {

View file

@ -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<RS: region_scope copy owned>(self: RS)
-> @binding_rscope {

View file

@ -11,13 +11,13 @@ use send_map::linear::*;
use io::WriterUtil;
struct Results {
sequential_ints: float;
random_ints: float;
delete_ints: float;
sequential_ints: float,
random_ints: float,
delete_ints: float,
sequential_strings: float;
random_strings: float;
delete_strings: float;
sequential_strings: float,
random_strings: float,
delete_strings: float
}
fn timed(result: &mut float,

View file

@ -17,8 +17,8 @@ use io::WriterUtil;
use std::map::hashmap;
struct cmplx {
re: f64;
im: f64;
re: f64,
im: f64
}
impl cmplx : ops::Mul<cmplx,cmplx> {

View file

@ -1,7 +1,7 @@
// Tests that auto-ref can't create mutable aliases to immutable memory.
struct Foo {
x: int;
x: int
}
trait Stuff {

View file

@ -1,4 +1,4 @@
struct X { x: (); drop { error!("destructor runs"); } }
struct X { x: (), drop { error!("destructor runs"); } }
fn main() {
let x = Some(X { x: () });

View file

@ -1,4 +1,4 @@
struct X { x: (); drop { error!("destructor runs"); } }
struct X { x: (), drop { error!("destructor runs"); } }
fn main() {
let x = Some((X { x: () }, X { x: () }));

View file

@ -1,4 +1,4 @@
struct X { x: (); drop { error!("destructor runs"); } }
struct X { x: (), drop { error!("destructor runs"); } }
enum double_option<T,U> { some2(T,U), none2 }

View file

@ -1,4 +1,4 @@
struct X { x: (); drop { error!("destructor runs"); } }
struct X { x: (), drop { error!("destructor runs"); } }
fn main() {
let x = Some((X { x: () }, X { x: () }));

View file

@ -1,4 +1,4 @@
struct X { x: (); drop { error!("destructor runs"); } }
struct X { x: (), drop { error!("destructor runs"); } }
fn main() {
let x = Some(X { x: () });

View file

@ -1,5 +1,5 @@
struct X { x: (); drop { error!("destructor runs"); } }
struct Y { y: Option<X>; }
struct X { x: (), drop { error!("destructor runs"); } }
struct Y { y: Option<X> }
fn main() {
let x = Y { y: Some(X { x: () }) };

View file

@ -1,4 +1,4 @@
struct X { x: (); drop { error!("destructor runs"); } }
struct X { x: (), drop { error!("destructor runs"); } }
fn main() {
let x = Some(X { x: () });

View file

@ -1,5 +1,5 @@
struct defer {
x: &[&str];
x: &[&str],
drop { #error["%?", self.x]; }
}

View file

@ -1,6 +1,6 @@
struct Point {
x: int;
y: int;
x: int,
y: int,
}
impl Point : ops::Add<int,int> {

View file

@ -1,5 +1,5 @@
struct noncopyable {
i: (); drop { #error["dropped"]; }
i: (), drop { #error["dropped"]; }
}
fn noncopyable() -> noncopyable {

View file

@ -1,5 +1,5 @@
struct X {
x: ~str;
x: ~str,
drop {
error!("value: %s", self.x);
}

View file

@ -1,4 +1,4 @@
struct cat {
tail: int;
tail: int,
fn meow() { tail += 1; } //~ ERROR: Did you mean: `self.tail`
}

View file

@ -1,7 +1,7 @@
// A test case for #2548.
struct foo {
x: @mut int;
x: @mut int,
drop {

View file

@ -3,7 +3,7 @@ fn foo<T: copy>(+_t: T) { fail; }
fn bar<T>(+_t: T) { fail; }
struct S {
x: int;
x: int,
drop {}
}

View file

@ -11,7 +11,7 @@ trait A {
}
struct E {
f: int;
f: int
}
impl E: A {

View file

@ -8,7 +8,7 @@ trait A {
}
struct E {
f: int;
f: int
}
impl E: A {

View file

@ -8,7 +8,7 @@ trait A {
}
struct E {
f: int;
f: int
}
impl E: A {

View file

@ -1,6 +1,6 @@
#[forbid(non_camel_case_types)]
struct foo { //~ ERROR type, variant, or trait must be camel case
bar: int;
bar: int
}
fn main() {

View file

@ -1,6 +1,6 @@
mod cat {
struct Cat {
priv meows: uint;
priv meows: uint
}
fn new_cat() -> Cat {

View file

@ -5,10 +5,10 @@ mod argparse {
import either::{Either, Left, Right};
struct Flag {
name: &str;
desc: &str;
max_count: uint;
mut value: uint;
name: &str,
desc: &str,
max_count: uint,
mut value: uint
}
fn flag(name: &r/str, desc: &r/str) -> Flag/&r {

View file

@ -1,17 +1,17 @@
struct param1 {
g: &fn();
g: &fn()
}
struct param2 {
g: fn();
g: fn()
}
struct not_param1 {
g: @fn();
g: @fn()
}
struct not_param2 {
g: @fn();
g: @fn()
}
fn take1(p: param1) -> param1 { p } //~ ERROR mismatched types

View file

@ -1,5 +1,5 @@
struct contravariant {
f: &int;
f: &int
}
fn to_same_lifetime(bi: contravariant/&r) {

View file

@ -4,7 +4,7 @@
// the normal case.
struct contravariant {
f: fn@() -> &self/int;
f: fn@() -> &self/int
}
fn to_same_lifetime(bi: contravariant/&r) {

View file

@ -3,7 +3,7 @@
// You can upcast to a *larger region* but not a smaller one.
struct covariant {
f: fn@(x: &self/int) -> int;
f: fn@(x: &self/int) -> int
}
fn to_same_lifetime(bi: covariant/&r) {

View file

@ -3,7 +3,7 @@
// You cannot convert between regions.
struct invariant {
f: fn(x: &self/int) -> &self/int;
f: fn(x: &self/int) -> &self/int
}
fn to_same_lifetime(bi: invariant/&r) {

View file

@ -1,5 +1,5 @@
struct invariant {
f: @mut &int;
f: @mut &int
}
fn to_same_lifetime(bi: invariant/&r) {

View file

@ -1,5 +1,5 @@
struct invariant {
f: @[mut &int];
f: @[mut &int]
}
fn to_same_lifetime(bi: invariant/&r) {

View file

@ -1,5 +1,5 @@
struct invariant {
f: fn@(x: @mut &self/int);
f: fn@(x: @mut &self/int)
}
fn to_same_lifetime(bi: invariant/&r) {

View file

@ -1,5 +1,5 @@
struct invariant {
f: fn@() -> @mut &self/int;
f: fn@() -> @mut &self/int
}
fn to_same_lifetime(bi: invariant/&r) {

View file

@ -1,5 +1,5 @@
struct invariant {
mut f: &int;
mut f: &int
}
fn to_same_lifetime(bi: invariant/&r) {

View file

@ -1,17 +1,17 @@
struct direct {
f: &int;
f: &int
}
struct indirect1 {
g: fn@(direct);
g: fn@(direct)
}
struct indirect2 {
g: fn@(direct/&);
g: fn@(direct/&)
}
struct indirect3 {
g: fn@(direct/&self);
g: fn@(direct/&self)
}
fn take_direct(p: direct) -> direct { p } //~ ERROR mismatched types

View file

@ -1,5 +1,5 @@
struct closure_box {
cl: &fn();
cl: &fn()
}
fn box_it(x: &r/fn()) -> closure_box/&r {

View file

@ -2,7 +2,7 @@
// literal syntax.
struct Foo {
x: int;
x: int,
drop {
io::println("Goodbye!");

View file

@ -1,5 +1,5 @@
struct Foo {
x: int;
x: int,
}
trait Stuff {

View file

@ -1,5 +1,5 @@
struct Foo {
x: int;
x: int,
}
impl Foo {

View file

@ -1,7 +1,7 @@
enum Foo {
struct {
x: int;
y: int;
x: int,
y: int,
}
Bar(int),

View file

@ -1,5 +1,5 @@
struct foo { a: int; b: int; c: int; }
struct foo { a: int, b: int, c: int }
impl foo : cmp::Eq {
pure fn eq(&&other: foo) -> bool {

View file

@ -1,7 +1,7 @@
// Test to make sure that explicit self params work inside closures
struct Box {
x: uint;
x: uint
}
impl Box {

View file

@ -33,7 +33,7 @@ fn select_based_on_unit_circle<T>(
struct thing {
x: {mut a: @int};
x: {mut a: @int}
}
fn thing(x: {mut a: @int}) -> thing {

View file

@ -1,6 +1,6 @@
struct Foo {
x: int;
y: int;
x: int,
y: int
}
fn main() {

View file

@ -7,7 +7,7 @@ fn foo<T, U: bar<T>>(b: U) -> T {
}
struct cbar : bar<int> {
x: int;
x: int,
fn get_bar() -> int {
self.x
}

View file

@ -1,4 +1,4 @@
struct thing { x: int; drop { } }
struct thing { x: int, drop { } }
fn thing() -> thing {
thing {
x: 0

View file

@ -3,8 +3,8 @@ trait Product {
}
struct Foo {
x: int;
y: int;
x: int,
y: int,
}
impl Foo {

View file

@ -1,6 +1,6 @@
struct Point {
x: int;
y: int;
x: int,
y: int
}
impl Point : ops::Add<Point,Point> {

View file

@ -1,5 +1,5 @@
struct dtor {
x: @mut int;
x: @mut int,
drop {
// abuse access to shared mutable state to write this code

View file

@ -65,7 +65,7 @@ macro_rules! select (
// Types and protocols
struct Buffer {
foo: ();
foo: (),
drop { }
}

View file

@ -1,5 +1,5 @@
struct closure_box {
cl: &fn();
cl: &fn(),
}
fn box_it(x: &r/fn()) -> closure_box/&r {

View file

@ -1,5 +1,5 @@
struct boxed_int {
f: &int;
f: &int,
}
fn max(bi: &r/boxed_int, f: &r/int) -> int {

View file

@ -1,5 +1,5 @@
struct boxed_int {
f: &int;
f: &int,
}
fn get(bi: &r/boxed_int) -> &r/int {

View file

@ -1,5 +1,5 @@
struct closure_box {
cl: &fn();
cl: &fn(),
}
fn box_it(x: &r/fn()) -> closure_box/&r {

View file

@ -1,5 +1,5 @@
struct foo {
x: ~str;
x: ~str,
drop { #error["%s", self.x]; }
}

View file

@ -1,6 +1,6 @@
struct Foo {
x: int;
y: int;
x: int,
y: int,
}
fn main() {

View file

@ -1,6 +1,6 @@
enum Foo {
Bar { x: int; },
Baz { y: int; }
Bar { x: int },
Baz { y: int }
}
fn main() { }