Skip to content

Commit c9f6d69

Browse files
committed
auto merge of #18967 : aturon/rust/remove-runtime, r=alexcrichton
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
2 parents 9830051 + 32c3d02 commit c9f6d69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+378
-7001
lines changed

mk/crates.mk

+5-7
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#
3838
# DEPS_<crate>
3939
# These lists are the dependencies of the <crate> that is to be built.
40-
# Rust dependencies are listed bare (i.e. std, green) and native
40+
# Rust dependencies are listed bare (i.e. std) and native
4141
# dependencies have a "native:" prefix (i.e. native:hoedown). All deps
4242
# will be built before the crate itself is built.
4343
#
@@ -49,7 +49,7 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := libc std green native flate arena term \
52+
TARGET_CRATES := libc std flate arena term \
5353
serialize sync getopts collections test time rand \
5454
log regex graphviz core rbml alloc rustrt \
5555
unicode
@@ -66,8 +66,6 @@ DEPS_rustrt := alloc core libc collections native:rustrt_native
6666
DEPS_std := core libc rand alloc collections rustrt sync unicode \
6767
native:rust_builtin native:backtrace
6868
DEPS_graphviz := std
69-
DEPS_green := std native:context_switch
70-
DEPS_native := std
7169
DEPS_syntax := std term serialize log fmt_macros arena libc
7270
DEPS_rustc_trans := rustc rustc_back rustc_llvm libc
7371
DEPS_rustc := syntax flate arena serialize getopts rbml \
@@ -95,9 +93,9 @@ DEPS_regex := std
9593
DEPS_regex_macros = rustc syntax std regex
9694
DEPS_fmt_macros = std
9795

98-
TOOL_DEPS_compiletest := test getopts native
99-
TOOL_DEPS_rustdoc := rustdoc native
100-
TOOL_DEPS_rustc := rustc_trans native
96+
TOOL_DEPS_compiletest := test getopts
97+
TOOL_DEPS_rustdoc := rustdoc
98+
TOOL_DEPS_rustc := rustc_trans
10199
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
102100
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
103101
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs

src/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ Source layout:
99
| `libcore/` | The Rust core library |
1010
| `libdebug/` | Debugging utilities |
1111
| `libstd/` | The standard library (imported and linked by default) |
12-
| `libgreen/` | The M:N runtime library |
13-
| `libnative/` | The 1:1 runtime library |
1412
| `libsyntax/` | The Rust parser and pretty-printer |
1513
| `libtest/` | Rust's test-runner code |
1614
| ------------------- | --------------------------------------------------------- |

src/doc/reference.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1059,14 +1059,14 @@ An example of what will and will not work for `use` items:
10591059

10601060
```
10611061
# #![allow(unused_imports)]
1062-
use foo::native::start; // good: foo is at the root of the crate
1062+
use foo::core::iter; // good: foo is at the root of the crate
10631063
use foo::baz::foobaz; // good: foo is at the root of the crate
10641064
10651065
mod foo {
1066-
extern crate native;
1066+
extern crate core;
10671067
1068-
use foo::native::start; // good: foo is at crate root
1069-
// use native::start; // bad: native is not at the crate root
1068+
use foo::core::iter; // good: foo is at crate root
1069+
// use core::iter; // bad: native is not at the crate root
10701070
use self::baz::foobaz; // good: self refers to module 'foo'
10711071
use foo::bar::foobar; // good: foo is at crate root
10721072

src/driver/driver.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![no_start]
12+
1113
#[cfg(rustdoc)]
1214
extern crate "rustdoc" as this;
1315

src/liballoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ extern crate libc;
7373

7474
// Allow testing this library
7575

76-
#[cfg(test)] extern crate native;
7776
#[cfg(test)] #[phase(plugin, link)] extern crate std;
7877
#[cfg(test)] #[phase(plugin, link)] extern crate log;
7978

src/libcollections/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
extern crate unicode;
3232
extern crate alloc;
3333

34-
#[cfg(test)] extern crate native;
3534
#[cfg(test)] extern crate test;
3635

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

src/libcollections/slice.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,8 @@ pub mod raw {
666666

667667
#[cfg(test)]
668668
mod tests {
669+
extern crate rustrt;
670+
669671
use std::cell::Cell;
670672
use std::default::Default;
671673
use std::mem;
@@ -949,9 +951,9 @@ mod tests {
949951
#[test]
950952
fn test_swap_remove_noncopyable() {
951953
// Tests that we don't accidentally run destructors twice.
952-
let mut v = vec![rt::exclusive::Exclusive::new(()),
953-
rt::exclusive::Exclusive::new(()),
954-
rt::exclusive::Exclusive::new(())];
954+
let mut v = vec![rustrt::exclusive::Exclusive::new(()),
955+
rustrt::exclusive::Exclusive::new(()),
956+
rustrt::exclusive::Exclusive::new(())];
955957
let mut _e = v.swap_remove(0);
956958
assert_eq!(v.len(), 2);
957959
_e = v.swap_remove(1);

src/libgreen/basic.rs

-259
This file was deleted.

0 commit comments

Comments
 (0)