Skip to content

Commit 3e4658c

Browse files
committed
---
yaml --- r: 2760 b: refs/heads/master c: f1d3b88 h: refs/heads/master v: v3
1 parent acfd49c commit 3e4658c

File tree

12 files changed

+27
-67
lines changed

12 files changed

+27
-67
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: fe90159b86c0a044ce0bcef534e4800ea35ba01b
2+
refs/heads/master: f1d3b88f0a5eb732d45b64a57465e134d7f8c320

trunk/src/comp/middle/resolve.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,11 +323,10 @@ fn resolve_import(&env e, &@ast::view_item it, &list[scope] sc) {
323323
auto end_id = ids.(n_idents - 1u);
324324

325325
if (n_idents == 1u) {
326-
auto next_sc = std::list::cdr(sc);
327326
register(e, defid, it.span, end_id,
328-
lookup_in_scope(e, next_sc, it.span, end_id, ns_value),
329-
lookup_in_scope(e, next_sc, it.span, end_id, ns_type),
330-
lookup_in_scope(e, next_sc, it.span, end_id, ns_module));
327+
lookup_in_scope(e, sc, it.span, end_id, ns_value),
328+
lookup_in_scope(e, sc, it.span, end_id, ns_type),
329+
lookup_in_scope(e, sc, it.span, end_id, ns_module));
331330
} else {
332331
auto dcur = lookup_in_scope_strict(e, sc, it.span, ids.(0),
333332
ns_module);

trunk/src/comp/middle/tstate/annotate.rs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,43 +29,6 @@ import front::ast::decl_item;
2929
import front::ast::initializer;
3030
import front::ast::local;
3131
import front::ast::arm;
32-
import front::ast::expr_call;
33-
import front::ast::expr_vec;
34-
import front::ast::expr_tup;
35-
import front::ast::expr_path;
36-
import front::ast::expr_field;
37-
import front::ast::expr_index;
38-
import front::ast::expr_log;
39-
import front::ast::expr_block;
40-
import front::ast::expr_rec;
41-
import front::ast::expr_if;
42-
import front::ast::expr_binary;
43-
import front::ast::expr_unary;
44-
import front::ast::expr_assign;
45-
import front::ast::expr_assign_op;
46-
import front::ast::expr_while;
47-
import front::ast::expr_do_while;
48-
import front::ast::expr_alt;
49-
import front::ast::expr_lit;
50-
import front::ast::expr_ret;
51-
import front::ast::expr_self_method;
52-
import front::ast::expr_bind;
53-
import front::ast::expr_spawn;
54-
import front::ast::expr_ext;
55-
import front::ast::expr_fail;
56-
import front::ast::expr_break;
57-
import front::ast::expr_cont;
58-
import front::ast::expr_send;
59-
import front::ast::expr_recv;
60-
import front::ast::expr_put;
61-
import front::ast::expr_port;
62-
import front::ast::expr_chan;
63-
import front::ast::expr_be;
64-
import front::ast::expr_check;
65-
import front::ast::expr_assert;
66-
import front::ast::expr_cast;
67-
import front::ast::expr_for;
68-
import front::ast::expr_for_each;
6932
import front::ast::stmt;
7033
import front::ast::stmt_decl;
7134
import front::ast::stmt_expr;

trunk/src/rt/rust.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ rust_start(uintptr_t main_fn, rust_crate const *crate, int argc,
9999
}
100100

101101
uintptr_t main_args[4] = {0, 0, 0, (uintptr_t)args->args};
102-
dom->root_task->start(main_fn,
102+
dom->root_task->start((uintptr_t)rust_new_exit_task_glue,
103+
main_fn,
103104
(uintptr_t)&main_args, sizeof(main_args));
104105

105106
int ret = dom->start_main_loop();

trunk/src/rt/rust_dom.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ rust_dom::start_main_loop() {
262262
rust_timer timer(this);
263263

264264
DLOG(this, dom, "started domain loop");
265-
DLOG(this, dom, "activate glue: " PTR, root_crate->get_activate_glue());
265+
DLOG(this, dom, "activate glue: " PTR ", exit glue: " PTR,
266+
root_crate->get_activate_glue(), rust_new_exit_task_glue);
266267

267268
while (number_of_live_tasks() > 0) {
268269
A(this, kernel->is_deadlocked() == false, "deadlock");

trunk/src/rt/rust_internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ rust_crate_cache : public dom_owned<rust_crate_cache>,
357357
void flush();
358358
};
359359

360+
extern "C" void rust_new_exit_task_glue();
361+
360362
#include "rust_dwarf.h"
361363

362364
class

trunk/src/rt/rust_task.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ rust_task::~rust_task()
135135
cache->deref();
136136
}
137137

138-
extern "C" void rust_new_exit_task_glue();
139-
140138
void
141-
rust_task::start(uintptr_t spawnee_fn,
139+
rust_task::start(uintptr_t exit_task_glue,
140+
uintptr_t spawnee_fn,
142141
uintptr_t args,
143142
size_t callsz)
144143
{
144+
LOGPTR(dom, "exit-task glue", exit_task_glue);
145145
LOGPTR(dom, "from spawnee", spawnee_fn);
146146

147147
// Set sp to last uintptr_t-sized cell of segment
@@ -184,7 +184,7 @@ rust_task::start(uintptr_t spawnee_fn,
184184

185185
*spp-- = (uintptr_t) 0x0; // retp
186186

187-
*spp-- = (uintptr_t) rust_new_exit_task_glue;
187+
*spp-- = (uintptr_t) exit_task_glue;
188188

189189
for (size_t j = 0; j < n_callee_saves; ++j) {
190190
*spp-- = (uintptr_t)NULL;

trunk/src/rt/rust_task.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ rust_task : public maybe_proxy<rust_task>,
5555

5656
~rust_task();
5757

58-
void start(uintptr_t spawnee_fn,
58+
void start(uintptr_t exit_task_glue,
59+
uintptr_t spawnee_fn,
5960
uintptr_t args,
6061
size_t callsz);
6162
void grow(size_t n_frame_bytes);

trunk/src/rt/rust_upcall.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,8 @@ upcall_start_task(rust_task *spawner,
560560
", spawnee 0x%" PRIxPTR
561561
", callsz %" PRIdPTR ")", task->name, task,
562562
spawnee_fn, callsz);
563-
task->start(spawnee_fn, args, callsz);
563+
task->start((uintptr_t)rust_new_exit_task_glue, spawnee_fn,
564+
args, callsz);
564565
return task;
565566
}
566567

@@ -611,17 +612,18 @@ static void *rust_thread_start(void *ptr)
611612
extern "C" CDECL maybe_proxy<rust_task> *
612613
upcall_start_thread(rust_task *task,
613614
rust_proxy<rust_task> *child_task_proxy,
615+
uintptr_t exit_task_glue,
614616
uintptr_t spawnee_fn,
615617
size_t callsz) {
616618
LOG_UPCALL_ENTRY(task);
617619
rust_dom *parenet_dom = task->dom;
618620
rust_handle<rust_task> *child_task_handle = child_task_proxy->handle();
619621
LOG(task, task,
620-
"spawnee_fn " PTR
622+
"exit_task_glue: " PTR ", spawnee_fn " PTR
621623
", callsz %" PRIdPTR ")",
622-
spawnee_fn, callsz);
624+
exit_task_glue, spawnee_fn, callsz);
623625
rust_task *child_task = child_task_handle->referent();
624-
child_task->start(spawnee_fn,
626+
child_task->start(exit_task_glue, spawnee_fn,
625627
task->rust_sp, callsz);
626628
#if defined(__WIN32__)
627629
HANDLE thread;

trunk/src/rt/test/rust_test_runtime.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ rust_task_test::worker::run() {
5353
rust_handle<rust_dom> *handle =
5454
kernel->create_domain(crate, "test");
5555
rust_dom *domain = handle->referent();
56-
domain->root_task->start((uintptr_t)&task_entry, (uintptr_t)NULL, 0);
56+
domain->root_task->start((uintptr_t)rust_new_exit_task_glue,
57+
(uintptr_t)&task_entry, (uintptr_t)NULL, 0);
5758
domain->start_main_loop();
5859
kernel->destroy_domain(domain);
5960
}

trunk/src/test/compile-fail/bad-module.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
// error-pattern: cyclic import
1+
// error-pattern:cyclic import
22

3-
import y::x;
4-
5-
mod y {
6-
import x;
7-
}
3+
import x;
84

95
fn main() {
6+
auto y = x;
107
}

0 commit comments

Comments
 (0)