Skip to content

Commit 0481d62

Browse files
committed
auto merge of #14234 : alexcrichton/rust/rollup, r=alexcrichton
Let's try this again!
2 parents 182c96c + 17df573 commit 0481d62

Some content is hidden

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

95 files changed

+2032
-432
lines changed

Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#
6969
# * `TESTNAME=...` - Specify the name of tests to run
7070
# * `CHECK_IGNORED=1` - Run normally-ignored tests
71-
# * `NO_BENCH=1` - Don't run crate benchmarks (disable `--bench` flag)
71+
# * `PLEASE_BENCH=1` - Run crate benchmarks (enable `--bench` flag)
7272
#
7373
# * `CFG_ENABLE_VALGRIND=1` - Run tests under valgrind
7474
# * `VALGRIND_COMPILE=1` - Run the compiler itself under valgrind

mk/crates.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,21 @@
5151

5252
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
54-
workcache url log regex graphviz core
54+
workcache url log regex graphviz core rlibc
5555
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
5858

5959
DEPS_core :=
60+
DEPS_rlibc :=
6061
DEPS_std := core libc native:rustrt native:compiler-rt native:backtrace native:jemalloc
62+
DEPS_graphviz := std
6163
DEPS_green := std rand native:context_switch
6264
DEPS_rustuv := std native:uv native:uv_support
6365
DEPS_native := std
6466
DEPS_syntax := std term serialize collections log fmt_macros
6567
DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \
66-
collections time log
68+
collections time log graphviz
6769
DEPS_rustdoc := rustc native:hoedown serialize sync getopts collections \
6870
test time
6971
DEPS_flate := std native:miniz
@@ -98,6 +100,7 @@ TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
98100
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
99101

100102
ONLY_RLIB_core := 1
103+
ONLY_RLIB_rlibc := 1
101104

102105
################################################################################
103106
# You should not need to edit below this line

mk/docs.mk

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ DOCS := index intro tutorial guide-ffi guide-macros guide-lifetimes \
3030
guide-tasks guide-container guide-pointers guide-testing \
3131
guide-runtime complement-bugreport complement-cheatsheet \
3232
complement-lang-faq complement-project-faq rust rustdoc \
33-
guide-unsafe not_found
33+
guide-unsafe
3434

3535
PDF_DOCS := tutorial rust
3636

@@ -42,10 +42,11 @@ L10N_LANGS := ja
4242
# Generally no need to edit below here.
4343

4444
# The options are passed to the documentation generators.
45-
RUSTDOC_HTML_OPTS = --markdown-css rust.css \
46-
--markdown-before-content=doc/version_info.html \
45+
RUSTDOC_HTML_OPTS_NO_CSS = --markdown-before-content=doc/version_info.html \
4746
--markdown-in-header=doc/favicon.inc --markdown-after-content=doc/footer.inc
4847

48+
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css
49+
4950
PANDOC_BASE_OPTS := --standalone --toc --number-sections
5051
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --include-before-body=doc/version.tex \
5152
--from=markdown --include-before-body=doc/footer.tex --to=latex
@@ -152,6 +153,11 @@ doc/footer.tex: $(D)/footer.inc | doc/
152153
@$(call E, pandoc: $@)
153154
$(CFG_PANDOC) --from=html --to=latex $< --output=$@
154155

156+
# HTML (rustdoc)
157+
DOC_TARGETS += doc/not_found.html
158+
doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
159+
$(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css http://static.rust-lang.org/doc/master/rust.css $<
160+
155161
define DEF_DOC
156162

157163
# HTML (rustdoc)

mk/tests.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ ifdef CHECK_IGNORED
3232
TESTARGS += --ignored
3333
endif
3434

35-
TEST_BENCH = --bench
35+
TEST_BENCH =
3636

3737
# Arguments to the cfail/rfail/rpass/bench tests
3838
ifdef CFG_VALGRIND
3939
CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
4040
TEST_BENCH =
4141
endif
4242

43-
ifdef NO_BENCH
44-
TEST_BENCH =
43+
ifdef PLEASE_BENCH
44+
TEST_BENCH = --bench
4545
endif
4646

4747
# Arguments to the perf tests

src/doc/rust.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,6 +1799,8 @@ type int8_t = i8;
17991799
- `no_start` - disable linking to the `native` crate, which specifies the
18001800
"start" language item.
18011801
- `no_std` - disable linking to the `std` crate.
1802+
- `no_builtins` - disable optimizing certain code patterns to invocations of
1803+
library functions that are assumed to exist
18021804

18031805
### Module-only attributes
18041806

src/libcore/cell.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,25 @@ impl<'b, T> Deref<T> for Ref<'b, T> {
186186
}
187187
}
188188

189+
/// Copy a `Ref`.
190+
///
191+
/// The `RefCell` is already immutably borrowed, so this cannot fail.
192+
///
193+
/// A `Clone` implementation would interfere with the widespread
194+
/// use of `r.borrow().clone()` to clone the contents of a `RefCell`.
195+
#[experimental]
196+
pub fn clone_ref<'b, T>(orig: &Ref<'b, T>) -> Ref<'b, T> {
197+
// Since this Ref exists, we know the borrow flag
198+
// is not set to WRITING.
199+
let borrow = orig.parent.borrow.get();
200+
debug_assert!(borrow != WRITING && borrow != UNUSED);
201+
orig.parent.borrow.set(borrow + 1);
202+
203+
Ref {
204+
parent: orig.parent,
205+
}
206+
}
207+
189208
/// Wraps a mutable borrowed reference to a value in a `RefCell` box.
190209
pub struct RefMut<'b, T> {
191210
parent: &'b RefCell<T>
@@ -307,4 +326,19 @@ mod test {
307326
let _ = _b;
308327
let _b = x.borrow_mut();
309328
}
329+
330+
#[test]
331+
fn clone_ref_updates_flag() {
332+
let x = RefCell::new(0);
333+
{
334+
let b1 = x.borrow();
335+
assert!(x.try_borrow_mut().is_none());
336+
{
337+
let _b2 = clone_ref(&b1);
338+
assert!(x.try_borrow_mut().is_none());
339+
}
340+
assert!(x.try_borrow_mut().is_none());
341+
}
342+
assert!(x.try_borrow_mut().is_some());
343+
}
310344
}

src/libcore/cmp.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,23 @@ pub fn max<T: TotalOrd>(v1: T, v2: T) -> T {
192192
// Implementation of Eq/TotalEq for some primitive types
193193
#[cfg(not(test))]
194194
mod impls {
195-
use cmp::{Ord, TotalOrd, Eq, TotalEq, Ordering};
195+
use cmp::{Ord, TotalOrd, Eq, TotalEq, Ordering, Equal};
196+
197+
impl Eq for () {
198+
#[inline]
199+
fn eq(&self, _other: &()) -> bool { true }
200+
#[inline]
201+
fn ne(&self, _other: &()) -> bool { false }
202+
}
203+
impl TotalEq for () {}
204+
impl Ord for () {
205+
#[inline]
206+
fn lt(&self, _other: &()) -> bool { false }
207+
}
208+
impl TotalOrd for () {
209+
#[inline]
210+
fn cmp(&self, _other: &()) -> Ordering { Equal }
211+
}
196212

197213
// & pointers
198214
impl<'a, T: Eq> Eq for &'a T {

src/libcore/default.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ pub trait Default {
1616
fn default() -> Self;
1717
}
1818

19+
impl Default for () {
20+
#[inline]
21+
fn default() -> () { () }
22+
}
23+
1924
impl<T: Default + 'static> Default for @T {
2025
fn default() -> @T { @Default::default() }
2126
}

src/libcore/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
//! * `memcpy`, `memcmp`, `memset` - These are core memory routines which are
1919
//! often generated by LLVM. Additionally, this library can make explicit
2020
//! calls to these funcitons. Their signatures are the same as found in C.
21+
//! These functions are often provided by the system libc, but can also be
22+
//! provided by `librlibc` which is distributed with the standard rust
23+
//! distribution.
2124
//!
2225
//! * `rust_begin_unwind` - This function takes three arguments, a
2326
//! `&fmt::Arguments`, a `&str`, and a `uint. These three arguments dictate
@@ -100,7 +103,6 @@ pub mod container;
100103
/* Core types and methods on primitives */
101104

102105
mod unicode;
103-
mod unit;
104106
pub mod any;
105107
pub mod atomics;
106108
pub mod bool;
@@ -116,9 +118,6 @@ pub mod slice;
116118
pub mod str;
117119
pub mod tuple;
118120

119-
#[cfg(stage0, not(test))]
120-
pub mod owned;
121-
122121
// FIXME: this module should not exist. Once owned allocations are no longer a
123122
// language type, this module can move outside to the owned allocation
124123
// crate.

src/libcore/owned.rs

Lines changed: 0 additions & 101 deletions
This file was deleted.

src/libcore/unit.rs

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/libgreen/sched.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,11 +1137,10 @@ mod test {
11371137
fn test_schedule_home_states() {
11381138
use sleeper_list::SleeperList;
11391139
use super::{Shutdown, Scheduler, SchedHandle};
1140-
use std::unstable::run_in_bare_thread;
11411140
use std::rt::thread::Thread;
11421141
use std::sync::deque::BufferPool;
11431142

1144-
run_in_bare_thread(proc() {
1143+
Thread::start(proc() {
11451144
let sleepers = SleeperList::new();
11461145
let mut pool = BufferPool::new();
11471146
let (normal_worker, normal_stealer) = pool.deque();
@@ -1260,7 +1259,7 @@ mod test {
12601259

12611260
normal_thread.join();
12621261
special_thread.join();
1263-
});
1262+
}).join();
12641263
}
12651264

12661265
//#[test]

src/libnative/io/file_unix.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,7 @@ fn mkstat(stat: &libc::stat) -> io::FileStat {
493493
io::FileStat {
494494
size: stat.st_size as u64,
495495
kind: kind,
496-
perm: unsafe {
497-
io::FilePermission::from_bits(stat.st_mode as u32) & io::AllPermissions
498-
},
496+
perm: io::FilePermission::from_bits_truncate(stat.st_mode as u32),
499497
created: mktime(stat.st_ctime as u64, stat.st_ctime_nsec as u64),
500498
modified: mktime(stat.st_mtime as u64, stat.st_mtime_nsec as u64),
501499
accessed: mktime(stat.st_atime as u64, stat.st_atime_nsec as u64),

0 commit comments

Comments
 (0)