Skip to content

Commit

Permalink
auto merge of #18967 : aturon/rust/remove-runtime, r=alexcrichton
Browse files Browse the repository at this point in the history
This PR completes the removal of the runtime system and green-threaded abstractions as part of implementing [RFC 230](rust-lang/rfcs#230).

Specifically:

* It removes the `Runtime` trait, welding the scheduling infrastructure directly to native threads.

* It removes `libgreen` and `libnative` entirely.

* It rewrites `sync::mutex` as a trivial layer on top of native mutexes. Eventually, the two modules will be merged.

* It hides the vast majority of `std::rt`.

This completes the basic task of removing the runtime system (I/O and scheduling) and components that depend on it. 

After this lands, a follow-up PR will pull the `rustrt` crate back into `std`, turn `std::task` into `std::thread` (with API changes to go along with it), and completely cut out the remaining startup/teardown sequence. Other changes, including new [TLS](rust-lang/rfcs#461) and synchronization are in the RFC or pre-RFC phase.

Closes #17325
Closes #18687

[breaking-change]

r? @alexcrichton
  • Loading branch information
bors committed Nov 21, 2014
2 parents 9830051 + 32c3d02 commit c9f6d69
Show file tree
Hide file tree
Showing 71 changed files with 378 additions and 7,001 deletions.
12 changes: 5 additions & 7 deletions mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#
# DEPS_<crate>
# These lists are the dependencies of the <crate> that is to be built.
# Rust dependencies are listed bare (i.e. std, green) and native
# Rust dependencies are listed bare (i.e. std) and native
# dependencies have a "native:" prefix (i.e. native:hoedown). All deps
# will be built before the crate itself is built.
#
Expand All @@ -49,7 +49,7 @@
# automatically generated for all stage/host/target combinations.
################################################################################

TARGET_CRATES := libc std green native flate arena term \
TARGET_CRATES := libc std flate arena term \
serialize sync getopts collections test time rand \
log regex graphviz core rbml alloc rustrt \
unicode
Expand All @@ -66,8 +66,6 @@ DEPS_rustrt := alloc core libc collections native:rustrt_native
DEPS_std := core libc rand alloc collections rustrt sync unicode \
native:rust_builtin native:backtrace
DEPS_graphviz := std
DEPS_green := std native:context_switch
DEPS_native := std
DEPS_syntax := std term serialize log fmt_macros arena libc
DEPS_rustc_trans := rustc rustc_back rustc_llvm libc
DEPS_rustc := syntax flate arena serialize getopts rbml \
Expand Down Expand Up @@ -95,9 +93,9 @@ DEPS_regex := std
DEPS_regex_macros = rustc syntax std regex
DEPS_fmt_macros = std

TOOL_DEPS_compiletest := test getopts native
TOOL_DEPS_rustdoc := rustdoc native
TOOL_DEPS_rustc := rustc_trans native
TOOL_DEPS_compiletest := test getopts
TOOL_DEPS_rustdoc := rustdoc
TOOL_DEPS_rustc := rustc_trans
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
Expand Down
2 changes: 0 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Source layout:
| `libcore/` | The Rust core library |
| `libdebug/` | Debugging utilities |
| `libstd/` | The standard library (imported and linked by default) |
| `libgreen/` | The M:N runtime library |
| `libnative/` | The 1:1 runtime library |
| `libsyntax/` | The Rust parser and pretty-printer |
| `libtest/` | Rust's test-runner code |
| ------------------- | --------------------------------------------------------- |
Expand Down
8 changes: 4 additions & 4 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1059,14 +1059,14 @@ An example of what will and will not work for `use` items:

```
# #![allow(unused_imports)]
use foo::native::start; // good: foo is at the root of the crate
use foo::core::iter; // good: foo is at the root of the crate
use foo::baz::foobaz; // good: foo is at the root of the crate
mod foo {
extern crate native;
extern crate core;
use foo::native::start; // good: foo is at crate root
// use native::start; // bad: native is not at the crate root
use foo::core::iter; // good: foo is at crate root
// use core::iter; // bad: native is not at the crate root
use self::baz::foobaz; // good: self refers to module 'foo'
use foo::bar::foobar; // good: foo is at crate root
Expand Down
2 changes: 2 additions & 0 deletions src/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![no_start]

#[cfg(rustdoc)]
extern crate "rustdoc" as this;

Expand Down
1 change: 0 additions & 1 deletion src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ extern crate libc;

// Allow testing this library

#[cfg(test)] extern crate native;
#[cfg(test)] #[phase(plugin, link)] extern crate std;
#[cfg(test)] #[phase(plugin, link)] extern crate log;

Expand Down
1 change: 0 additions & 1 deletion src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
extern crate unicode;
extern crate alloc;

#[cfg(test)] extern crate native;
#[cfg(test)] extern crate test;

#[cfg(test)] #[phase(plugin, link)] extern crate std;
Expand Down
8 changes: 5 additions & 3 deletions src/libcollections/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ pub mod raw {

#[cfg(test)]
mod tests {
extern crate rustrt;

use std::cell::Cell;
use std::default::Default;
use std::mem;
Expand Down Expand Up @@ -949,9 +951,9 @@ mod tests {
#[test]
fn test_swap_remove_noncopyable() {
// Tests that we don't accidentally run destructors twice.
let mut v = vec![rt::exclusive::Exclusive::new(()),
rt::exclusive::Exclusive::new(()),
rt::exclusive::Exclusive::new(())];
let mut v = vec![rustrt::exclusive::Exclusive::new(()),
rustrt::exclusive::Exclusive::new(()),
rustrt::exclusive::Exclusive::new(())];
let mut _e = v.swap_remove(0);
assert_eq!(v.len(), 2);
_e = v.swap_remove(1);
Expand Down
259 changes: 0 additions & 259 deletions src/libgreen/basic.rs

This file was deleted.

Loading

0 comments on commit c9f6d69

Please sign in to comment.