about summary refs log tree commit diff
path: root/src/rt/rust.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust.cpp')
-rw-r--r--src/rt/rust.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/rt/rust.cpp b/src/rt/rust.cpp
index 121f3d4bcfc..3f5f083650f 100644
--- a/src/rt/rust.cpp
+++ b/src/rt/rust.cpp
@@ -81,9 +81,7 @@ rust_start(uintptr_t main_fn, int argc, char **argv, void* crate_map) {
     rust_kernel *kernel = new rust_kernel(srv);
     rust_sched_id sched_id = kernel->create_scheduler(env->num_sched_threads);
     rust_scheduler *sched = kernel->get_scheduler_by_id(sched_id);
-    rust_task_id root_id = sched->create_task(NULL, "main", MAIN_STACK_SIZE);
-    rust_task *root_task = kernel->get_task_by_id(root_id);
-    I(kernel, root_task != NULL);
+    rust_task *root_task = sched->create_task(NULL, "main", MAIN_STACK_SIZE);
     rust_task_thread *thread = root_task->thread;
     command_line_args *args
         = new (kernel, "main command line args")
@@ -96,7 +94,6 @@ rust_start(uintptr_t main_fn, int argc, char **argv, void* crate_map) {
     }
 
     root_task->start((spawn_fn)main_fn, NULL, args->args);
-    root_task->deref();
     root_task = NULL;
 
     int ret = kernel->wait_for_schedulers();