mirror of https://github.com/rust-lang/rust.git
Re-enable tidy (it was broken) and fix various non-tidy things.
This commit is contained in:
parent
190644063e
commit
c796a8f24d
|
@ -265,12 +265,11 @@ ifneq ($(findstring reformat,$(MAKECMDGOALS)),)
|
||||||
include $(CFG_SRC_DIR)/mk/pp.mk
|
include $(CFG_SRC_DIR)/mk/pp.mk
|
||||||
endif
|
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
|
include $(CFG_SRC_DIR)/mk/tests.mk
|
||||||
else
|
|
||||||
ifneq ($(findstring test,$(MAKECMDGOALS)),)
|
|
||||||
include $(CFG_SRC_DIR)/mk/tests.mk
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring clean,$(MAKECMDGOALS)),)
|
ifneq ($(findstring clean,$(MAKECMDGOALS)),)
|
||||||
|
|
|
@ -375,7 +375,8 @@ fn truncated_sha1_result(sha1 sha) -> str {
|
||||||
|
|
||||||
|
|
||||||
// This calculates STH for a symbol, as defined above
|
// 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
|
// NB: do *not* use abbrevs here as we want the symbol names
|
||||||
// to be independent of one another in the crate.
|
// to be independent of one another in the crate.
|
||||||
|
|
||||||
|
|
|
@ -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);
|
ebml::start_tag(ebml_w, tag_items_data_item_type);
|
||||||
auto f = def_to_str;
|
auto f = def_to_str;
|
||||||
auto ty_str_ctxt =
|
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);
|
tyencode::enc_ty(io::new_writer_(ebml_w.writer), ty_str_ctxt, typ);
|
||||||
ebml::end_tag(ebml_w);
|
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)] {
|
vec[tup(int, uint)] {
|
||||||
let vec[tup(int, uint)] index = [];
|
let vec[tup(int, uint)] index = [];
|
||||||
ebml::start_tag(ebml_w, tag_items_data);
|
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) {
|
alt (kvp._1) {
|
||||||
case (middle::ast_map::node_item(?i)) {
|
case (middle::ast_map::node_item(?i)) {
|
||||||
index += [tup(kvp._0, ebml_w.writer.tell())];
|
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);
|
ebml::end_tag(ebml_w);
|
||||||
}
|
}
|
||||||
|
|
||||||
// So there's a special crate attribute called 'link' which defines the metadata
|
// So there's a special crate attribute called 'link' which defines the
|
||||||
// that Rust cares about for linking crates. This attribute requires name and
|
// metadata that Rust cares about for linking crates. This attribute requires
|
||||||
// value attributes, so if the user didn't provide them we will throw them in
|
// name and value attributes, so if the user didn't provide them we will throw
|
||||||
// anyway with default values.
|
// them in anyway with default values.
|
||||||
fn synthesize_crate_attrs(&@crate_ctxt cx,
|
fn synthesize_crate_attrs(&@crate_ctxt cx,
|
||||||
&@crate crate) -> vec[attribute] {
|
&@crate crate) -> vec[attribute] {
|
||||||
|
|
||||||
|
|
|
@ -1528,7 +1528,8 @@ fn equal_type_structures(&sty a, &sty b) -> bool {
|
||||||
auto len = vec::len[mt](mts_a);
|
auto len = vec::len[mt](mts_a);
|
||||||
if (len != vec::len[mt](mts_b)) { ret false; }
|
if (len != vec::len[mt](mts_b)) { ret false; }
|
||||||
auto i = 0u;
|
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;
|
i += 1u;
|
||||||
}
|
}
|
||||||
ret true;
|
ret true;
|
||||||
|
|
|
@ -134,7 +134,8 @@ fn visit_item[E](&@item i, &E e, &vt[E] v) {
|
||||||
alt (ob.dtor) {
|
alt (ob.dtor) {
|
||||||
case (none) { }
|
case (none) { }
|
||||||
case (some(?m)) {
|
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);
|
m.node.id, e, v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,8 @@ void
|
||||||
circular_buffer::shrink() {
|
circular_buffer::shrink() {
|
||||||
size_t new_buffer_sz = _buffer_sz / 2;
|
size_t new_buffer_sz = _buffer_sz / 2;
|
||||||
I(sched, initial_size() <= new_buffer_sz);
|
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);
|
void *new_buffer = task->malloc(new_buffer_sz);
|
||||||
transfer(new_buffer);
|
transfer(new_buffer);
|
||||||
task->free(_buffer);
|
task->free(_buffer);
|
||||||
|
|
|
@ -47,7 +47,8 @@ last_os_error(rust_task *task) {
|
||||||
task->fail(1);
|
task->fail(1);
|
||||||
return NULL;
|
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__
|
#ifdef __WIN32__
|
||||||
LocalFree((HLOCAL)buf);
|
LocalFree((HLOCAL)buf);
|
||||||
|
|
|
@ -49,7 +49,8 @@ bool rust_chan::is_associated() {
|
||||||
* Unlink this channel from its associated port.
|
* Unlink this channel from its associated port.
|
||||||
*/
|
*/
|
||||||
void rust_chan::disassociate() {
|
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) {
|
if (port->is_proxy() == false) {
|
||||||
LOG(task, task,
|
LOG(task, task,
|
||||||
|
|
|
@ -52,7 +52,9 @@ rust_kernel::internal_get_sched_handle(rust_scheduler *sched) {
|
||||||
rust_handle<rust_scheduler> *handle = NULL;
|
rust_handle<rust_scheduler> *handle = NULL;
|
||||||
if (_sched_handles.get(sched, &handle) == false) {
|
if (_sched_handles.get(sched, &handle) == false) {
|
||||||
handle =
|
handle =
|
||||||
new (this) rust_handle<rust_scheduler>(this, sched->message_queue, sched);
|
new (this) rust_handle<rust_scheduler>(this,
|
||||||
|
sched->message_queue,
|
||||||
|
sched);
|
||||||
_sched_handles.put(sched, handle);
|
_sched_handles.put(sched, handle);
|
||||||
}
|
}
|
||||||
return handle;
|
return handle;
|
||||||
|
@ -72,7 +74,8 @@ rust_kernel::get_task_handle(rust_task *task) {
|
||||||
rust_handle<rust_task> *handle = NULL;
|
rust_handle<rust_task> *handle = NULL;
|
||||||
if (_task_handles.get(task, &handle) == false) {
|
if (_task_handles.get(task, &handle) == false) {
|
||||||
handle =
|
handle =
|
||||||
new (this) rust_handle<rust_task>(this, task->sched->message_queue,
|
new (this) rust_handle<rust_task>(this,
|
||||||
|
task->sched->message_queue,
|
||||||
task);
|
task);
|
||||||
_task_handles.put(task, handle);
|
_task_handles.put(task, handle);
|
||||||
}
|
}
|
||||||
|
@ -85,8 +88,8 @@ rust_kernel::get_port_handle(rust_port *port) {
|
||||||
_kernel_lock.lock();
|
_kernel_lock.lock();
|
||||||
rust_handle<rust_port> *handle = NULL;
|
rust_handle<rust_port> *handle = NULL;
|
||||||
if (_port_handles.get(port, &handle) == false) {
|
if (_port_handles.get(port, &handle) == false) {
|
||||||
handle =
|
handle = new (this)
|
||||||
new (this) rust_handle<rust_port>(this,
|
rust_handle<rust_port>(this,
|
||||||
port->task->sched->message_queue,
|
port->task->sched->message_queue,
|
||||||
port);
|
port);
|
||||||
_port_handles.put(port, handle);
|
_port_handles.put(port, handle);
|
||||||
|
|
|
@ -26,7 +26,8 @@ public:
|
||||||
void flush();
|
void flush();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rust_scheduler : public kernel_owned<rust_scheduler>, rc_base<rust_scheduler>
|
struct rust_scheduler : public kernel_owned<rust_scheduler>,
|
||||||
|
rc_base<rust_scheduler>
|
||||||
{
|
{
|
||||||
// Fields known to the compiler:
|
// Fields known to the compiler:
|
||||||
uintptr_t interrupt_flag;
|
uintptr_t interrupt_flag;
|
||||||
|
|
|
@ -339,7 +339,8 @@ rust_str *make_str(rust_task *task, char const *s, size_t fill) {
|
||||||
task->fail(3);
|
task->fail(3);
|
||||||
return NULL;
|
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,
|
LOG(task, mem,
|
||||||
"upcall new_str('%s', %" PRIdPTR ") = 0x%" PRIxPTR,
|
"upcall new_str('%s', %" PRIdPTR ") = 0x%" PRIxPTR,
|
||||||
s, fill, st);
|
s, fill, st);
|
||||||
|
|
Loading…
Reference in New Issue