about summary refs log tree commit diff
path: root/src/libstd/std.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-10-29 09:36:47 -0700
committerbors <bors@rust-lang.org>2013-10-29 09:36:47 -0700
commit52f42f16387d0142944f376ea31c554c9caa2189 (patch)
treee6e4d20d5c8d43c280d6c9ba02c063fe1ae11b2c /src/libstd/std.rs
parente6650c87a3800264a043b7f129e6a4841c4cc3f7 (diff)
parent201cab84e8f12ec73131ac4908e6779b277449a2 (diff)
downloadrust-52f42f16387d0142944f376ea31c554c9caa2189.tar.gz
rust-52f42f16387d0142944f376ea31c554c9caa2189.zip
auto merge of #10058 : alexcrichton/rust/uv-crate, r=brson
This is one of the final steps needed to complete #9128. It still needs a little bit of polish before closing that issue, but it's in a pretty much "done" state now.

The idea here is that the entire event loop implementation using libuv is now housed in `librustuv` as a completely separate library. This library is then injected (via `extern mod rustv`) into executable builds (similarly to how libstd is injected, tunable via `#[no_uv]`) to bring in the "rust blessed event loop implementation."

Codegen-wise, there is a new `event_loop_factory` language item which is tagged on a function with 0 arguments returning `~EventLoop`. This function's symbol is then inserted into the crate map for an executable crate, and if there is no definition of the `event_loop_factory` language item then the value is null.

What this means is that embedding rust as a library in another language just got a little harder. Libraries don't have crate maps, which means that there's no way to find the event loop implementation to spin up the runtime. That being said, it's always possible to build the runtime manually. This request also makes more runtime components public which should probably be public anyway. This new public-ness should allow custom scheduler setups everywhere regardless of whether you follow the `rt::start `path.
Diffstat (limited to 'src/libstd/std.rs')
-rw-r--r--src/libstd/std.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstd/std.rs b/src/libstd/std.rs
index 069a390f010..3a96cfb1171 100644
--- a/src/libstd/std.rs
+++ b/src/libstd/std.rs
@@ -69,8 +69,13 @@ they contained the following prologue:
 #[deny(non_camel_case_types)];
 #[deny(missing_doc)];
 
+// When testing libstd, bring in libuv as the I/O backend so tests can print
+// things and all of the std::rt::io tests have an I/O interface to run on top
+// of
+#[cfg(test)] extern mod rustuv(vers = "0.9-pre");
+
 // Make extra accessible for benchmarking
-#[cfg(test)] extern mod extra(vers="0.9-pre");
+#[cfg(test)] extern mod extra(vers = "0.9-pre");
 
 // Make std testable by not duplicating lang items. See #2912
 #[cfg(test)] extern mod realstd(name = "std");