]> git.lizzy.rs Git - rust.git/commitdiff
Fix damage done by the pretty-printer
authorMarijn Haverbeke <marijnh@gmail.com>
Wed, 27 Jul 2011 12:48:34 +0000 (14:48 +0200)
committerMarijn Haverbeke <marijnh@gmail.com>
Wed, 27 Jul 2011 13:54:33 +0000 (15:54 +0200)
77 files changed:
src/comp/back/link.rs
src/comp/driver/rustc.rs
src/comp/front/config.rs
src/comp/lib/llvm.rs
src/comp/metadata/creader.rs
src/comp/metadata/decoder.rs
src/comp/middle/alias.rs
src/comp/middle/freevars.rs
src/comp/middle/trans.rs
src/comp/middle/trans_alt.rs
src/comp/middle/tstate/bitvectors.rs
src/comp/middle/tstate/pre_post_conditions.rs
src/comp/middle/ty.rs
src/comp/middle/typeck.rs
src/comp/syntax/ext/fmt.rs
src/comp/syntax/fold.rs
src/comp/syntax/parse/parser.rs
src/lib/extfmt.rs
src/lib/ivec.rs
src/lib/str.rs
src/lib/test.rs
src/test/bench/shootout-nbody.rs
src/test/compile-fail/attr-bad-meta.rs
src/test/compile-fail/attr-before-stmt.rs
src/test/compile-fail/attr-before-view-item.rs
src/test/compile-fail/attr-before-view-item2.rs
src/test/compile-fail/attr-dangling-in-fn.rs
src/test/compile-fail/attr-dangling-in-mod.rs
src/test/compile-fail/bad-alt.rs
src/test/compile-fail/bad-name.rs
src/test/compile-fail/constrained-type-missing-check.rs
src/test/compile-fail/do-while-pred-constraints.rs
src/test/compile-fail/ext-after-attrib.rs
src/test/compile-fail/ext-noname.rs
src/test/compile-fail/extenv-no-args.rs
src/test/compile-fail/extfmt-no-args.rs
src/test/compile-fail/fail-simple.rs
src/test/compile-fail/if-check-precond-fail.rs
src/test/compile-fail/macro-2.rs
src/test/compile-fail/macro.rs
src/test/compile-fail/multiline-comment-line-tracking.rs
src/test/compile-fail/not-a-pred-3.rs
src/test/compile-fail/not-a-pred.rs
src/test/compile-fail/not-pred-args.rs
src/test/compile-fail/pred-assign.rs
src/test/compile-fail/pred-on-wrong-slots.rs
src/test/compile-fail/pred-swap.rs
src/test/compile-fail/self-missing-method.rs
src/test/compile-fail/slot-as-pred.rs
src/test/compile-fail/tail-non-call.rs
src/test/compile-fail/unbalanced-comment.rs
src/test/compile-fail/while-loop-pred-constraints.rs
src/test/run-fail/fn-constraint-claim.rs
src/test/run-fail/task-comm-14.rs
src/test/run-pass/alt-type-simple.rs
src/test/run-pass/anon-obj-overriding.rs
src/test/run-pass/block-expr-precedence.rs
src/test/run-pass/clone-with-exterior.rs
src/test/run-pass/constrained-type.rs
src/test/run-pass/destructor-ordering.rs
src/test/run-pass/if-check-precond.rs
src/test/run-pass/if-ret.rs
src/test/run-pass/item-attributes.rs
src/test/run-pass/macro-2.rs
src/test/run-pass/macro-3.rs
src/test/run-pass/macro.rs
src/test/run-pass/many.rs
src/test/run-pass/nil-pattern.rs
src/test/run-pass/spawn-module-qualified.rs
src/test/run-pass/syntax-extension-shell.rs
src/test/run-pass/task-killjoin.rs
src/test/run-pass/threads.rs
src/test/run-pass/typestate-transitive.rs
src/test/run-pass/user.rs
src/test/run-pass/vec-slice.rs
src/test/stdtest/deque.rs
src/test/stdtest/map.rs

index 20cf266beca58d4b69bcf2ddb00e8e2f392b1b26..7a933aa20f8a575104505715237a96d086e9c0d9 100644 (file)
@@ -340,10 +340,8 @@ fn crate_meta_name(sess: &session::session, crate: &ast::crate,
         ret alt metas.name {
               some(v) { v }
               none. {
-                let 
-                    // FIXME: Remove this vec->ivec conversion.
-
-                    name =
+                // FIXME: Remove this vec->ivec conversion.
+                let name =
                     {
                         let os_vec =
                             str::split(fs::basename(output), '.' as u8);
index 34c8f7f3163f629c44573b306dba630c663fdbce..3dacbd3b9d0b46e9351c72bf675ce9a8b29102e6 100644 (file)
@@ -65,9 +65,8 @@ fn build_configuration(sess: session::session, argv0: str, input: str) ->
     // some default and generated configuration items
     let default_cfg = default_configuration(sess, argv0, input);
     let user_cfg = sess.get_opts().cfg;
-    let 
-        // If the user wants a test runner, then add the test cfg
-        gen_cfg =
+    // If the user wants a test runner, then add the test cfg
+    let gen_cfg =
         {
             if sess.get_opts().test && !attr::contains_name(user_cfg, "test")
                {
index 1107e69875f8c8a126b9da0e4e577f1c3dc6fa63..e1e580f191eca22c484ba51101ba286b3a7d109a 100644 (file)
@@ -101,9 +101,7 @@ fn in_cfg(cfg: &ast::crate_cfg, attrs: &ast::attribute[]) -> bool {
     // Pull the inner meta_items from the #[cfg(meta_item, ...)]  attributes,
     // so we can match against them. This is the list of configurations for
     // which the item is valid
-    let 
-
-        item_cfg_metas =
+    let item_cfg_metas =
         {
             fn extract_metas(inner_items: &(@ast::meta_item)[],
                              cfg_item: &@ast::meta_item) ->
index 019179d45ec6fccf53f6260902bf166ade498de6..76e234cae9a862e678f10fd5902d922b4d9221ad 100644 (file)
@@ -1395,11 +1395,10 @@ fn Trap() -> ValueRef {
 
     fn is_terminated() -> bool {
         ret *terminated;
-    }drop 
-
-          {
+    }
+    drop {
          llvm::LLVMDisposeBuilder(B);
-     }
+    }
 }
 
 /* Memory-managed object interface to type handles. */
index abbc887cd12e1db14c5fbb18b44220437d7d5740..b0fa97f7ea9ee600b29cd1c59cfa53d84c9a92db 100644 (file)
@@ -122,22 +122,20 @@ fn find_library_crate(sess: &session::session, ident: &ast::ident,
 
     attr::require_unique_names(sess, metas);
 
-    let 
-        // FIXME: Probably want a warning here since the user
-        // is using the wrong type of meta item
-        crate_name =
-        {
-            let name_items = attr::find_meta_items_by_name(metas, "name");
-            alt ivec::last(name_items) {
-              some(i) {
-                alt attr::get_meta_item_value_str(i) {
-                  some(n) { n }
-                  _ { ident }
-                }
-              }
-              none. { ident }
+    // FIXME: Probably want a warning here since the user
+    // is using the wrong type of meta item
+    let crate_name = {
+        let name_items = attr::find_meta_items_by_name(metas, "name");
+        alt ivec::last(name_items) {
+          some(i) {
+            alt attr::get_meta_item_value_str(i) {
+              some(n) { n }
+              _ { ident }
             }
-        };
+          }
+          none. { ident }
+        }
+    };
 
     let nn = default_native_lib_naming(sess, sess.get_opts().static);
     let x =
index d7d82c1fa36f1d6f4230402c086c40a541f89e12..ab9c07981b9146642c35d9d6b3825c9c18b279dc 100644 (file)
@@ -164,9 +164,8 @@ fn lookup_def(cnum: ast::crate_num, data: @u8[], did_: &ast::def_id) ->
     let item = lookup_item(did_.node, data);
     let kind_ch = item_kind(item);
     let did = {crate: cnum, node: did_.node};
-    let 
-        // We treat references to tags as references to types.
-        def =
+    // We treat references to tags as references to types.
+    let def =
         alt kind_ch as char {
           'c' { ast::def_const(did) }
           'f' { ast::def_fn(did, ast::impure_fn) }
index f958b88e76e36ceadee24972503579fef801c398..ee56a3958bc8e734b4c315632e6622ffc7817f71 100644 (file)
 type ctx = {tcx: ty::ctxt, local_map: std::map::hashmap[node_id, local_info]};
 
 fn check_crate(tcx: ty::ctxt, crate: &@ast::crate) {
-    let 
-        // Stores information about object fields and function
-        // arguments that's otherwise not easily available.
-        cx =
+    // Stores information about object fields and function
+    // arguments that's otherwise not easily available.
+    let cx =
         @{tcx: tcx, local_map: std::map::new_int_hash()};
     let v =
         @{visit_fn: bind visit_fn(cx, _, _, _, _, _, _, _),
index d157499734ec2956eabbab9bc6189a361040dfae..c49d0ff28346797288e3faa3d865105be2a65621 100644 (file)
@@ -73,12 +73,12 @@ fn walk_pat(e: env, p: &@ast::pat) {
 
     let e: env =
         @{mutable refs: ~[], decls: decls, def_map: def_map, sess: sess};
-    walker(visit::mk_simple_visitor(@{visit_local: bind walk_local(e, _),
-                                      visit_pat: bind walk_pat(e, _),
-                                      visit_expr: bind walk_expr(e, _),
-                                      visit_fn: bind walk_fn(e, _, _, _, _, _)
-                                         with
-                                             *visit::default_simple_visitor()}));
+    walker(visit::mk_simple_visitor
+           (@{visit_local: bind walk_local(e, _),
+              visit_pat: bind walk_pat(e, _),
+              visit_expr: bind walk_expr(e, _),
+              visit_fn: bind walk_fn(e, _, _, _, _, _)
+              with *visit::default_simple_visitor()}));
 
     // Calculate (refs - decls). This is the set of captured upvars.
     // We build a vec of the node ids of the uses and a set of the
index 43b6f8d1d065dc4aeb3db9f0cb01b9a55772f682..c690889dd36efdd86cf6319f5ed959d700bbfcee 100644 (file)
@@ -830,10 +830,9 @@ fn trans_malloc_boxed(cx: &@block_ctxt, t: ty::t) -> result {
     // size of; box_ptr is the type that's converted to a TypeRef and used as
     // the pointer cast target in trans_raw_malloc.
 
-    let 
-        // The mk_int here is the space being
-        // reserved for the refcount.
-        boxed_body =
+    // The mk_int here is the space being
+    // reserved for the refcount.
+    let boxed_body =
         ty::mk_imm_tup(bcx_tcx(cx), ~[ty::mk_int(bcx_tcx(cx)), t]);
     let box_ptr = ty::mk_imm_box(bcx_tcx(cx), t);
     let sz = size_of(cx, boxed_body);
@@ -1243,21 +1242,20 @@ fn incr_refcnt_of_boxed(cx: &@block_ctxt, box_ptr: ValueRef) -> result {
 fn make_free_glue(cx: &@block_ctxt, v0: ValueRef, t: &ty::t) {
     // NB: v is an *alias* of type t here, not a direct value.
 
-    let 
-        // FIXME: switch gc/non-gc on layer of the type.
-        // FIXME: switch gc/non-gc on layer of the type.
-        // TODO: call upcall_kill
+    // FIXME: switch gc/non-gc on layer of the type.
+    // FIXME: switch gc/non-gc on layer of the type.
+    // TODO: call upcall_kill
 
 
-        // Call through the obj's own fields-drop glue first.
+    // Call through the obj's own fields-drop glue first.
 
-        // Then free the body.
-        // FIXME: switch gc/non-gc on layer of the type.
-        // Call through the closure's own fields-drop glue first.
+    // Then free the body.
+    // FIXME: switch gc/non-gc on layer of the type.
+    // Call through the closure's own fields-drop glue first.
 
-        // Then free the body.
-        // FIXME: switch gc/non-gc on layer of the type.
-        rs =
+    // Then free the body.
+    // FIXME: switch gc/non-gc on layer of the type.
+    let rs =
         alt ty::struct(bcx_tcx(cx), t) {
           ty::ty_str. { let v = cx.build.Load(v0); trans_non_gc_free(cx, v) }
           ty::ty_vec(_) {
@@ -1361,9 +1359,7 @@ fn maybe_free_ivec_heap_part(cx: &@block_ctxt, v0: ValueRef, unit_ty: ty::t)
 fn make_drop_glue(cx: &@block_ctxt, v0: ValueRef, t: &ty::t) {
     // NB: v0 is an *alias* of type t here, not a direct value.
     let ccx = bcx_ccx(cx);
-    let 
-
-        rs =
+    let rs =
         alt ty::struct(ccx.tcx, t) {
           ty::ty_str. { decr_refcnt_maybe_free(cx, v0, v0, t) }
           ty::ty_vec(_) { decr_refcnt_maybe_free(cx, v0, v0, t) }
@@ -1453,7 +1449,9 @@ fn trans_res_drop(cx: @block_ctxt, rs: ValueRef, did: &ast::def_id,
     // value here, but the dtor expects a type that still has opaque pointers
     // for type variables.
     let val_llty =
-        lib::llvm::fn_ty_param_tys(llvm::LLVMGetElementType(llvm::LLVMTypeOf(dtor_addr))).(std::ivec::len(args));
+        lib::llvm::fn_ty_param_tys(llvm::LLVMGetElementType
+                                   (llvm::LLVMTypeOf(dtor_addr)))
+                                    .(std::ivec::len(args));
     let val_cast = cx.build.BitCast(val.val, val_llty);
     cx.build.FastCall(dtor_addr, args + ~[val_cast]);
 
@@ -3345,9 +3343,8 @@ fn duplicate_heap_part(cx: &@block_ctxt, orig_vptr: ValueRef,
             maybe_on_heap_cx.build.PointerCast(vptr,
                                                T_ptr(T_ivec_heap(llunitty)));
         let heap_ptr_ptr =
-            maybe_on_heap_cx.build.InBoundsGEP(stub_ptr,
-                                               ~[C_int(0),
-                                                 C_uint(abi::ivec_heap_stub_elt_ptr)]);
+            maybe_on_heap_cx.build.InBoundsGEP
+            (stub_ptr, ~[C_int(0), C_uint(abi::ivec_heap_stub_elt_ptr)]);
         let heap_ptr = maybe_on_heap_cx.build.Load(heap_ptr_ptr);
         let heap_ptr_is_nonnull =
             maybe_on_heap_cx.build.ICmp(lib::llvm::LLVMIntNE, heap_ptr,
@@ -3358,9 +3355,8 @@ fn duplicate_heap_part(cx: &@block_ctxt, orig_vptr: ValueRef,
 
         // Ok, the vector is on the heap. Copy the heap part.
         let alen_ptr =
-            on_heap_cx.build.InBoundsGEP(stub_ptr,
-                                         ~[C_int(0),
-                                           C_uint(abi::ivec_heap_stub_elt_alen)]);
+            on_heap_cx.build.InBoundsGEP
+            (stub_ptr, ~[C_int(0), C_uint(abi::ivec_heap_stub_elt_alen)]);
         let alen = on_heap_cx.build.Load(alen_ptr);
 
         let heap_part_sz =
@@ -3598,17 +3594,15 @@ fn trans_if(cx: &@block_ctxt, cond: &@ast::expr, thn: &ast::blk,
     let then_cx = new_scope_block_ctxt(cx, "then");
     let then_res = trans_block(then_cx, thn, output);
     let else_cx = new_scope_block_ctxt(cx, "else");
-    let 
-        // Synthesize a block here to act as the else block
-        // containing an if expression. Needed in order for the
-        // else scope to behave like a normal block scope. A tad
-        // ugly.
-        // Calling trans_block directly instead of trans_expr
-        // because trans_expr will create another scope block
-        // context for the block, but we've already got the
-        // 'else' context
-
-        else_res =
+    // Synthesize a block here to act as the else block
+    // containing an if expression. Needed in order for the
+    // else scope to behave like a normal block scope. A tad
+    // ugly.
+    // Calling trans_block directly instead of trans_expr
+    // because trans_expr will create another scope block
+    // context for the block, but we've already got the
+    // 'else' context
+    let else_res =
         alt els {
           some(elexpr) {
             alt elexpr.node {
@@ -4908,7 +4902,7 @@ fn trans_call(cx: &@block_ctxt, f: &@ast::expr,
     let llretslot = args_res.retslot;
     /*
     log "calling: " + val_str(bcx_ccx(cx).tn, faddr);
-    
+
     for (ValueRef arg in llargs) {
         log "arg: " + val_str(bcx_ccx(cx).tn, arg);
     }
@@ -5334,9 +5328,9 @@ fn trans_expr_out(cx: &@block_ctxt, e: &@ast::expr, output: out_method) ->
       }
       _ {
         // The expression is an lvalue. Fall through.
-        assert (ty::is_lval(e)); // make sure it really is and that we
-                                 // didn't forget to add a case for a new expr!
-
+        assert (ty::is_lval(e));
+        // make sure it really is and that we
+        // didn't forget to add a case for a new expr!
       }
     }
     // lval cases fall through to trans_lval and then
@@ -6352,8 +6346,8 @@ fn copy_args_to_allocas(fcx: @fn_ctxt, args: &ast::arg[],
             alt bcx.fcx.llargs.find(aarg.id) {
               some(x) { argval = x; }
               _ {
-                bcx_ccx(bcx).sess.span_fatal(aarg.ty.span,
-                                             "unbound arg ID in copy_args_to_allocas");
+                bcx_ccx(bcx).sess.span_fatal
+                    (aarg.ty.span, "unbound arg ID in copy_args_to_allocas");
               }
             }
             bcx.build.Store(argval, a);
@@ -6374,8 +6368,8 @@ fn add_cleanups_for_args(bcx: &@block_ctxt, args: &ast::arg[],
             alt bcx.fcx.llargs.find(aarg.id) {
               some(x) { argval = x; }
               _ {
-                bcx_ccx(bcx).sess.span_fatal(aarg.ty.span,
-                                             "unbound arg ID in copy_args_to_allocas");
+                bcx_ccx(bcx).sess.span_fatal
+                    (aarg.ty.span, "unbound arg ID in copy_args_to_allocas");
               }
             }
             add_clean(bcx, argval, arg_tys.(arg_n).ty);
@@ -7227,9 +7221,8 @@ fn trans_tag_variant(cx: @local_ctxt, tag_id: ast::node_id,
     let bcx = new_top_block_ctxt(fcx);
     let lltop = bcx.llbb;
 
-    let 
-        // Cast the tag to a type we can GEP into.
-        llblobptr =
+    // Cast the tag to a type we can GEP into.
+    let llblobptr =
         if is_degen {
             fcx.llretptr
         } else {
index dbf8e472e53945610efa79d6e7e997735e518889..ead0bcaf0b63f1809d1dc1d848bba1ccaee8b323 100644 (file)
@@ -294,9 +294,8 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: ValueRef[],
             if ivec::len(ty::tag_variants(ccx.tcx, vdef.tg)) == 1u {
                 kind = single;
             } else {
-                let tagptr =
-                    bcx.build.PointerCast(val,
-                                          trans_common::T_opaque_tag_ptr(ccx.tn));
+                let tagptr = bcx.build.PointerCast
+                    (val, trans_common::T_opaque_tag_ptr(ccx.tn));
                 let discrimptr = bcx.build.GEP(tagptr, ~[C_int(0), C_int(0)]);
                 test_val = bcx.build.Load(discrimptr);
                 kind = switch;
index a14a7a25539558f37cce151b2727acdf5140234e..d125427776a0c90e6b32891bd53f7faa555e9fd9 100644 (file)
@@ -159,9 +159,7 @@ fn relax_precond_block(fcx: &fn_ctxt, i: node_id, b: &blk) {
     fn quit(keepgoing: @mutable bool, i: &@item) { *keepgoing = false; }
     fn kg(keepgoing: @mutable bool) -> bool { ret *keepgoing; }
 
-    let 
-
-        v =
+    let v =
         {visit_block_pre: bind relax_precond_block_non_recursive(fcx, i, _),
          visit_expr_pre: bind relax_precond_expr(fcx, i, _),
          visit_stmt_pre: bind relax_precond_stmt(fcx, i, _),
index c849ac8b33fe701bd884c2c0da64b01ad9b7fbed..d9910d8217dc3f96c066a2c17a04df692962f1d7 100644 (file)
@@ -641,7 +641,7 @@ fn find_pre_post_block(fcx: &fn_ctxt, b: blk) {
      This will mean that:
      x = 0;
      break;
-    
+
      won't have a postcondition that says x is initialized, but that's ok.
      */
 
index 1b3bc84b2c7623d5bf992c16c33369ff9bc345e0..674e5c9b9cbad42b4d678a1462ac10ba519b20a6 100644 (file)
@@ -1987,8 +1987,9 @@ fn unify_fn_common(cx: &@ctxt, expected: &t, actual: &t,
 
             let result_mode;
             if expected_input.mode != actual_input.mode {
-                ret fn_common_res_err(ures_err(terr_mode_mismatch(expected_input.mode,
-                                                                  actual_input.mode)));
+                ret fn_common_res_err
+                    (ures_err(terr_mode_mismatch(expected_input.mode,
+                                                 actual_input.mode)));
             } else { result_mode = expected_input.mode; }
             let result = unify_step(cx, expected_input.ty, actual_input.ty);
             alt result {
@@ -2817,10 +2818,10 @@ fn ast_constr_to_constr[T](tcx: ty::ctxt, c: &@ast::constr_general[T]) ->
                     {path: c.node.path, args: c.node.args, id: pred_id});
       }
       _ {
-        tcx.sess.span_fatal(c.span,
-                            "Predicate " + path_to_str(c.node.path) +
-                                " is unbound or bound to a non-function or an \
-                        impure function");
+        tcx.sess.span_fatal
+            (c.span, "Predicate " + path_to_str(c.node.path) +
+             " is unbound or bound to a non-function or an \
+              impure function");
       }
     }
 }
index 432930be56d3a9b12d4165b61afb3f8516e5843e..d567b9d45bc19bfec35123281c51d26e2695bab7 100644 (file)
@@ -164,14 +164,14 @@ fn instantiate_path(fcx: &@fn_ctxt, pth: &ast::path,
     if ty_substs_len > 0u {
         let param_var_len = ivec::len(ty_param_vars);
         if param_var_len == 0u {
-            fcx.ccx.tcx.sess.span_fatal(sp,
-                                        "this item does not take type parameters");
+            fcx.ccx.tcx.sess.span_fatal
+                (sp, "this item does not take type parameters");
         } else if (ty_substs_len > param_var_len) {
-            fcx.ccx.tcx.sess.span_fatal(sp,
-                                        "too many type parameter provided for this item");
+            fcx.ccx.tcx.sess.span_fatal
+                (sp, "too many type parameter provided for this item");
         } else if (ty_substs_len < param_var_len) {
-            fcx.ccx.tcx.sess.span_fatal(sp,
-                                        "not enough type parameters provided for this item");
+            fcx.ccx.tcx.sess.span_fatal
+                (sp, "not enough type parameters provided for this item");
         }
         let ty_substs: ty::t[] = ~[];
         let i = 0u;
@@ -868,11 +868,10 @@ fn collect_item_types(tcx: &ty::ctxt, crate: &@ast::crate) {
         let abi = @mutable none[ast::native_abi];
         let cx = @{tcx: tcx};
         let visit =
-            visit::mk_simple_visitor(@{visit_item: bind convert(cx, abi, _),
-                                       visit_native_item:
-                                           bind convert_native(cx, abi, _)
-                                          with
-                                              *visit::default_simple_visitor()});
+            visit::mk_simple_visitor
+            (@{visit_item: bind convert(cx, abi, _),
+               visit_native_item: bind convert_native(cx, abi, _)
+               with *visit::default_simple_visitor()});
         visit::visit_crate(*crate, (), visit);
     }
 }
@@ -1426,14 +1425,13 @@ fn check_pat(fcx: &@fn_ctxt, map: &ast::pat_id_map, pat: &@ast::pat,
                 // TODO (issue #448): Wrap a #fmt string over multiple
                 // lines...
 
-                fcx.ccx.tcx.sess.span_fatal(pat.span,
-                                            #fmt("this pattern has %u field%s, \
-                                                but the corresponding \
-                                                variant has no fields",
-                                                 subpats_len,
-                                                 if subpats_len == 1u {
-                                                     ""
-                                                 } else { "s" }));
+                fcx.ccx.tcx.sess.span_fatal
+                    (pat.span, #fmt("this pattern has %u field%s, \
+                                     but the corresponding \
+                                     variant has no fields",
+                                    subpats_len,
+                                    if subpats_len == 1u { "" }
+                                    else { "s" }));
             }
             write::ty_fixup(fcx, pat.id, path_tpot);
           }
@@ -1464,11 +1462,10 @@ fn check_pat(fcx: &@fn_ctxt, map: &ast::pat_id_map, pat: &@ast::pat,
         let f_count = ivec::len(fields);
         let ex_f_count = ivec::len(ex_fields);
         if ex_f_count < f_count || !etc && ex_f_count > f_count {
-            fcx.ccx.tcx.sess.span_fatal(pat.span,
-                                        #fmt("mismatched types: expected a record \
-                                     with %u fields, found one with %u \
-                                     fields",
-                                             ex_f_count, f_count));
+            fcx.ccx.tcx.sess.span_fatal
+                (pat.span, #fmt("mismatched types: expected a record \
+                                 with %u fields, found one with %u \
+                                 fields", ex_f_count, f_count));
         }
         fn matches(name: &str, f: &ty::field) -> bool {
             ret str::eq(name, f.ident);
@@ -1521,8 +1518,8 @@ fn require_pure_call(ccx: @crate_ctxt, caller_purity: &ast::purity,
         alt ccx.tcx.def_map.find(callee.id) {
           some(ast::def_fn(_, ast::pure_fn.)) { ret; }
           _ {
-            ccx.tcx.sess.span_fatal(sp,
-                                    "Pure function calls function not known to be pure");
+            ccx.tcx.sess.span_fatal
+                (sp, "Pure function calls function not known to be pure");
           }
         }
       }
@@ -1614,10 +1611,10 @@ fn check_call_or_bind(fcx: &@fn_ctxt, sp: &span, f: &@ast::expr,
                        arg_tys.(i).mode == mo_val {
                     // For why the check is necessary, see the
                     // none case in trans_bind_thunk
-                    fcx.ccx.tcx.sess.span_fatal(sp,
-                                                call_kind_str(call_kind) +
-                                                    " arguments with types containing parameters \
-                             must be passed by alias");
+                    fcx.ccx.tcx.sess.span_fatal
+                        (sp, call_kind_str(call_kind) +
+                         " arguments with types containing parameters \
+                          must be passed by alias");
                 }
               }
             }
@@ -1785,10 +1782,10 @@ fn check_binop_type_compat(fcx: &@fn_ctxt, span: span, ty: ty::t,
                 let variants = ty::tag_variants(fcx.ccx.tcx, id);
                 if ivec::len(variants) != 1u ||
                        ivec::len(variants.(0).args) != 1u {
-                    fcx.ccx.tcx.sess.span_fatal(expr.span,
-                                                "can only dereference tags " +
-                                                    "with a single variant which has a "
-                                                    + "single argument");
+                    fcx.ccx.tcx.sess.span_fatal
+                        (expr.span, "can only dereference tags " +
+                         "with a single variant which has a "
+                         + "single argument");
                 }
                 oper_t =
                     ty::substitute_type_params(fcx.ccx.tcx, tps,
@@ -1983,10 +1980,9 @@ fn check_binop_type_compat(fcx: &@fn_ctxt, span: span, ty: ty::t,
           ty::ty_ivec(vec_elt_ty) { elt_ty = vec_elt_ty.ty; }
           ty::ty_istr. { elt_ty = ty::mk_mach(fcx.ccx.tcx, ast::ty_u8); }
           _ {
-            fcx.ccx.tcx.sess.span_fatal(expr.span,
-                                        "mismatched types: expected vector or string but "
-                                            + "found " +
-                                            ty_to_str(fcx.ccx.tcx, ety));
+            fcx.ccx.tcx.sess.span_fatal
+                (expr.span, "mismatched types: expected vector or string but "
+                 + "found " + ty_to_str(fcx.ccx.tcx, ety));
           }
         }
         check_for_or_for_each(fcx, decl, elt_ty, body, id);
@@ -2440,10 +2436,9 @@ fn get_anon_obj_method_types(fcx: @fn_ctxt, ao: &ast::anon_obj,
                       _ {
                         // The user is trying to extend a
                         // non-object.
-                        fcx.ccx.tcx.sess.span_fatal(e.span,
-                                                    syntax::print::pprust::expr_to_str(e)
-                                                        +
-                                                        " does not have object type");
+                        fcx.ccx.tcx.sess.span_fatal
+                            (e.span, syntax::print::pprust::expr_to_str(e) +
+                             " does not have object type");
                       }
                     }
                   }
index 4374030d10a691b56e0c6305666ca796c4d6628e..8fb396392d71ba940bb623e700cbcb432cf33578 100644 (file)
@@ -329,9 +329,9 @@ fn log_conv(c: conv) {
     let expected_nargs = n + 1u; // n conversions + the fmt string
 
     if expected_nargs < nargs {
-        cx.span_fatal(sp,
-                      #fmt("too many arguments to #fmt. found %u, expected %u",
-                           nargs, expected_nargs));
+        cx.span_fatal
+            (sp, #fmt("too many arguments to #fmt. found %u, expected %u",
+                      nargs, expected_nargs));
     }
     ret tmp_expr;
 }
index 4bb95450a7aa36f93f69b5b23e5624f60727a06b..d52c234205cab127ec0b5bce2cbc979f04f7bc14 100644 (file)
@@ -317,10 +317,9 @@ fn fold_anon_obj_field_(aof: &anon_obj_field, fld: ast_fold) ->
 
         ret {fields:
                  alt ao.fields {
-                   option::none[anon_obj_field[]]. { ao.fields }
-                   option::some[anon_obj_field[]](v) {
-                     option::some[anon_obj_field[]](ivec::map(fold_anon_obj_field,
-                                                              v))
+                   option::none. { ao.fields }
+                   option::some(v) {
+                     option::some(ivec::map(fold_anon_obj_field, v))
                    }
                  },
              methods: ivec::map(fld.fold_method, ao.methods),
index c93f8ce52a958575798ac0886c623f43ae70e91f..0b402e2e054834252c6748f1026f3e199104ca37 100644 (file)
@@ -1812,15 +1812,14 @@ fn parse_dtor(p: &parser) -> @ast::method {
     let b: ast::blk = parse_block(p);
     let inputs: ast::arg[] = ~[];
     let output: @ast::ty = @spanned(lo, lo, ast::ty_nil);
-    let 
-
-        // I guess dtors can't have constraints?
-        d: ast::fn_decl =
-        {inputs: inputs,
-         output: output,
-         purity: ast::impure_fn,
-         cf: ast::return,
-         constraints: ~[]};
+    // I guess dtors can't have constraints?
+    let d: ast::fn_decl = {
+        inputs: inputs,
+        output: output,
+        purity: ast::impure_fn,
+        cf: ast::return,
+        constraints: ~[]
+    };
     let f: ast::_fn = {decl: d, proto: ast::proto_fn, body: b};
     let m: ast::method_ = {ident: "drop", meth: f, id: p.get_id()};
     ret @spanned(lo, f.body.span.hi, m);
@@ -1877,9 +1876,8 @@ fn parse_item_res(p: &parser, lyr: ast::layer, attrs: &ast::attribute[]) ->
 
 fn parse_mod_items(p: &parser, term: token::token,
                    first_item_attrs: &ast::attribute[]) -> ast::_mod {
-    let 
-        // Shouldn't be any view items since we've already parsed an item attr
-        view_items =
+    // Shouldn't be any view items since we've already parsed an item attr
+    let view_items =
         if ivec::len(first_item_attrs) == 0u { parse_view(p) } else { ~[] };
     let items: (@ast::item)[] = ~[];
     let initial_attrs = first_item_attrs;
@@ -1960,11 +1958,10 @@ fn parse_native_item(p: &parser, attrs: &ast::attribute[]) ->
 }
 
 fn parse_native_mod_items(p: &parser, native_name: &str, abi: ast::native_abi,
-                          first_item_attrs: &ast::attribute[]) ->
-   ast::native_mod {
-    let 
-        // Shouldn't be any view items since we've already parsed an item attr
-        view_items =
+                          first_item_attrs: &ast::attribute[])
+    -> ast::native_mod {
+    // Shouldn't be any view items since we've already parsed an item attr
+    let view_items =
         if ivec::len(first_item_attrs) == 0u {
             parse_native_view(p)
         } else { ~[] };
index 00302ea9e2602ec483085ea46ba3eda6e7bd1dc3..f9db8eda6939f8d8b68ce87c75541f015c80da81 100644 (file)
@@ -215,11 +215,9 @@ fn parse_type(s: str, i: uint, lim: uint, error: error_fn) ->
        {ty: ty, next: uint} {
         if i >= lim { error("missing type in conversion"); }
         let tstr = str::substr(s, i, 1u);
-        let 
-
-            // TODO: Do we really want two signed types here?
-            // How important is it to be printf compatible?
-            t =
+        // TODO: Do we really want two signed types here?
+        // How important is it to be printf compatible?
+        let t =
             if str::eq(tstr, "b") {
                 ty_bool
             } else if (str::eq(tstr, "s")) {
@@ -305,13 +303,11 @@ fn conv_char(cv: &conv, c: char) -> str {
         ret pad(cv, str::from_char(c), pad_nozero);
     }
     fn conv_str(cv: &conv, s: str) -> str {
-        let 
-
-            // For strings, precision is the maximum characters
-            // displayed
+        // For strings, precision is the maximum characters
+        // displayed
 
-            // FIXME: substr works on bytes, not chars!
-            unpadded =
+        // FIXME: substr works on bytes, not chars!
+        let unpadded =
             alt cv.precision {
               count_implied. { s }
               count_is(max) {
index 71dc9cf7a65dbccaaf3588758f7cb1d42de2c011..c710d220a6bb0036833100e0165640b4498ce69a 100644 (file)
@@ -90,10 +90,12 @@ fn from_mut[T](v: &T[mutable ]) -> T[] {
 // Accessors
 
 /// Returns the first element of a vector
-fn head[T](v: &T[mutable? ]) -> T { ret v.(0); }
+fn head[T](v: &T[mutable?]) : is_not_empty(v) -> T { ret v.(0); }
 
 /// Returns all but the first element of a vector
-fn tail[T](v: &T[mutable? ]) -> T[mutable? ] { ret slice(v, 1u, len(v)); }
+fn tail[T](v: &T[mutable? ]) : is_not_empty(v)  -> T[mutable?] {
+    ret slice(v, 1u, len(v));
+}
 
 /// Returns the last element of `v`.
 fn last[T](v: &T[mutable? ]) -> option::t[T] {
index ca0a81add8021a7d9d64f81dd5acc858f77fe3d0..0adf356116586543d83bae58132f4b1aea6006f7 100644 (file)
@@ -396,7 +396,7 @@ fn slice(s: str, begin: uint, end: uint) -> str {
     ret rustrt::str_slice(s, begin, end);
 }
 
-fn safe_slice(s: str, begin: uint, end: uint) -> str {
+fn safe_slice(s: str, begin: uint, end: uint): le(begin, end) -> str {
     assert (end <=
                 str::byte_len(s)); // would need some magic to
                                    // make this a precondition
@@ -505,7 +505,7 @@ fn to_upper(s: str) -> str {
 }
 
 // FIXME: This is super-inefficient
-fn replace(s: str, from: str, to: str) -> str {
+fn replace(s: str, from: str, to: str) : is_not_empty(from) -> str {
     // FIXME (694): Shouldn't have to check this
     check (is_not_empty(from));
     if byte_len(s) == 0u {
index 801d7cff073d15e8d17b32e34ee9891bb7d773cc..03606debc1d85fcaca8ddc66a83dabb4a181437f 100644 (file)
@@ -58,7 +58,7 @@ fn test_main(args: &vec[str], tests: &test_desc[]) {
 type opt_res = either::t[test_opts, str];
 
 // Parses command line arguments into test options
-fn parse_opts(args: &str[]) -> opt_res {
+fn parse_opts(args: &str[]) : ivec::is_not_empty(args) -> opt_res {
 
     // FIXME (#649): Shouldn't have to check here
     check (ivec::is_not_empty(args));
index 4168df1f9344901c7bcc374dccdefd034e35b525..08ef4995ad4ec19aa8212547833dbd5d37e936fa 100644 (file)
@@ -6,16 +6,13 @@
 }
 
 fn main() {
-
-    let 
-        //
-        // Leave these commented out to
-        // finish in a reasonable time
-        // during 'make check' under valgrind
-        // 5000000
-        // 50000000
-        inputs: vec[int] =
-        [50000, 500000];
+    //
+    // Leave these commented out to
+    // finish in a reasonable time
+    // during 'make check' under valgrind
+    // 5000000
+    // 50000000
+    let inputs: vec[int] = [50000, 500000];
 
     let bodies: vec[Body::props] = NBodySystem::MakeNBodySystem();
 
@@ -35,9 +32,8 @@ fn main() {
 mod NBodySystem {
 
     fn MakeNBodySystem() -> vec[Body::props] {
-        let 
-            // these each return a Body::props
-            bodies: vec[Body::props] =
+        // these each return a Body::props
+        let bodies: vec[Body::props] =
             [Body::sun(), Body::jupiter(), Body::saturn(), Body::uranus(),
              Body::neptune()];
 
index 400d420c0aad1dc258300c1de35118fec7168f21..85714affba6e630767cda54c0d244b71df27f8f2 100644 (file)
@@ -1,6 +1,6 @@
-./src/test/compile-fail/attr-bad-meta.rs:5:6:5:7: \e[1;31merror:\e[0m expecting ], found *
-./src/test/compile-fail/attr-bad-meta.rs:5 #[attr*]
-                                                 ^
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0xa6bf04c root task failed
+// xfail-stage0
+// error-pattern:expecting ]
+
+// asterisk is bogus
+#[attr*]
+mod m { }
\ No newline at end of file
index 184d8b0326c99ae7ad0d2699567cdd8017cd1209..29dd83b8af0defab833afcee737538dc22a8bb73 100644 (file)
@@ -1,6 +1,10 @@
-./src/test/compile-fail/attr-before-stmt.rs:6:2:6:6: \e[1;31merror:\e[0m expected item
-./src/test/compile-fail/attr-before-stmt.rs:6   auto x = 10;
-                                                ^~~~
-rt: ---
-rt: 0bb1:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: 0bb1:main:                        domain main @0x8ef904c root task failed
+// xfail-stage0
+// error-pattern:expected item
+
+fn f() {
+  #[foo = "bar"]
+  let x = 10;
+}
+
+fn main() {
+}
index e0e8b660ef6623f8f10d80b95dee785e8e8fa1fa..56e2ab7f54f877e5efd53dcf39465ec592f6e43d 100644 (file)
@@ -1,6 +1,8 @@
-./src/test/compile-fail/attr-before-view-item.rs:5:0:5:3: \e[1;31merror:\e[0m expected item but found use
-./src/test/compile-fail/attr-before-view-item.rs:5 use std;
-                                                   ^~~
-rt: ---
-rt: 0bb1:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: 0bb1:main:                        domain main @0xa78604c root task failed
+// xfail-stage0
+// error-pattern:expected item
+
+#[foo = "bar"]
+use std;
+
+fn main() {
+}
index 7c3494842a145bc90f912114937edd69419edb8b..ad4071a07aa65bfc6127ceb2210bff1e4c9c326e 100644 (file)
@@ -1,6 +1,10 @@
-./src/test/compile-fail/attr-before-view-item2.rs:6:2:6:5: \e[1;31merror:\e[0m expected item but found use
-./src/test/compile-fail/attr-before-view-item2.rs:6   use std;
-                                                      ^~~
-rt: ---
-rt: 0bb1:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: 0bb1:main:                        domain main @0xa1fd04c root task failed
+// xfail-stage0
+// error-pattern:expected item
+
+mod m {
+  #[foo = "bar"]
+  use std;
+}
+
+fn main() {
+}
index 4886d5d4d36da11a56a850d3ecdc0f2128cbe7f6..c31b3250d768c8d05486d9796a12400e298125d6 100644 (file)
@@ -1,6 +1,9 @@
-./src/test/compile-fail/attr-dangling-in-fn.rs:6:0:6:1: \e[1;31merror:\e[0m expected item
-./src/test/compile-fail/attr-dangling-in-fn.rs:6 }
-                                                 ^
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0x9fb104c root task failed
+// xfail-stage0
+// error-pattern:expected item
+
+fn f() {
+  #[foo = "bar"]
+}
+
+fn main() {
+}
index 7684dc82e60a91d4dcc39b0f7a58d34ac21d52a5..bd072402d257da634381b7820b2f99792a14259a 100644 (file)
@@ -1,6 +1,7 @@
-./src/test/compile-fail/attr-dangling-in-mod.rs:7:14:7:14: \e[1;31merror:\e[0m expected item but found <eof>
-./src/test/compile-fail/attr-dangling-in-mod.rs:7 #[foo = "bar"]
-                                                                ^
-rt: ---
-rt: 0bb1:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: 0bb1:main:                        domain main @0xa2d504c root task failed
+// xfail-stage0
+// error-pattern:expected item
+
+fn main() {
+}
+
+#[foo = "bar"]
index 0d2632ab448f79c4d57ce98e0413e76e5274aed9..0762953569e2fa46956b95449af467676ae94b81 100644 (file)
@@ -1,6 +1,6 @@
-./src/test/compile-fail/bad-alt.rs:5:7:5:8: \e[1;31merror:\e[0m expecting {, found ;
-./src/test/compile-fail/bad-alt.rs:5   alt x;
-                                            ^
-rt: ---
-rt: 0bb1:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: 0bb1:main:                        domain main @0x9e0f04c root task failed
+// error-pattern: expecting
+
+fn main() {
+  let int x = 5;
+  alt x;
+}
index b16a806273c43338929a162ab6440ee09451a3dc..a53b8284d59e242726ffd748db757bcfa86779e4 100644 (file)
@@ -1,6 +1,5 @@
-./src/test/compile-fail/bad-name.rs:4:7:4:8: \e[1;31merror:\e[0m expecting ident
-./src/test/compile-fail/bad-name.rs:4   let x.y[int].z foo;
-                                             ^
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0x8d6004c root task failed
+// error-pattern: expecting
+
+fn main() {
+  let x.y[int].z foo;
+}
index afc3f85541b2a8a97daeba97f685f745e84195ee..cebe5b3b189606a4459ef28871e0d14c742844f7 100644 (file)
@@ -11,7 +11,7 @@
 
 pred less_than(x: int, y: int) -> bool { ret x < y; }
 
-type ordered_range = {low: int, high: int} :  : less_than(low, high);
+type ordered_range = {low: int, high: int} : less_than(low, high);
 
 fn main() {
     // Should fail to compile, b/c we're not doing the check
index b91e2aa782a852966feffe58caa6e3943f64c1d6..7d8774dbb1f41e63d409bae93e7f44634cdd928e 100644 (file)
@@ -1,16 +1,25 @@
 // xfail-stage0
 // error-pattern: Unsatisfied precondition constraint (for example, even(y
 
-fn print_even(y: int) { log y; }
+fn print_even(y: int) : even(y) {
+  log y;
+}
 
-pred even(y: int) -> bool { true }
+pred even(y: int) -> bool {
+  true
+}
 
 fn main() {
-
-    let y: int = 42;
-    check (even(y));
-    do  {
-        print_even(y);
-        do  { do  { do  { y += 1; } while true } while true } while true
-    } while true
-}
\ No newline at end of file
+  let y: int = 42;
+  check even(y);
+  do {
+    print_even(y);
+    do {
+      do {
+    do {
+      y += 1;
+    } while (true);
+      } while (true);
+    } while (true);
+  } while (true);
+}
index 530e912e1abd9d365479658ddd52ca5585f58766..446fb836717c676627d582a9df42807d45002f8a 100644 (file)
@@ -1,6 +1,8 @@
-./src/test/compile-fail/ext-after-attrib.rs:7:1:7:4: \e[1;31merror:\e[0m expecting [, found fmt
-./src/test/compile-fail/ext-after-attrib.rs:7 #fmt("baz")
-                                               ^~~
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0xa47a04c root task failed
+// xfail-stage0
+// error-pattern:expecting [, found fmt
+
+// Don't know how to deal with a syntax extension appearing after an
+// item attribute. Probably could use a better error message.
+#[foo = "bar"]
+#fmt("baz")
+fn main() { }
\ No newline at end of file
index 0846633b25e529809c89753a31d6ba8d06130b78..82395c710a8f38f1d00e1895f0e61e458c512831 100644 (file)
@@ -1,6 +1,5 @@
-./src/test/compile-fail/ext-noname.rs:4:3:4:4: \e[1;31merror:\e[0m expected a syntax expander name
-./src/test/compile-fail/ext-noname.rs:4   #();
-                                           ^
-rt: ---
-rt: 0bb1:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: 0bb1:main:                        domain main @0x91a204c root task failed
+// error-pattern:expected a syntax expander name
+
+fn main() {
+  #();
+}
\ No newline at end of file
index d9230783e98b2aee318b27d15814060b09a29ed1..5b0be3c987132690a7ddf3a3de7703ac85ef8d6e 100644 (file)
@@ -1,3 +1,5 @@
 // error-pattern:malformed #env call
 
-fn main() { #env; }
\ No newline at end of file
+fn main() {
+    #env();
+}
index d6e146a0d14ed3a812814913808ab46315919a5f..8bc3f23f2f037f0778863825b94edde013e6f216 100644 (file)
@@ -1,3 +1,5 @@
 // error-pattern:format string
 
-fn main() { #fmt; }
\ No newline at end of file
+fn main() {
+    #fmt();
+}
\ No newline at end of file
index 50c59d143c9a1233539f78689c9c7be4e72117bb..768cc1e1bf4c66effe9ea91b81a5d67e8ed2daa7 100644 (file)
@@ -1,6 +1,6 @@
-./src/test/compile-fail/fail-simple.rs:5:9:5:10: \e[1;31merror:\e[0m unexpected token: ;
-./src/test/compile-fail/fail-simple.rs:5   fail @ ;
-                                                  ^
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0x994f04c root task failed
+// -*- rust -*-
+
+// error-pattern:unexpected token
+fn main() {
+  fail @ ;
+}
index 0d190374642d281a3b38e15d7ba1e20d0c7f0b42..df8f1147fde546e58f4fe96c6d719bf5b847984f 100644 (file)
@@ -6,7 +6,7 @@
     } else if (x == 2u) { ret true; } else { ret even(x - 2u); }
 }
 
-fn print_even(x: uint) { log x; }
+fn print_even(x: uint) : even(x) { log x; }
 
 fn foo(x: uint) { if check even(x) { fail; } else { print_even(x); } }
 
index a2ff7ef8f49248fbe045d9cdee973778b3e214d6..8a5d253618322ceec96b4f88aacffe350293d62b 100644 (file)
@@ -1,11 +1,7 @@
 // xfail-stage0
 //error-pattern:is an expr, expected an identifier
 fn main() {
-    #macro([#mylambda(x, body),
-            {
-                fn f(x: int) -> int { ret body }
-                f
-            }]);
+  #macro([#mylambda(x, body), {fn f(x: int) -> int {ret body}; f}]);
 
-    assert (#mylambda(y * 1, y * 2)(8) == 16);
+  assert(#mylambda(y*1, y*2)(8) == 16);
 }
\ No newline at end of file
index 2118e5ce7fe0a9163a2f2a8339c991f2c8798f1d..5beb996ebbf4658cc8138c6b31d9fda3d6105348 100644 (file)
@@ -2,8 +2,7 @@
 //error-pattern:no clauses match
 
 fn main() {
-    #macro([#trivial, 1 * 2 * 4 * 2 * 1]);
+  #macro([#trivial(), 1*2*4*2*1]);
 
-    assert (#trivial(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) ==
-                16);
-}
\ No newline at end of file
+  assert(#trivial(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) == 16);
+}
index 220a5e5d0aa6c451609f2169c7989203067129e7..a345425fc9822ebf1ef03ed6321a29feed49753f 100644 (file)
@@ -1,6 +1,10 @@
-./src/test/compile-fail/multiline-comment-line-tracking.rs:9:2:9:3: \e[1;31merror:\e[0m unexpected token: %
-./src/test/compile-fail/multiline-comment-line-tracking.rs:9   %; // parse error on line 9, but is reported on line 6 instead.
-                                                               ^
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0x969e04c root task failed
+// -*- rust -*-
+// error-pattern:9:2
+
+/* 1
+ * 2
+ * 3
+ */
+fn main() {
+  %; // parse error on line 9, but is reported on line 6 instead.
+}
index 6852429b24e88a35c62948b4588f9e216e456eb3..5ec15e9c65308aa56692cd928698509407de6b8d 100644 (file)
@@ -8,5 +8,6 @@
 
 fn main() {
     let z = f();
-    check (z.g(42)); // should fail to typecheck, as z.g isn't an explicit name
+    // should fail to typecheck, as z.g isn't an explicit name
+    check (z.g(42));
 }
\ No newline at end of file
index a3421c65613348f15d0afc8102153019ea3f6ae1..5e29596a712fcae457cb4d615f85a9a6632de4e1 100644 (file)
@@ -2,7 +2,7 @@
 // xfail-stage0
 // error-pattern: Non-predicate in constraint: lt
 
-fn f(a: int, b: int) { }
+fn f(a: int, b: int) : lt(a,b) { }
 
 obj lt(a: int, b: int) { }
 
index 81a0cb08af11c95e8a4d8f266a07506e19e30cf6..e73cd18dac7c554a2518ca6f069a662072ce31c7 100644 (file)
@@ -5,6 +5,7 @@
 pred f(q: int) -> bool { ret true; }
 
 fn main() {
-    // should fail to typecheck, as pred args must be slot variables or literals
+    // should fail to typecheck, as pred args must be slot variables
+    // or literals
     check (f(42 * 17));
 }
\ No newline at end of file
index c70ee8e5e676d02fa1dd4294228fe21e44fe7e36..167572f00167548356cc001600d573ea07eba54a 100644 (file)
@@ -3,7 +3,7 @@
 
 // error-pattern: Unsatisfied precondition constraint (for example, lt(a, b)
 
-fn f(a: int, b: int) { }
+fn f(a: int, b: int) : lt(a,b) { }
 
 pred lt(a: int, b: int) -> bool { ret a < b; }
 
index adf0f027fbc33125e2809c62b2214486036b04b8..a3b583bd6dd93c4b0c8c7f55e2ee560afb5da608 100644 (file)
@@ -3,7 +3,7 @@
 
 // error-pattern: lt(a, c)
 
-fn f(a: int, b: int) { }
+fn f(a: int, b: int) : lt(a,b) { }
 
 pred lt(a: int, b: int) -> bool { ret a < b; }
 
index 4d3881c00870d4e88c87038624d4153593e6750a..110db69fee28937a8b48a3ec27517996a86acbe6 100644 (file)
@@ -3,7 +3,7 @@
 
 // error-pattern: Unsatisfied precondition constraint (for example, lt(a, b)
 
-fn f(a: int, b: int) { }
+fn f(a: int, b: int) : lt(a,b) { }
 
 pred lt(a: int, b: int) -> bool { ret a < b; }
 
index 32aee6fbb6bc74846668454ef36db03337cd1f6b..af69d2ac1a4c8c3ae9e3e8b34d66763301a01d08 100644 (file)
@@ -1,6 +1,12 @@
-./src/test/compile-fail/self-missing-method.rs:6:14:6:15: \e[1;31merror:\e[0m expecting ., found (
-./src/test/compile-fail/self-missing-method.rs:6           self();
-                                                               ^
-rt: ---
-rt: 0bb1:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: 0bb1:main:                        domain main @0x8f5904c root task failed
+// error-pattern:expecting ., found (
+fn main() {
+
+  obj foo() {
+      fn m() {
+          self();
+      }
+  }
+
+  let a = foo;
+  a.m();
+}
index ae50c6bf3acbdabfec1470a5bff9fad8ef93fc4a..65a8863fbad94d1f1a65e982f4d910a52d31b516 100644 (file)
@@ -2,7 +2,7 @@
 // xfail-stage0
 // error-pattern: unresolved name: lt
 
-fn f(a: int, b: int) { }
+fn f(a: int, b: int) : lt(a,b) { }
 
 fn main() {
     let lt: int;
index 632ea716b7b616793733c5e404fe8ca6712bc2e1..559065a00f4c331ad6fad3449aae70bbe89d992e 100644 (file)
@@ -1,6 +1,10 @@
-./src/test/compile-fail/tail-non-call.rs:5:6:5:7: \e[1;31merror:\e[0m Non-call expression in tail call
-./src/test/compile-fail/tail-non-call.rs:5   be x;
-                                                 ^
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0x9d9404c root task failed
+// error-pattern: Non-call expression in tail call
+
+fn f() -> int {
+  let x = 1;
+  be x;
+}
+
+fn main() {
+  let y = f();
+}
index 55d4bfb2d5c82d1595bfc83f7a30678b0496a90b..c9d3e0c9b6a4fe85de51db487e5c417445872c44 100644 (file)
@@ -1,6 +1,11 @@
-./src/test/compile-fail/unbalanced-comment.rs:11:1:11:1: \e[1;31merror:\e[0m unterminated block comment
-./src/test/compile-fail/unbalanced-comment.rs:11 }
-                                                  ^
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/lexer.rs:153
-rt: f00e:main:                        domain main @0x96ef04c root task failed
+// -*- rust -*-
+
+// error-pattern: unterminated block comment
+
+/*
+ * This is an un-balanced /* multi-line comment.
+ */
+
+fn main() {
+  log "hello, world.";
+}
index 0defbe2e40c647fc8643c863fb527d29159cd165..0cfda830ee900784cb6c1973b51b36fde887028d 100644 (file)
@@ -1,7 +1,7 @@
 // xfail-stage0
 // error-pattern: Unsatisfied precondition constraint (for example, even(y
 
-fn print_even(y: int) { log y; }
+fn print_even(y: int) : even(y) { log y; }
 
 pred even(y: int) -> bool { true }
 
index ecf1ca54c92667e2d635156ffa1f965304a9b8d2..2271e9dcc653195a5fca5cdc54be966281c4e7b1 100644 (file)
@@ -5,6 +5,11 @@
 import std::str::*;
 import std::uint::*;
 
-fn nop(a: uint, b: uint) { fail "quux"; }
+fn nop(a: uint, b: uint) : le(a, b) { fail "quux"; }
 
-fn main() { let a: uint = 5u; let b: uint = 4u; claim (le(a, b)); nop(a, b); }
\ No newline at end of file
+fn main() {
+    let a: uint = 5u;
+    let b: uint = 4u;
+    claim (le(a, b));
+    nop(a, b);
+}
index c46d8b18cb1dc05c26554127c5e1adf9b585d0c5..c1e6b73aefc5090e4bac2ff3261b02afbed5cf94 100644 (file)
@@ -1,6 +1,33 @@
-./src/test/run-fail/task-comm-14.rs:5:0:5:2: \e[1;31merror:\e[0m expected item but found io
-./src/test/run-fail/task-comm-14.rs:5 io fn main() {
-                                      ^~
-rt: ---
-rt: 0bb1:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: 0bb1:main:                        domain main @0x919b04c root task failed
+// xfail-stage0
+// xfail-stage1
+// xfail-stage2
+// xfail-stage3
+io fn main() {
+    let port[int] po = port();
+
+    // Spawn 10 tasks each sending us back one int.
+    let int i = 10;
+    while (i > 0) {
+        log i;
+        spawn "child" child(i, chan(po));
+        i = i - 1;
+    }
+
+    // Spawned tasks are likely killed before they get a chance to send
+    // anything back, so we deadlock here.
+
+    i = 10;
+    let int value = 0;
+    while (i > 0) {
+        log i;
+        po |> value;
+        i = i - 1;
+    }
+
+    log "main thread exiting";
+}
+
+io fn child(int x, chan[int] ch) {
+    log x;
+    ch <| x;
+}
index f30a75819ddcc0409b04edcb8eb125f5901df5d4..bee450e9893cd9b3836002055385030778f14ffb 100644 (file)
@@ -1,6 +1,15 @@
-./src/test/run-pass/alt-type-simple.rs:6:6:6:10: \e[1;31merror:\e[0m found type in expression position
-./src/test/run-pass/alt-type-simple.rs:6   alt type (f) {
-                                               ^~~~
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0x9b0204c root task failed
+// xfail-stage0
+// xfail-stage1
+// xfail-stage2
+// xfail-stage3
+fn altsimple(any x) {
+  alt type (f) {
+    case (int i) { print("int"); }
+    case (str s) { print("str"); }
+  }
+}
+
+fn main() {
+  altsimple(5);
+  altsimple("asdfasdfsDF");
+}
index 9c8afbfea02717a4f85bfc2b7f32bc1e07f3c030..19860158ce4a0b0bf75606726e0f8abda7d3561e 100644 (file)
@@ -10,9 +10,7 @@ fn main() {
     let my_a = a();
 
     // An anonymous object that overloads the 'foo' method.
-    let 
-
-        my_b =
+    let my_b =
         obj () {
             fn foo() -> int { ret 3; }
             with
index 84fb21f0c42e8d92ba21c0a05a2883021d3c90cd..2164ef25a0ae23d2de9741c4b7eb3768c95c9e3d 100644 (file)
@@ -43,7 +43,7 @@
 
 fn main() {
 
-  auto num = 12;
+  let num = 12;
 
   assert if (true) { 12 } else { 12 } - num == 0;
   assert 12 - if (true) { 12 } else { 12 } == 0;
index 27d3848459124ecf683c9c2c252244758a6a7edd..01ffc0963ee439f93eb9369fb7e64a988d981300 100644 (file)
@@ -1,6 +1,14 @@
-./src/test/run-pass/clone-with-exterior.rs:12:28:12:29: \e[1;31merror:\e[0m expecting (, found f
-./src/test/run-pass/clone-with-exterior.rs:12   let task p = spawn thread f(z);
-                                                                          ^
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0x8f2504c root task failed
+// xfail-stage0
+// xfail-stage1
+// xfail-stage2
+// xfail-stage3
+fn f(@rec(int a, int b) x) {
+  assert (x.a == 10);
+  assert (x.b == 12);
+}
+
+fn main() {
+  let @rec(int a, int b) z = rec(a=10, b=12);
+  let task p = spawn thread f(z);
+  join p;
+}
\ No newline at end of file
index 43831168ed63c120648be3e57d29af1fb35c0256..6f3c6a51dfe277614ef7aa4dd15afd014c57b6a5 100644 (file)
@@ -7,6 +7,6 @@
 
 pred less_than(x: int, y: int) -> bool { ret x < y; }
 
-type ordered_range = {low: int, high: int} :  : less_than(low, high);
+type ordered_range = {low: int, high: int} : less_than(*.low, *.high);
 
 fn main() { }
\ No newline at end of file
index aadde397d53a1b82fd8540950c4aa01a35864dfb..ae504a7916fad1485ca40b5babb34e2762e74e62 100644 (file)
@@ -1,6 +1,123 @@
-./src/test/run-pass/destructor-ordering.rs:25:0:25:2: \e[1;31merror:\e[0m expected item but found io
-./src/test/run-pass/destructor-ordering.rs:25 io fn check_order(port[order_info] expected_p) {
-                                              ^~
-rt: ---
-rt: 17b9:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: 17b9:main:                        domain main @0x96d304c root task failed
+// xfail-stage0
+// xfail-stage1
+// xfail-stage2
+// xfail-stage3
+// This test checks that destructors run in the right order.  Because
+// stateful objects can't have destructors, we have the destructors
+// record their expected order into a channel when they execute (so
+// the object becomes 'io' rather than 'state').  Then each test case
+// asserts that the channel produces values in ascending order.
+//
+// FIXME: Write an int->str function and concatenate the whole failure
+// message into a single log statement (or, even better, a print).
+//
+// FIXME: check_order should take only 1 line in a test, not 2+a block
+// block. Since destructor-having objects can't refer to mutable state
+// (like the port), we'd need a with-like construct to do the same for
+// stateful objects within a scope.
+//
+// FIXME #21: Each test should execute in its own task, so it can fail
+// independently, writing its error message to a channel that the
+// parent task aggregates.
+
+type order_info = rec(int order, str msg);
+
+io fn check_order(port[order_info] expected_p) {
+  chan(expected_p) <| rec(order=-1, msg="");
+  let mutable int actual = 0;
+  // FIXME #121: Workaround for while(true) bug.
+  auto expected; expected_p |> expected;
+  auto done = -1;  // FIXME: Workaround for typechecking bug.
+  while(expected.order != done) {
+    if (expected.order != actual) {
+      log expected.order;
+      log " != ";
+      log actual;
+      log expected.msg;
+      fail;
+    }
+    actual += 1;
+    expected_p |> expected;
+  }
+}
+
+
+obj dorder(chan[order_info] expected, int order, str message) {
+  drop {
+    expected <| rec(order=order, msg=message);
+  }
+}
+
+io fn test_simple() {
+  let port[order_info] tracker_p = port();
+  auto tracker = chan(tracker_p);
+  dorder(tracker, 1, "Reverse decl order");
+  dorder(tracker, 0, "Reverse decl order");
+  check_order(tracker_p);
+}
+
+io fn test_block() {
+  let port[order_info] tracker_p = port();
+  auto tracker = chan(tracker_p);
+  {
+    dorder(tracker, 2, "Before block");
+    {
+      dorder(tracker, 0, "Inside block");
+    }
+    dorder(tracker, 1, "After block");
+  }
+  check_order(tracker_p);
+}
+
+io fn test_decl_v_init() {
+  let port[order_info] tracker_p = port();
+  auto tracker = chan(tracker_p);
+  {
+    auto var1;
+    auto var2;
+    var2 = dorder(tracker, 0, "decl, not init");
+    var1 = dorder(tracker, 1, "decl, not init");
+  }
+  check_order(tracker_p);
+}
+
+io fn test_overwritten_obj() {
+  let port[order_info] tracker_p = port();
+  auto tracker = chan(tracker_p);
+  {
+    auto var1 = dorder(tracker, 0, "overwritten object destroyed first");
+    auto var2 = dorder(tracker, 2, "destroyed at end of scope");
+    var1 = dorder(tracker, 3, "overwriter deleted in rev decl order");
+    {
+      dorder(tracker, 1, "overwritten object destroyed before end of scope");
+    }
+  }
+  check_order(tracker_p);
+}
+
+// Used to embed dorder objects into an expression.  Note that the
+// parameters don't get destroyed.
+fn combine_dorders(dorder d1, dorder d2) -> int {
+  ret 1;
+}
+io fn test_expression_destroyed_right_to_left() {
+  let port[order_info] tracker_p = port();
+  auto tracker = chan(tracker_p);
+  {
+    combine_dorders(dorder(tracker, 4, ""), dorder(tracker, 3, ""))
+      / combine_dorders(dorder(tracker, 2, ""), dorder(tracker, 1, ""));
+    {
+      dorder(tracker, 0,
+             "expression objects live to end of block, not statement");
+    }
+  }
+  check_order(tracker_p);
+}
+
+io fn main() {
+  test_simple();
+  test_block();
+  test_decl_v_init();
+  test_overwritten_obj();
+  test_expression_destroyed_right_to_left();
+}
index 32d9b0e189905aa33515221ee69b8c014d50591c..bb7fdd308178a4e73595e96564fb47f0dc110e64 100644 (file)
@@ -5,7 +5,7 @@
     } else if (x == 2u) { ret true; } else { ret even(x - 2u); }
 }
 
-fn print_even(x: uint) { log x; }
+fn print_even(x: uint) : even(x) { log x; }
 
 fn foo(x: uint) { if check even(x) { print_even(x); } else { fail; } }
 
index 81cb300d22a5e9517bdc3c14311d76d01c0b98d3..0137bf912af8505fd9f147fbaf38fb2780e1bdfa 100644 (file)
@@ -1,4 +1,4 @@
 // xfail-stage0
-fn foo() { if ret { } }
+fn foo() { if (ret) { } }
 
 fn main() { foo(); }
\ No newline at end of file
index 8f8770c11b0608f337d466577d7c79e989aad70d..43a1701f39e292ca41014dc4341bf0554f825643 100644 (file)
@@ -83,7 +83,7 @@ fn f() { }
         #[attr = "val"]
         mod mod1 {
         }
-        
+
         #[attr = "val"]
         native "rust" mod rustrt {
         }
@@ -115,7 +115,7 @@ fn f() { }
         #[attr2 = "val"]
         mod mod1 {
         }
-        
+
         #[attr1 = "val"]
         #[attr2 = "val"]
         native "rust" mod rustrt {
index 13cc026b2ca99c1796b067ccccdc7199901262f8..0cd21a830eb2e877dada3183e3d7b7c62aefb9b8 100644 (file)
@@ -1,11 +1,7 @@
 // xfail-stage0
 
 fn main() {
-    #macro([#mylambda(x, body),
-            {
-                fn f(x: int) -> int { ret body }
-                f
-            }]);
+  #macro([#mylambda(x,body), {fn f(x: int) -> int { ret body }; f}]);
 
-    assert (#mylambda(y, y * 2)(8) == 16);
+  assert(#mylambda(y,y*2)(8) == 16);
 }
\ No newline at end of file
index 25098f3aac19e6a980951d6137cd4e543ef3dc46..c14d89430830013d0b425f34ffaebc09af109a64 100644 (file)
@@ -1,7 +1,7 @@
 // xfail-stage0
 
 fn main() {
-    #macro([#trivial, 1 * 2 * 4 * 2 * 1]);
+  #macro([#trivial(), 1*2*4*2*1]);
 
-    assert (#trivial == 16);
-}
\ No newline at end of file
+  assert(#trivial() == 16);
+}
index 688723bab0f6607e3889da717375d1c11654106a..f82e37deea22a109eadd35fa431c3d70b201b8f5 100644 (file)
@@ -1,3 +1,6 @@
 // xfail-stage0
 
-fn main() { #macro([#m1(a), a * 4]); assert (#m1(2) == 8); }
\ No newline at end of file
+fn main() {
+  #macro([#m1(a), a*4]);
+  assert (#m1(2) == 8);
+}
index 9213799f82b6d1fe85a9e041e2364a99a5b57598..6affa165aeab61ff118c963ebfdbe1d55b6b56de 100644 (file)
@@ -1,6 +1,25 @@
-./src/test/run-pass/many.rs:21:12:21:14: \e[1;31merror:\e[0m expecting ;, found |>
-./src/test/run-pass/many.rs:21   let int p |> y;
-                                           ^~
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0x8da604c root task failed
+// xfail-stage0
+// xfail-stage1
+// xfail-stage2
+// xfail-stage3
+// -*- rust -*-
+
+fn sub(chan[int] parent, int id) {
+  if (id == 0) {
+    parent <| 0;
+  } else {
+    let port[int] p = port();
+    auto child = spawn sub(chan(p), id-1);
+    let int y; p |> y;
+    parent <| y + 1;
+  }
+}
+
+fn main() {
+  let port[int] p = port();
+  auto child = spawn sub(chan(p), 500);
+  let int p |> y;
+  log "transmission complete";
+  log y;
+  assert (y == 500);
+}
index 92ede8d8dd0a8f094d4d5afbe138ee4b4783d489..cf8153c0fe47cfadff63f4b6feb3c0efacd75a22 100644 (file)
@@ -1,2 +1,2 @@
 // xfail-stage0
-fn main() { let x = (); alt x { () { } } }
\ No newline at end of file
+fn main() { let x = (); alt x { (()) { } } }
\ No newline at end of file
index 5c7106b28ebe9bf1caa7430902b220a777effc4d..24711da7c0b79921a86d9e4dbde1319853198c81 100644 (file)
@@ -1,6 +1,13 @@
-./src/test/run-pass/spawn-module-qualified.rs:7:7:7:8: \e[1;31merror:\e[0m expected ';' or '}' after expression but found x
-./src/test/run-pass/spawn-module-qualified.rs:7   join x;
-                                                       ^
-rt: ---
-rt: 0bb1:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: 0bb1:main:                        domain main @0xa98404c root task failed
+// xfail-stage0
+// xfail-stage1
+// xfail-stage2
+// xfail-stage3
+fn main() {
+  auto x = spawn m::child(10);
+  join x;
+}
+mod m {
+  fn child(int i) {
+    log i;
+  }
+}
index d495f7e9f901a188e68537d9616add99ab51b4e9..59ef847cced077031a1f847e21bc8bd3c4d87ed3 100644 (file)
@@ -1,6 +1,8 @@
-./src/test/run-pass/syntax-extension-shell.rs:6:18:6:19: \e[1;31merror:\e[0m expecting (, found {
-./src/test/run-pass/syntax-extension-shell.rs:6   auto s = #shell { uname -a };
-                                                                  ^
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0x910c04c root task failed
+// xfail-stage0
+// xfail-stage1
+// xfail-stage2
+// xfail-stage3
+fn main() {
+  auto s = #shell { uname -a };
+  log s;
+}
index e12526a89e6267724ff07b5b6b77dd655061f752..bad47e2aed92bacbf5cf7f5b2a03a72da5f14e64 100644 (file)
@@ -1,6 +1,41 @@
-./src/test/run-pass/task-killjoin.rs:22:36:22:46: \e[1;31merror:\e[0m expecting (, found supervised
-./src/test/run-pass/task-killjoin.rs:22     let task t = spawn "supervised" supervised();
-                                                                            ^~~~~~~~~~
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0xa7b604c root task failed
+// xfail-stage0
+// xfail-stage1
+// xfail-stage2
+// xfail-stage3
+
+// Create a task that is supervised by another task,
+// join the supervised task from the supervising task,
+// then fail the supervised task. The supervised task
+// will kill the supervising task, waking it up. The
+// supervising task no longer needs to be wakened when
+// the supervised task exits.
+
+fn supervised() {
+    // Yield to make sure the supervisor joins before we
+    // fail. This is currently not needed because the supervisor
+    // runs first, but I can imagine that changing.
+    yield;
+    fail;
+}
+
+fn supervisor() {
+    let task t = spawn "supervised" supervised();
+    join t;
+}
+
+fn main() {
+    // Start the test in another domain so that
+    // the process doesn't return a failure status as a result
+    // of the main task being killed.
+    let task dom2 = spawn thread "supervisor" supervisor();
+    join dom2;
+}
+
+// Local Variables:
+// mode: rust;
+// fill-column: 78;
+// indent-tabs-mode: nil
+// c-basic-offset: 4
+// buffer-file-coding-system: utf-8-unix
+// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
+// End:
index 82ba2ded69ee9379fda24a8590721f4476ad79ea..885b0e87e472f090a111d670ec1fb6333876fc0a 100644 (file)
@@ -1,6 +1,20 @@
-./src/test/run-pass/threads.rs:11:17:11:24: \e[1;31merror:\e[0m expecting (, found "child"
-./src/test/run-pass/threads.rs:11     spawn thread "child" child(i);
-                                                   ^~~~~~~
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0x999804c root task failed
+// xfail-stage0
+// xfail-stage1
+// xfail-stage2
+// xfail-stage3
+
+// -*- rust -*-
+
+fn main() {
+  let int i = 10;
+  while (i > 0) {
+    spawn thread "child" child(i);
+    i = i - 1;
+  }
+  log "main thread exiting";
+}
+
+fn child(int x) {
+  log x;
+}
+
index acc9f0c28c241cf51cfdb832c1407dea2710e599..f2eda37e0d00a3243e1924c710c1537723b30968 100644 (file)
@@ -1,7 +1,7 @@
 pred p(i: int) -> bool { true }
 
-fn f(i: int) -> int { i }
+fn f(i: int) : p(i) -> int { i }
 
-fn g(i: int) -> int { f(i) }
+fn g(i: int) : p(i) -> int { f(i) }
 
 fn main() { }
\ No newline at end of file
index 1af1995720bc0d547beef84f2512664d02323125..02d184e25cad4ea78fe80756917fcb42fbabe129 100644 (file)
@@ -1,6 +1,18 @@
-./src/test/run-pass/user.rs:9:16:9:17: \e[1;31merror:\e[0m unexpected token: _
-./src/test/run-pass/user.rs:9          uuid = _, ver = _);
-                                              ^
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0x907604c root task failed
+// xfail-stage0
+// xfail-stage1
+// xfail-stage2
+// xfail-stage3
+// -*- rust -*-
+
+use std (name = "std",
+         url = "http://rust-lang.org/src/std",
+         uuid = _, ver = _);
+
+fn main() {
+  auto s = std::str.alloc(10 as uint);
+  s += "hello ";
+  log s;
+  s += "there";
+  log s;
+  auto z = std::vec.alloc[int](10 as uint);
+}
index 5c572a0f54750a84be85cdabd0c2c4c7d4414791..9434eed3847eb45e870655b63df5caf81f264511 100644 (file)
@@ -1,6 +1,10 @@
-./src/test/run-pass/vec-slice.rs:7:16:7:17: \e[1;31merror:\e[0m expecting ), found ,
-./src/test/run-pass/vec-slice.rs:7   auto v2 = v.(1,2);
-                                                   ^
-rt: ---
-rt: f00e:main:main:                   upcall fail 'explicit failure', src/comp/syntax/parse/parser.rs:112
-rt: f00e:main:                        domain main @0xa73404c root task failed
+// xfail-stage0
+// xfail-stage1
+// xfail-stage2
+// xfail-stage3
+fn main() {
+  let vec[int] v = [1,2,3,4,5];
+  auto v2 = v.(1,2);
+  assert (v2.(0) == 2);
+  assert (v2.(1) == 3);
+}
\ No newline at end of file
index d43d4b7b6039e601c515e20d7972329cf1259aa7..2b4da0cdf6bb628c021773b82c9361f09afb51bc 100644 (file)
@@ -178,7 +178,7 @@ fn reccyeq(a: &reccy, b: &reccy) -> bool {
                               two(17, 42));
     /*
      * FIXME: Segfault.  Also appears to be caused only after upcall_grow_task
-    
+
     log "*** test parameterized: taggypar[int]";
     let eqfn[taggypar[int]] eq4 = taggypareq[int];
     test_parameterized[taggypar[int]](eq4,
@@ -187,7 +187,7 @@ fn reccyeq(a: &reccy, b: &reccy) -> bool {
                                       threepar[int](1, 2, 3),
                                       twopar[int](17, 42));
     log "*** end test parameterized: taggypar[int]";
-    
+
      */
 
     log "*** test parameterized: reccy";
index 44edb3f9111dfcc4570d7be57e52ee349ec16d2f..0031f338f1f6b677cf1b388881aabdfa95ad5e25 100644 (file)
@@ -197,7 +197,7 @@ fn hash(u: &uint) -> uint {
         /**
          * FIXME (issue #150): we want to check the removed value as in the
          * following:
-        
+
         let util.option[uint] v = hm.remove(i);
         alt (v) {
           case (util.some[uint](u)) {
@@ -205,7 +205,7 @@ fn hash(u: &uint) -> uint {
           }
           case (util.none[uint]()) { fail; }
         }
-        
+
          * but we util.option is a tag type so util.some and util.none are
          * off limits until we parse the dwarf for tag types.
          */