summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorTom Lee <github@tomlee.co>2013-05-21 23:17:04 -0700
committerTom Lee <github@tomlee.co>2013-05-27 17:13:01 -0700
commit67283eaad2f53e19ae963e2b0a04b65826568336 (patch)
tree4224fafe84f9b4c22b032acddbcd9490149a5229 /src/rt
parentdbc57584bd4e87f0bd3eed6bced8bbd04d99edcf (diff)
downloadrust-67283eaad2f53e19ae963e2b0a04b65826568336.tar.gz
rust-67283eaad2f53e19ae963e2b0a04b65826568336.zip
Omit unused implicit argument if return type is immediate.
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/rust_builtin.cpp8
-rw-r--r--src/rt/rust_task.cpp6
-rw-r--r--src/rt/rust_type.h4
3 files changed, 8 insertions, 10 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index a2f253550af..99fd46737e0 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -731,10 +731,10 @@ rust_task_deref(rust_task *task) {
 // Must call on rust stack.
 extern "C" CDECL void
 rust_call_tydesc_glue(void *root, size_t *tydesc, size_t glue_index) {
-    void (*glue_fn)(void *, void *, void *, void *) =
-        (void (*)(void *, void *, void *, void *))tydesc[glue_index];
+    void (*glue_fn)(void *, void *, void *) =
+        (void (*)(void *, void *, void *))tydesc[glue_index];
     if (glue_fn)
-        glue_fn(0, 0, 0, root);
+        glue_fn(0, 0, root);
 }
 
 // Don't run on the Rust stack!
@@ -754,7 +754,7 @@ public:
 
     virtual void run() {
         record_sp_limit(0);
-        fn.f(NULL, fn.env, NULL);
+        fn.f(fn.env, NULL);
     }
 };
 
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 266c0652c6e..28d36a4bf88 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -162,9 +162,7 @@ void task_start_wrapper(spawn_args *a)
 
     bool threw_exception = false;
     try {
-        // The first argument is the return pointer; as the task fn
-        // must have void return type, we can safely pass 0.
-        a->f(0, a->envptr, a->argptr);
+        a->f(a->envptr, a->argptr);
     } catch (rust_task *ex) {
         assert(ex == task && "Expected this task to be thrown for unwinding");
         threw_exception = true;
@@ -185,7 +183,7 @@ void task_start_wrapper(spawn_args *a)
     if(env) {
         // free the environment (which should be a unique closure).
         const type_desc *td = env->td;
-        td->drop_glue(NULL, NULL, NULL, box_body(env));
+        td->drop_glue(NULL, NULL, box_body(env));
         task->kernel->region()->free(env);
     }
 
diff --git a/src/rt/rust_type.h b/src/rt/rust_type.h
index ece0d48c3ae..6d36d2c960a 100644
--- a/src/rt/rust_type.h
+++ b/src/rt/rust_type.h
@@ -21,11 +21,11 @@ struct rust_opaque_box;
 // - the main function: has a NULL environment, but uses the void* arg
 // - unique closures of type fn~(): have a non-NULL environment, but
 //   no arguments (and hence the final void*) is harmless
-typedef void (*CDECL spawn_fn)(void*, rust_opaque_box*, void *);
+typedef void (*CDECL spawn_fn)(rust_opaque_box*, void *);
 
 struct type_desc;
 
-typedef void CDECL (glue_fn)(void *, void *, const type_desc **, void *);
+typedef void CDECL (glue_fn)(void *, const type_desc **, void *);
 
 // Corresponds to the boxed data in the @ region.  The body follows the
 // header; you can obtain a ptr via box_body() below.