Skip to content

Commit ccc898d

Browse files
committed
---
yaml --- r: 2761 b: refs/heads/master c: 2e8afc7 h: refs/heads/master i: 2759: acfd49c v: v3
1 parent 3e4658c commit ccc898d

File tree

11 files changed

+30
-27
lines changed

11 files changed

+30
-27
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: f1d3b88f0a5eb732d45b64a57465e134d7f8c320
2+
refs/heads/master: 2e8afc7b471e7a455d27e02079d7950d41a4c020

trunk/src/comp/middle/resolve.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,11 @@ 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);
326327
register(e, defid, it.span, end_id,
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));
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));
330331
} else {
331332
auto dcur = lookup_in_scope_strict(e, sc, it.span, ids.(0),
332333
ns_module);

trunk/src/rt/rust.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ 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((uintptr_t)rust_new_exit_task_glue,
103-
main_fn,
102+
dom->root_task->start(main_fn,
104103
(uintptr_t)&main_args, sizeof(main_args));
105104

106105
int ret = dom->start_main_loop();

trunk/src/rt/rust_dom.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,7 @@ 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 ", exit glue: " PTR,
266-
root_crate->get_activate_glue(), rust_new_exit_task_glue);
265+
DLOG(this, dom, "activate glue: " PTR, root_crate->get_activate_glue());
267266

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

trunk/src/rt/rust_internal.h

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

360-
extern "C" void rust_new_exit_task_glue();
361-
362360
#include "rust_dwarf.h"
363361

364362
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+
138140
void
139-
rust_task::start(uintptr_t exit_task_glue,
140-
uintptr_t spawnee_fn,
141+
rust_task::start(uintptr_t spawnee_fn,
141142
uintptr_t args,
142143
size_t callsz)
143144
{
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 exit_task_glue,
184184

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

187-
*spp-- = (uintptr_t) exit_task_glue;
187+
*spp-- = (uintptr_t) rust_new_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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ rust_task : public maybe_proxy<rust_task>,
5555

5656
~rust_task();
5757

58-
void start(uintptr_t exit_task_glue,
59-
uintptr_t spawnee_fn,
58+
void start(uintptr_t spawnee_fn,
6059
uintptr_t args,
6160
size_t callsz);
6261
void grow(size_t n_frame_bytes);

trunk/src/rt/rust_upcall.cpp

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

@@ -612,18 +611,17 @@ static void *rust_thread_start(void *ptr)
612611
extern "C" CDECL maybe_proxy<rust_task> *
613612
upcall_start_thread(rust_task *task,
614613
rust_proxy<rust_task> *child_task_proxy,
615-
uintptr_t exit_task_glue,
616614
uintptr_t spawnee_fn,
617615
size_t callsz) {
618616
LOG_UPCALL_ENTRY(task);
619617
rust_dom *parenet_dom = task->dom;
620618
rust_handle<rust_task> *child_task_handle = child_task_proxy->handle();
621619
LOG(task, task,
622-
"exit_task_glue: " PTR ", spawnee_fn " PTR
620+
"spawnee_fn " PTR
623621
", callsz %" PRIdPTR ")",
624-
exit_task_glue, spawnee_fn, callsz);
622+
spawnee_fn, callsz);
625623
rust_task *child_task = child_task_handle->referent();
626-
child_task->start(exit_task_glue, spawnee_fn,
624+
child_task->start(spawnee_fn,
627625
task->rust_sp, callsz);
628626
#if defined(__WIN32__)
629627
HANDLE thread;

trunk/src/rt/test/rust_test_runtime.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ 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)rust_new_exit_task_glue,
57-
(uintptr_t)&task_entry, (uintptr_t)NULL, 0);
56+
domain->root_task->start((uintptr_t)&task_entry, (uintptr_t)NULL, 0);
5857
domain->start_main_loop();
5958
kernel->destroy_domain(domain);
6059
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// xfail-stage0
2+
// error-pattern: unresolved import: vec
3+
import vec;
4+
5+
fn main() {
6+
auto foo = vec::len([]);
7+
}
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
// error-pattern:cyclic import
1+
// error-pattern: cyclic import
22

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

59
fn main() {
6-
auto y = x;
710
}

0 commit comments

Comments
 (0)