rust/src
bors 0efafac398 auto merge of #19654 : aturon/rust/merge-rt, r=alexcrichton
This PR substantially narrows the notion of a "runtime" in Rust, and allows calling into Rust code directly without any setup or teardown. 

After this PR, the basic "runtime support" in Rust will consist of:

* Unwinding and backtrace support
* Stack guards

Other support, such as helper threads for timers or the notion of a "current thread" are initialized automatically upon first use.

When using Rust in an embedded context, it should now be possible to call a Rust function directly as a C function with absolutely no setup, though in that case panics will cause the process to abort. In this regard, the C/Rust interface will look much like the C/C++ interface.

In more detail, this PR:

* Merges `librustrt` back into `std::rt`, undoing the facade. While doing so, it removes a substantial amount of redundant functionality (such as mutexes defined in the `rt` module). Code using `librustrt` can now call into `std::rt` to e.g. start executing Rust code with unwinding support.

* Allows all runtime data to be initialized lazily, including the "current thread", the "at_exit" infrastructure, and the "args" storage.

* Deprecates and largely removes `std::task` along with the widespread requirement that there be a "current task" for many APIs in `std`. The entire task infrastructure is replaced with `std::thread`, which provides a more standard API for manipulating and creating native OS threads. In particular, it's possible to join on a created thread, and to get a handle to the currently-running thread. In addition, threads are equipped with some basic blocking support in the form of `park`/`unpark` operations (following a tradition in some OSes as well as the JVM). See the `std::thread` documentation for more details.

* Channels are refactored to use a new internal blocking infrastructure that itself sits on top of `park`/`unpark`.

One important change here is that a Rust program ends when its main thread does, following most threading models. On the other hand, threads will often be created with an RAII-style join handle that will re-institute blocking semantics naturally (and with finer control).

This is very much a:

[breaking-change]

Closes #18000
r? @alexcrichton
2014-12-19 08:28:52 +00:00
..
compiler-rt@62a4ca6055 Update compiler-rt to work for non-v7 arm. 2014-06-18 17:02:08 -07:00
compiletest Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
doc Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
driver Separate the driver into its own crate that uses trans, typeck. 2014-12-04 10:04:52 -05:00
etc librustc: Always parse macro!()/macro![] as expressions if not 2014-12-18 12:09:07 -05:00
grammar Modify regex::Captures::{at,name} to return Option 2014-12-14 08:56:51 -05:00
jemalloc@b001609960 update jemalloc 2014-10-05 22:17:25 -04:00
liballoc Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
libarena libarena: use unboxed closures 2014-12-13 17:03:46 -05:00
libbacktrace
libcollections Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
libcore Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
libcoretest Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
libflate Mostly rote conversion of proc() to move|| (and occasionally Thunk::new) 2014-12-14 04:21:56 -05:00
libfmt_macros Remove all shadowed lifetimes. 2014-12-15 10:23:48 -05:00
libgetopts rollup merge of #19820: alexcrichton/deprecate-some-more-libs 2014-12-17 11:50:24 -08:00
libgraphviz rollup merge of #19892: pnkfelix/region-graphviz 2014-12-17 11:50:29 -08:00
liblibc Make at_exit initialize lazily 2014-12-18 23:31:34 -08:00
liblog librustc: Always parse macro!()/macro![] as expressions if not 2014-12-18 12:09:07 -05:00
librand librustc: Always parse macro!()/macro![] as expressions if not 2014-12-18 12:09:07 -05:00
librbml librustc: Always parse macro!()/macro![] as expressions if not 2014-12-18 12:09:07 -05:00
libregex librustc: Always parse macro!()/macro![] as expressions if not 2014-12-18 12:09:07 -05:00
libregex_macros rollup merge of #19820: alexcrichton/deprecate-some-more-libs 2014-12-17 11:50:24 -08:00
librustc auto merge of #19899 : japaric/rust/unops-by-value, r=nikomatsakis 2014-12-19 06:12:01 +00:00
librustc_back librustc: Always parse macro!()/macro![] as expressions if not 2014-12-18 12:09:07 -05:00
librustc_borrowck librustc: Always parse macro!()/macro![] as expressions if not 2014-12-18 12:09:07 -05:00
librustc_driver Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
librustc_llvm librustc: Always parse macro!()/macro![] as expressions if not 2014-12-18 12:09:07 -05:00
librustc_trans auto merge of #19654 : aturon/rust/merge-rt, r=alexcrichton 2014-12-19 08:28:52 +00:00
librustc_typeck Address Niko's comments 2014-12-18 15:02:29 -05:00
librustdoc Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
libserialize enumset fallout 2014-12-18 16:20:32 -05:00
libstd auto merge of #19654 : aturon/rust/merge-rt, r=alexcrichton 2014-12-19 08:28:52 +00:00
libsyntax syntax/ast_util: add is_by_value_unop() 2014-12-18 14:56:00 -05:00
libterm librustc: Always parse macro!()/macro![] as expressions if not 2014-12-18 12:09:07 -05:00
libtest Revise std::thread API to join by default 2014-12-18 23:31:52 -08:00
libtime libtime: convert Timespec binops to by value 2014-12-13 20:15:39 -05:00
libunicode std: Collapse SlicePrelude traits 2014-12-14 19:03:56 -08:00
llvm@ec1fdb3b9d Update LLVM to get slightly better memcpy elision 2014-10-17 17:16:18 +02:00
rt Avoid .take().unwrap() with FnOnce closures 2014-12-18 23:31:52 -08:00
rust-installer@aed7347241 Use rust-installer for installation 2014-12-11 17:14:17 -08:00
rustllvm Add LLVM ExecutionEngine API 2014-12-11 15:33:27 -07:00
test auto merge of #19654 : aturon/rust/merge-rt, r=alexcrichton 2014-12-19 08:28:52 +00:00
snapshots.txt Create a snapshot on top of 1b97cd3 2014-12-16 14:39:18 +01:00