From c796a8f24dfa94a1614da70fbf25b63d3709a116 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 29 Jun 2011 15:11:20 -0700 Subject: [PATCH] Re-enable tidy (it was broken) and fix various non-tidy things. --- Makefile.in | 9 ++++----- src/comp/back/link.rs | 3 ++- src/comp/metadata/encoder.rs | 14 ++++++++------ src/comp/middle/tstate/states.rs | 2 +- src/comp/middle/ty.rs | 3 ++- src/comp/middle/visit.rs | 3 ++- src/rt/circular_buffer.cpp | 3 ++- src/rt/rust_builtin.cpp | 3 ++- src/rt/rust_chan.cpp | 3 ++- src/rt/rust_kernel.cpp | 15 +++++++++------ src/rt/rust_scheduler.h | 3 ++- src/rt/rust_upcall.cpp | 3 ++- src/test/compile-fail/do-while-constraints.rs | 6 +++--- .../compile-fail/do-while-pred-constraints.rs | 6 +++--- src/test/compile-fail/use-meta.rc | 2 +- src/test/compile-fail/while-loop-constraints.rs | 6 +++--- .../compile-fail/while-loop-pred-constraints.rs | 6 +++--- 17 files changed, 51 insertions(+), 39 deletions(-) diff --git a/Makefile.in b/Makefile.in index a6dcd003d36..35040ae6b19 100644 --- a/Makefile.in +++ b/Makefile.in @@ -265,12 +265,11 @@ ifneq ($(findstring reformat,$(MAKECMDGOALS)),) include $(CFG_SRC_DIR)/mk/pp.mk endif -ifneq ($(findstring check,$(MAKECMDGOALS)),) +ifneq ($(findstring check,$(MAKECMDGOALS))\ + $(findstring test,$(MAKECMDGOALS))\ + $(findstring tidy,$(MAKECMDGOALS)),) + include $(CFG_SRC_DIR)/mk/dist.mk include $(CFG_SRC_DIR)/mk/tests.mk -else - ifneq ($(findstring test,$(MAKECMDGOALS)),) - include $(CFG_SRC_DIR)/mk/tests.mk - endif endif ifneq ($(findstring clean,$(MAKECMDGOALS)),) diff --git a/src/comp/back/link.rs b/src/comp/back/link.rs index 24f5140d8a0..c89e6f808a8 100644 --- a/src/comp/back/link.rs +++ b/src/comp/back/link.rs @@ -375,7 +375,8 @@ fn truncated_sha1_result(sha1 sha) -> str { // This calculates STH for a symbol, as defined above -fn symbol_hash(ty::ctxt tcx, sha1 sha, &ty::t t, &link_meta link_meta) -> str { +fn symbol_hash(ty::ctxt tcx, sha1 sha, &ty::t t, + &link_meta link_meta) -> str { // NB: do *not* use abbrevs here as we want the symbol names // to be independent of one another in the crate. diff --git a/src/comp/metadata/encoder.rs b/src/comp/metadata/encoder.rs index 2927e77d4b1..205ac5649df 100644 --- a/src/comp/metadata/encoder.rs +++ b/src/comp/metadata/encoder.rs @@ -180,7 +180,8 @@ fn encode_type(&@crate_ctxt cx, &ebml::writer ebml_w, &ty::t typ) { ebml::start_tag(ebml_w, tag_items_data_item_type); auto f = def_to_str; auto ty_str_ctxt = - @rec(ds=f, tcx=cx.tcx, abbrevs=tyencode::ac_use_abbrevs(cx.type_abbrevs)); + @rec(ds=f, tcx=cx.tcx, + abbrevs=tyencode::ac_use_abbrevs(cx.type_abbrevs)); tyencode::enc_ty(io::new_writer_(ebml_w.writer), ty_str_ctxt, typ); ebml::end_tag(ebml_w); } @@ -346,7 +347,8 @@ fn encode_info_for_items(&@crate_ctxt cx, &ebml::writer ebml_w) -> vec[tup(int, uint)] { let vec[tup(int, uint)] index = []; ebml::start_tag(ebml_w, tag_items_data); - for each (@tup(node_id, middle::ast_map::ast_node) kvp in cx.ast_map.items()) { + for each (@tup(node_id, middle::ast_map::ast_node) kvp in + cx.ast_map.items()) { alt (kvp._1) { case (middle::ast_map::node_item(?i)) { index += [tup(kvp._0, ebml_w.writer.tell())]; @@ -458,10 +460,10 @@ fn encode_attributes(&ebml::writer ebml_w, &vec[attribute] attrs) { ebml::end_tag(ebml_w); } -// So there's a special crate attribute called 'link' which defines the metadata -// that Rust cares about for linking crates. This attribute requires name and -// value attributes, so if the user didn't provide them we will throw them in -// anyway with default values. +// So there's a special crate attribute called 'link' which defines the +// metadata that Rust cares about for linking crates. This attribute requires +// name and value attributes, so if the user didn't provide them we will throw +// them in anyway with default values. fn synthesize_crate_attrs(&@crate_ctxt cx, &@crate crate) -> vec[attribute] { diff --git a/src/comp/middle/tstate/states.rs b/src/comp/middle/tstate/states.rs index 2d81f0cf0aa..44a9240fd5b 100644 --- a/src/comp/middle/tstate/states.rs +++ b/src/comp/middle/tstate/states.rs @@ -631,7 +631,7 @@ fn find_pre_post_state_stmt(&fn_ctxt fcx, &prestate pres, @stmt s) -> bool { // let int = x; => x is uninit in poststate set_poststate_ann(fcx.ccx, id, pres); clear_in_poststate_ident(fcx, alocal.node.id, - alocal.node.ident, id); + alocal.node.ident, id); set_prestate(stmt_ann, pres); ret false; } diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index 5bf0c281f67..f669970898e 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -1528,7 +1528,8 @@ fn equal_type_structures(&sty a, &sty b) -> bool { auto len = vec::len[mt](mts_a); if (len != vec::len[mt](mts_b)) { ret false; } auto i = 0u; - while (i < len) { if (!equal_mt(mts_a.(i), mts_b.(i))) { ret false; } + while (i < len) { + if (!equal_mt(mts_a.(i), mts_b.(i))) { ret false; } i += 1u; } ret true; diff --git a/src/comp/middle/visit.rs b/src/comp/middle/visit.rs index b6a96453d1b..2b84747046e 100644 --- a/src/comp/middle/visit.rs +++ b/src/comp/middle/visit.rs @@ -134,7 +134,8 @@ fn visit_item[E](&@item i, &E e, &vt[E] v) { alt (ob.dtor) { case (none) { } case (some(?m)) { - vt(v).visit_fn(m.node.meth, [], m.span, some(m.node.ident), + vt(v).visit_fn(m.node.meth, [], m.span, + some(m.node.ident), m.node.id, e, v); } } diff --git a/src/rt/circular_buffer.cpp b/src/rt/circular_buffer.cpp index 8c0067ff002..191ec7c5756 100644 --- a/src/rt/circular_buffer.cpp +++ b/src/rt/circular_buffer.cpp @@ -154,7 +154,8 @@ void circular_buffer::shrink() { size_t new_buffer_sz = _buffer_sz / 2; I(sched, initial_size() <= new_buffer_sz); - DLOG(sched, mem, "circular_buffer is shrinking to %d bytes", new_buffer_sz); + DLOG(sched, mem, "circular_buffer is shrinking to %d bytes", + new_buffer_sz); void *new_buffer = task->malloc(new_buffer_sz); transfer(new_buffer); task->free(_buffer); diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index a7325bc066d..cdf20a40adc 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -47,7 +47,8 @@ last_os_error(rust_task *task) { task->fail(1); return NULL; } - rust_str *st = new (mem) rust_str(sched, alloc, fill, (const uint8_t *)buf); + rust_str *st = new (mem) rust_str(sched, alloc, fill, + (const uint8_t *)buf); #ifdef __WIN32__ LocalFree((HLOCAL)buf); diff --git a/src/rt/rust_chan.cpp b/src/rt/rust_chan.cpp index 778fb6b16fd..a947a1c93e8 100644 --- a/src/rt/rust_chan.cpp +++ b/src/rt/rust_chan.cpp @@ -49,7 +49,8 @@ bool rust_chan::is_associated() { * Unlink this channel from its associated port. */ void rust_chan::disassociate() { - A(task->sched, is_associated(), "Channel must be associated with a port."); + A(task->sched, is_associated(), + "Channel must be associated with a port."); if (port->is_proxy() == false) { LOG(task, task, diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp index f3ebfd4f4b9..8a75e1adcbc 100644 --- a/src/rt/rust_kernel.cpp +++ b/src/rt/rust_kernel.cpp @@ -52,7 +52,9 @@ rust_kernel::internal_get_sched_handle(rust_scheduler *sched) { rust_handle *handle = NULL; if (_sched_handles.get(sched, &handle) == false) { handle = - new (this) rust_handle(this, sched->message_queue, sched); + new (this) rust_handle(this, + sched->message_queue, + sched); _sched_handles.put(sched, handle); } return handle; @@ -72,7 +74,8 @@ rust_kernel::get_task_handle(rust_task *task) { rust_handle *handle = NULL; if (_task_handles.get(task, &handle) == false) { handle = - new (this) rust_handle(this, task->sched->message_queue, + new (this) rust_handle(this, + task->sched->message_queue, task); _task_handles.put(task, handle); } @@ -85,10 +88,10 @@ rust_kernel::get_port_handle(rust_port *port) { _kernel_lock.lock(); rust_handle *handle = NULL; if (_port_handles.get(port, &handle) == false) { - handle = - new (this) rust_handle(this, - port->task->sched->message_queue, - port); + handle = new (this) + rust_handle(this, + port->task->sched->message_queue, + port); _port_handles.put(port, handle); } _kernel_lock.unlock(); diff --git a/src/rt/rust_scheduler.h b/src/rt/rust_scheduler.h index d3e2df224c7..841b8ec454a 100644 --- a/src/rt/rust_scheduler.h +++ b/src/rt/rust_scheduler.h @@ -26,7 +26,8 @@ public: void flush(); }; -struct rust_scheduler : public kernel_owned, rc_base +struct rust_scheduler : public kernel_owned, + rc_base { // Fields known to the compiler: uintptr_t interrupt_flag; diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 5a556a8e12b..d16691ee7ca 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -339,7 +339,8 @@ rust_str *make_str(rust_task *task, char const *s, size_t fill) { task->fail(3); return NULL; } - rust_str *st = new (mem) rust_str(sched, alloc, fill, (uint8_t const *) s); + rust_str *st = new (mem) rust_str(sched, alloc, fill, + (uint8_t const *) s); LOG(task, mem, "upcall new_str('%s', %" PRIdPTR ") = 0x%" PRIxPTR, s, fill, st); diff --git a/src/test/compile-fail/do-while-constraints.rs b/src/test/compile-fail/do-while-constraints.rs index c9c557320a0..fe9349914c2 100644 --- a/src/test/compile-fail/do-while-constraints.rs +++ b/src/test/compile-fail/do-while-constraints.rs @@ -8,9 +8,9 @@ fn main() { log y; do { do { - do { - x <- y; - } while (true); + do { + x <- y; + } while (true); } while (true); } while (true); } while (true); diff --git a/src/test/compile-fail/do-while-pred-constraints.rs b/src/test/compile-fail/do-while-pred-constraints.rs index 77b1558efb2..119b2632203 100644 --- a/src/test/compile-fail/do-while-pred-constraints.rs +++ b/src/test/compile-fail/do-while-pred-constraints.rs @@ -17,9 +17,9 @@ fn main() { print_even(y); do { do { - do { - y += 1; - } while (true); + do { + y += 1; + } while (true); } while (true); } while (true); } while (true); diff --git a/src/test/compile-fail/use-meta.rc b/src/test/compile-fail/use-meta.rc index a7855205991..cd88ac1e0cd 100644 --- a/src/test/compile-fail/use-meta.rc +++ b/src/test/compile-fail/use-meta.rc @@ -1,4 +1,4 @@ // error-pattern:can't find crate for 'std' use std (name = "std", - vers = "bogus"); \ No newline at end of file + vers = "bogus"); \ No newline at end of file diff --git a/src/test/compile-fail/while-loop-constraints.rs b/src/test/compile-fail/while-loop-constraints.rs index 981a555ff30..4c97aae7042 100644 --- a/src/test/compile-fail/while-loop-constraints.rs +++ b/src/test/compile-fail/while-loop-constraints.rs @@ -8,9 +8,9 @@ fn main() { log y; while (true) { while (true) { - while (true) { - x <- y; - } + while (true) { + x <- y; + } } } } diff --git a/src/test/compile-fail/while-loop-pred-constraints.rs b/src/test/compile-fail/while-loop-pred-constraints.rs index 2304de6290b..3908004b688 100644 --- a/src/test/compile-fail/while-loop-pred-constraints.rs +++ b/src/test/compile-fail/while-loop-pred-constraints.rs @@ -18,9 +18,9 @@ fn main() { print_even(y); while (true) { while (true) { - while (true) { - y += x; - } + while (true) { + y += x; + } } } }