Skip to content

Commit c796a8f

Browse files
committed
Re-enable tidy (it was broken) and fix various non-tidy things.
1 parent 1906440 commit c796a8f

17 files changed

+51
-39
lines changed

Makefile.in

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,11 @@ ifneq ($(findstring reformat,$(MAKECMDGOALS)),)
265265
include $(CFG_SRC_DIR)/mk/pp.mk
266266
endif
267267

268-
ifneq ($(findstring check,$(MAKECMDGOALS)),)
268+
ifneq ($(findstring check,$(MAKECMDGOALS))\
269+
$(findstring test,$(MAKECMDGOALS))\
270+
$(findstring tidy,$(MAKECMDGOALS)),)
271+
include $(CFG_SRC_DIR)/mk/dist.mk
269272
include $(CFG_SRC_DIR)/mk/tests.mk
270-
else
271-
ifneq ($(findstring test,$(MAKECMDGOALS)),)
272-
include $(CFG_SRC_DIR)/mk/tests.mk
273-
endif
274273
endif
275274

276275
ifneq ($(findstring clean,$(MAKECMDGOALS)),)

src/comp/back/link.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ fn truncated_sha1_result(sha1 sha) -> str {
375375

376376

377377
// This calculates STH for a symbol, as defined above
378-
fn symbol_hash(ty::ctxt tcx, sha1 sha, &ty::t t, &link_meta link_meta) -> str {
378+
fn symbol_hash(ty::ctxt tcx, sha1 sha, &ty::t t,
379+
&link_meta link_meta) -> str {
379380
// NB: do *not* use abbrevs here as we want the symbol names
380381
// to be independent of one another in the crate.
381382

src/comp/metadata/encoder.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ fn encode_type(&@crate_ctxt cx, &ebml::writer ebml_w, &ty::t typ) {
180180
ebml::start_tag(ebml_w, tag_items_data_item_type);
181181
auto f = def_to_str;
182182
auto ty_str_ctxt =
183-
@rec(ds=f, tcx=cx.tcx, abbrevs=tyencode::ac_use_abbrevs(cx.type_abbrevs));
183+
@rec(ds=f, tcx=cx.tcx,
184+
abbrevs=tyencode::ac_use_abbrevs(cx.type_abbrevs));
184185
tyencode::enc_ty(io::new_writer_(ebml_w.writer), ty_str_ctxt, typ);
185186
ebml::end_tag(ebml_w);
186187
}
@@ -346,7 +347,8 @@ fn encode_info_for_items(&@crate_ctxt cx, &ebml::writer ebml_w) ->
346347
vec[tup(int, uint)] {
347348
let vec[tup(int, uint)] index = [];
348349
ebml::start_tag(ebml_w, tag_items_data);
349-
for each (@tup(node_id, middle::ast_map::ast_node) kvp in cx.ast_map.items()) {
350+
for each (@tup(node_id, middle::ast_map::ast_node) kvp in
351+
cx.ast_map.items()) {
350352
alt (kvp._1) {
351353
case (middle::ast_map::node_item(?i)) {
352354
index += [tup(kvp._0, ebml_w.writer.tell())];
@@ -458,10 +460,10 @@ fn encode_attributes(&ebml::writer ebml_w, &vec[attribute] attrs) {
458460
ebml::end_tag(ebml_w);
459461
}
460462

461-
// So there's a special crate attribute called 'link' which defines the metadata
462-
// that Rust cares about for linking crates. This attribute requires name and
463-
// value attributes, so if the user didn't provide them we will throw them in
464-
// anyway with default values.
463+
// So there's a special crate attribute called 'link' which defines the
464+
// metadata that Rust cares about for linking crates. This attribute requires
465+
// name and value attributes, so if the user didn't provide them we will throw
466+
// them in anyway with default values.
465467
fn synthesize_crate_attrs(&@crate_ctxt cx,
466468
&@crate crate) -> vec[attribute] {
467469

src/comp/middle/tstate/states.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ fn find_pre_post_state_stmt(&fn_ctxt fcx, &prestate pres, @stmt s) -> bool {
631631
// let int = x; => x is uninit in poststate
632632
set_poststate_ann(fcx.ccx, id, pres);
633633
clear_in_poststate_ident(fcx, alocal.node.id,
634-
alocal.node.ident, id);
634+
alocal.node.ident, id);
635635
set_prestate(stmt_ann, pres);
636636
ret false;
637637
}

src/comp/middle/ty.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,8 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
15281528
auto len = vec::len[mt](mts_a);
15291529
if (len != vec::len[mt](mts_b)) { ret false; }
15301530
auto i = 0u;
1531-
while (i < len) { if (!equal_mt(mts_a.(i), mts_b.(i))) { ret false; }
1531+
while (i < len) {
1532+
if (!equal_mt(mts_a.(i), mts_b.(i))) { ret false; }
15321533
i += 1u;
15331534
}
15341535
ret true;

src/comp/middle/visit.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ fn visit_item[E](&@item i, &E e, &vt[E] v) {
134134
alt (ob.dtor) {
135135
case (none) { }
136136
case (some(?m)) {
137-
vt(v).visit_fn(m.node.meth, [], m.span, some(m.node.ident),
137+
vt(v).visit_fn(m.node.meth, [], m.span,
138+
some(m.node.ident),
138139
m.node.id, e, v);
139140
}
140141
}

src/rt/circular_buffer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ void
154154
circular_buffer::shrink() {
155155
size_t new_buffer_sz = _buffer_sz / 2;
156156
I(sched, initial_size() <= new_buffer_sz);
157-
DLOG(sched, mem, "circular_buffer is shrinking to %d bytes", new_buffer_sz);
157+
DLOG(sched, mem, "circular_buffer is shrinking to %d bytes",
158+
new_buffer_sz);
158159
void *new_buffer = task->malloc(new_buffer_sz);
159160
transfer(new_buffer);
160161
task->free(_buffer);

src/rt/rust_builtin.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ last_os_error(rust_task *task) {
4747
task->fail(1);
4848
return NULL;
4949
}
50-
rust_str *st = new (mem) rust_str(sched, alloc, fill, (const uint8_t *)buf);
50+
rust_str *st = new (mem) rust_str(sched, alloc, fill,
51+
(const uint8_t *)buf);
5152

5253
#ifdef __WIN32__
5354
LocalFree((HLOCAL)buf);

src/rt/rust_chan.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ bool rust_chan::is_associated() {
4949
* Unlink this channel from its associated port.
5050
*/
5151
void rust_chan::disassociate() {
52-
A(task->sched, is_associated(), "Channel must be associated with a port.");
52+
A(task->sched, is_associated(),
53+
"Channel must be associated with a port.");
5354

5455
if (port->is_proxy() == false) {
5556
LOG(task, task,

src/rt/rust_kernel.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ rust_kernel::internal_get_sched_handle(rust_scheduler *sched) {
5252
rust_handle<rust_scheduler> *handle = NULL;
5353
if (_sched_handles.get(sched, &handle) == false) {
5454
handle =
55-
new (this) rust_handle<rust_scheduler>(this, sched->message_queue, sched);
55+
new (this) rust_handle<rust_scheduler>(this,
56+
sched->message_queue,
57+
sched);
5658
_sched_handles.put(sched, handle);
5759
}
5860
return handle;
@@ -72,7 +74,8 @@ rust_kernel::get_task_handle(rust_task *task) {
7274
rust_handle<rust_task> *handle = NULL;
7375
if (_task_handles.get(task, &handle) == false) {
7476
handle =
75-
new (this) rust_handle<rust_task>(this, task->sched->message_queue,
77+
new (this) rust_handle<rust_task>(this,
78+
task->sched->message_queue,
7679
task);
7780
_task_handles.put(task, handle);
7881
}
@@ -85,10 +88,10 @@ rust_kernel::get_port_handle(rust_port *port) {
8588
_kernel_lock.lock();
8689
rust_handle<rust_port> *handle = NULL;
8790
if (_port_handles.get(port, &handle) == false) {
88-
handle =
89-
new (this) rust_handle<rust_port>(this,
90-
port->task->sched->message_queue,
91-
port);
91+
handle = new (this)
92+
rust_handle<rust_port>(this,
93+
port->task->sched->message_queue,
94+
port);
9295
_port_handles.put(port, handle);
9396
}
9497
_kernel_lock.unlock();

src/rt/rust_scheduler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ rust_crate_cache
2626
void flush();
2727
};
2828

29-
struct rust_scheduler : public kernel_owned<rust_scheduler>, rc_base<rust_scheduler>
29+
struct rust_scheduler : public kernel_owned<rust_scheduler>,
30+
rc_base<rust_scheduler>
3031
{
3132
// Fields known to the compiler:
3233
uintptr_t interrupt_flag;

src/rt/rust_upcall.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ rust_str *make_str(rust_task *task, char const *s, size_t fill) {
339339
task->fail(3);
340340
return NULL;
341341
}
342-
rust_str *st = new (mem) rust_str(sched, alloc, fill, (uint8_t const *) s);
342+
rust_str *st = new (mem) rust_str(sched, alloc, fill,
343+
(uint8_t const *) s);
343344
LOG(task, mem,
344345
"upcall new_str('%s', %" PRIdPTR ") = 0x%" PRIxPTR,
345346
s, fill, st);

src/test/compile-fail/do-while-constraints.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ fn main() {
88
log y;
99
do {
1010
do {
11-
do {
12-
x <- y;
13-
} while (true);
11+
do {
12+
x <- y;
13+
} while (true);
1414
} while (true);
1515
} while (true);
1616
} while (true);

src/test/compile-fail/do-while-pred-constraints.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ fn main() {
1717
print_even(y);
1818
do {
1919
do {
20-
do {
21-
y += 1;
22-
} while (true);
20+
do {
21+
y += 1;
22+
} while (true);
2323
} while (true);
2424
} while (true);
2525
} while (true);

src/test/compile-fail/use-meta.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// error-pattern:can't find crate for 'std'
22

33
use std (name = "std",
4-
vers = "bogus");
4+
vers = "bogus");

src/test/compile-fail/while-loop-constraints.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ fn main() {
88
log y;
99
while (true) {
1010
while (true) {
11-
while (true) {
12-
x <- y;
13-
}
11+
while (true) {
12+
x <- y;
13+
}
1414
}
1515
}
1616
}

src/test/compile-fail/while-loop-pred-constraints.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ fn main() {
1818
print_even(y);
1919
while (true) {
2020
while (true) {
21-
while (true) {
22-
y += x;
23-
}
21+
while (true) {
22+
y += x;
23+
}
2424
}
2525
}
2626
}

0 commit comments

Comments
 (0)