Skip to content

Rollup of 19 pull requests #38943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
ec9a960
Add PeekMut::pop
sfackler Dec 31, 2016
5e42fa7
Add a tracking issue
sfackler Jan 6, 2017
b6dc3a7
Remove some dead Python code.
SimonSapin Jan 2, 2017
6dcc43c
Reduce the size of static data in std_unicode::tables.
SimonSapin Jan 2, 2017
2d17d8b
rustc: use -Xlinker when specifying an rpath with ',' in it
jsgf Jan 3, 2017
f475739
Print attributes on expressions when pretty printing.
comex Jan 3, 2017
e987662
trans: Collect drop-glue translation item for closure env in fn-once-…
michaelwoerister Jan 4, 2017
dcae65f
trans: Make the trans-item collector see through VTableFnPointer.
michaelwoerister Jan 4, 2017
df5d12e
compiletest: Fix flaky Android gdb test runs
alexcrichton Jan 6, 2017
4e078b7
Remove not(stage0) from deny(warnings)
alexcrichton Dec 29, 2016
da908fc
rustc: keep track of tables everywhere as if they were per-body.
eddyb Jan 6, 2017
4eea99e
rustc: store ty::Tables separately for each body (except closures').
eddyb Jan 4, 2017
d28a534
Fix process module tests to run on Windows
abhijeetbhagat Jan 3, 2017
920ecd9
Fix formatting
abhijeetbhagat Jan 4, 2017
68f913e
Fix formatting
abhijeetbhagat Jan 4, 2017
9df8350
Allow projections to be promoted to constants in MIR.
eddyb Jan 5, 2017
6499d13
rustbuild: Don't build target compilers in stage0
alexcrichton Jan 5, 2017
853f12d
Make members of {std,core}::{i128,u128} unstable
est31 Jan 6, 2017
cd54cfd
travis: Wrap submodules updates in travis_retry
alexcrichton Jan 7, 2017
461d231
rustbuild: Pass --retry 3 to curl
alexcrichton Jan 7, 2017
ea20fbe
Improve safety warning on ptr::swap
steveklabnik Jan 7, 2017
1096235
thanks @eddyb
steveklabnik Jan 7, 2017
623ca88
Warn that the name is ignored if a link target is emitted
kjaleshire Jan 5, 2017
fd69778
Error message more like original
kjaleshire Jan 7, 2017
d141ba1
std: Add a nonblocking `Child::try_wait` method
alexcrichton Jan 6, 2017
e3d9ecb
Avoid large number of stage 0 warnings about --no-stack-check
petrochenkov Jan 8, 2017
fe49dae
Don't restrict docs in compiler-docs mode
Manishearth Jan 8, 2017
6cf3aaf
std: link to liballoc_system if compiled without the jemalloc feature
Nov 24, 2016
f00bbe0
fix Makefiles
Dec 23, 2016
fe71e30
note individual lint name set via lint group attribute in notes
zackmdavis Jan 6, 2017
69cd9a3
note lint group set on command line triggering individual lint
zackmdavis Jan 6, 2017
986929e
make lint-group-style test a UI rather than a compile-fail test
zackmdavis Jan 5, 2017
a56abdd
note wording: lint implied by lint group, not lint group implies lint
zackmdavis Jan 6, 2017
f7dbec3
book: use abort() over loop {} for panic
Dec 3, 2016
ba1f884
Add time module missing docs
GuillaumeGomez Dec 14, 2016
a160177
Clarify behavior of `VecDeque::insert`.
frewsxcv Dec 23, 2016
3816222
Add test for correct span for type
estebank Dec 25, 2016
6e69380
Test for appropriate span on second custom derive
estebank Dec 25, 2016
edcdec2
Move check-ui to fulldeps so librustc is available
estebank Jan 7, 2017
0b96d07
trying to figure out why this test failes, might need help
estebank Jan 8, 2017
3eb1db7
review comment
estebank Jan 9, 2017
8b359fa
std: Remove unused objects from compiler-builtins
alexcrichton Dec 26, 2016
74cddaf
Fix doc for `escape_debug`
bombless Dec 27, 2016
c7d7df2
Replace uses of `#[unsafe_destructor_blind_to_params]` with `#[may_da…
apasel422 Dec 28, 2016
e27f8d6
Update signed formatting for numeric types in docs
cbreeden Dec 30, 2016
a059a76
Doc fix
minaguib Jan 3, 2017
6fbec03
Add more docs for CoerceUnsized and Unsize
Manishearth Jan 4, 2017
dc29b67
Fix typo in tuple docs
ollie27 Jan 5, 2017
f63db43
Expand {Path,OsStr}::{to_str,to_string_lossy} doc examples.
frewsxcv Jan 5, 2017
79f8198
Update usage of rustc
F001 Jan 5, 2017
5561d7b
ICH: Add some more test cases for trait impls.
michaelwoerister Jan 5, 2017
ddc536c
Update vec.rs
richard-uk1 Jan 6, 2017
27de1bb
Update vec.rs
richard-uk1 Jan 6, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ __pycache__/
/obj/
/rt/
/rustllvm/
/src/libunicode/DerivedCoreProperties.txt
/src/libunicode/EastAsianWidth.txt
/src/libunicode/HangulSyllableType.txt
/src/libunicode/PropList.txt
/src/libunicode/Scripts.txt
/src/libunicode/UnicodeData.txt
/src/libstd_unicode/DerivedCoreProperties.txt
/src/libstd_unicode/DerivedNormalizationProps.txt
/src/libstd_unicode/PropList.txt
/src/libstd_unicode/ReadMe.txt
/src/libstd_unicode/Scripts.txt
/src/libstd_unicode/SpecialCasing.txt
/src/libstd_unicode/UnicodeData.txt
/stage[0-9]+/
/target
/test/
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ script:
if [ "$ALLOW_PR" = "" ] && [ "$TRAVIS_BRANCH" != "auto" ]; then
echo skipping, not a full build;
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
git submodule update --init &&
travis_retry git submodule update --init &&
src/ci/run.sh;
else
git submodule update --init &&
travis_retry git submodule update --init &&
src/ci/docker/run.sh $IMAGE;
fi

Expand Down
1 change: 1 addition & 0 deletions mk/crates.mk
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ TARGET_SPECIFIC_alloc_jemalloc := 1
DOC_CRATES := std alloc collections core libc std_unicode

ifeq ($(CFG_DISABLE_JEMALLOC),)
RUSTFLAGS_std := --cfg 'feature="jemalloc"'
RUSTFLAGS_rustc_back := --cfg 'feature="jemalloc"'
endif

Expand Down
2 changes: 1 addition & 1 deletion mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ endif
# that the snapshot will be generated with a statically linked rustc so we only
# have to worry about the distribution of one file (with its native dynamic
# dependencies)
RUSTFLAGS_STAGE0 += -C prefer-dynamic -C no-stack-check
RUSTFLAGS_STAGE0 += -C prefer-dynamic
RUSTFLAGS_STAGE1 += -C prefer-dynamic
RUST_LIB_FLAGS_ST2 += -C prefer-dynamic
RUST_LIB_FLAGS_ST3 += -C prefer-dynamic
Expand Down
1 change: 0 additions & 1 deletion src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def download(path, url, probably_big, verbose):
option = "-#"
else:
option = "-s"
run(["curl", option, "-Sf", "-o", path, url], verbose=verbose)
run(["curl", option, "--retry", "3", "-Sf", "-o", path, url], verbose=verbose)


def verify(path, sha_path, verbose):
Expand Down
26 changes: 17 additions & 9 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,25 @@ pub fn std(build: &Build, stage: u32, target: &str) {
let mut cargo = build.cargo(&compiler, Mode::Libstd, target, "doc");
cargo.arg("--manifest-path")
.arg(build.src.join("src/rustc/std_shim/Cargo.toml"))
.arg("--features").arg(build.std_features())
.arg("--no-deps");

for krate in &["alloc", "collections", "core", "std", "std_unicode"] {
cargo.arg("-p").arg(krate);
// Create all crate output directories first to make sure rustdoc uses
// relative links.
// FIXME: Cargo should probably do this itself.
t!(fs::create_dir_all(out_dir.join(krate)));
.arg("--features").arg(build.std_features());

// We don't want to build docs for internal std dependencies unless
// in compiler-docs mode. When not in that mode, we whitelist the crates
// for which docs must be built.
if build.config.compiler_docs {
cargo.arg("-p").arg("std");
} else {
cargo.arg("--no-deps");
for krate in &["alloc", "collections", "core", "std", "std_unicode"] {
cargo.arg("-p").arg(krate);
// Create all crate output directories first to make sure rustdoc uses
// relative links.
// FIXME: Cargo should probably do this itself.
t!(fs::create_dir_all(out_dir.join(krate)));
}
}


build.run(&mut cargo);
cp_r(&out_dir, &out)
}
Expand Down
20 changes: 14 additions & 6 deletions src/bootstrap/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
"codegen-units");
suite("check-incremental", "src/test/incremental", "incremental",
"incremental");
suite("check-ui", "src/test/ui", "ui", "ui");
}

if build.config.build.contains("msvc") {
Expand Down Expand Up @@ -363,6 +362,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
});
};

suite("check-ui", "src/test/ui", "ui", "ui");
suite("check-rpass-full", "src/test/run-pass-fulldeps",
"run-pass", "run-pass-fulldeps");
suite("check-rfail-full", "src/test/run-fail-fulldeps",
Expand Down Expand Up @@ -517,11 +517,21 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
// ========================================================================
// Documentation targets
rules.doc("doc-book", "src/doc/book")
.dep(move |s| s.name("tool-rustbook").target(&build.config.build).stage(0))
.dep(move |s| {
s.name("tool-rustbook")
.host(&build.config.build)
.target(&build.config.build)
.stage(0)
})
.default(build.config.docs)
.run(move |s| doc::rustbook(build, s.target, "book"));
rules.doc("doc-nomicon", "src/doc/nomicon")
.dep(move |s| s.name("tool-rustbook").target(&build.config.build).stage(0))
.dep(move |s| {
s.name("tool-rustbook")
.host(&build.config.build)
.target(&build.config.build)
.stage(0)
})
.default(build.config.docs)
.run(move |s| doc::rustbook(build, s.target, "nomicon"));
rules.doc("doc-standalone", "src/doc")
Expand Down Expand Up @@ -1364,7 +1374,6 @@ mod tests {

assert!(plan.iter().any(|s| s.name.contains("-ui")));
assert!(plan.iter().any(|s| s.name.contains("cfail")));
assert!(plan.iter().any(|s| s.name.contains("cfail")));
assert!(plan.iter().any(|s| s.name.contains("cfail-full")));
assert!(plan.iter().any(|s| s.name.contains("codegen-units")));
assert!(plan.iter().any(|s| s.name.contains("debuginfo")));
Expand Down Expand Up @@ -1397,8 +1406,7 @@ mod tests {
assert!(plan.iter().all(|s| s.host == "A"));
assert!(plan.iter().all(|s| s.target == "C"));

assert!(plan.iter().any(|s| s.name.contains("-ui")));
assert!(plan.iter().any(|s| s.name.contains("cfail")));
assert!(!plan.iter().any(|s| s.name.contains("-ui")));
assert!(plan.iter().any(|s| s.name.contains("cfail")));
assert!(!plan.iter().any(|s| s.name.contains("cfail-full")));
assert!(plan.iter().any(|s| s.name.contains("codegen-units")));
Expand Down
11 changes: 4 additions & 7 deletions src/doc/book/lang-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@ and one for deallocation. A freestanding program that uses the `Box`
sugar for dynamic allocations via `malloc` and `free`:

```rust,ignore
#![feature(lang_items, box_syntax, start, libc)]
#![feature(lang_items, box_syntax, start, libc, core_intrinsics)]
#![no_std]
use core::intrinsics;

extern crate libc;

extern {
fn abort() -> !;
}

#[lang = "owned_box"]
pub struct Box<T>(*mut T);

Expand All @@ -34,7 +31,7 @@ unsafe fn allocate(size: usize, _align: usize) -> *mut u8 {

// Check if `malloc` failed:
if p as usize == 0 {
abort();
intrinsics::abort();
}

p
Expand All @@ -58,7 +55,7 @@ fn main(argc: isize, argv: *const *const u8) -> isize {
}

#[lang = "eh_personality"] extern fn rust_eh_personality() {}
#[lang = "panic_fmt"] extern fn rust_begin_panic() -> ! { loop {} }
#[lang = "panic_fmt"] extern fn rust_begin_panic() -> ! { unsafe { intrinsics::abort() } }
# #[lang = "eh_unwind_resume"] extern fn rust_eh_unwind_resume() {}
# #[no_mangle] pub extern fn rust_eh_register_frames () {}
# #[no_mangle] pub extern fn rust_eh_unregister_frames () {}
Expand Down
10 changes: 6 additions & 4 deletions src/doc/book/no-stdlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ The function marked `#[start]` is passed the command line parameters
in the same format as C:

```rust,ignore
#![feature(lang_items)]
#![feature(lang_items, core_intrinsics)]
#![feature(start)]
#![no_std]
use core::intrinsics;

// Pull in the system libc library for what crt0.o likely requires.
extern crate libc;
Expand Down Expand Up @@ -69,7 +70,7 @@ pub extern fn rust_eh_unwind_resume() {
pub extern fn rust_begin_panic(_msg: core::fmt::Arguments,
_file: &'static str,
_line: u32) -> ! {
loop {}
unsafe { intrinsics::abort() }
}
```

Expand All @@ -79,10 +80,11 @@ correct ABI and the correct name, which requires overriding the
compiler's name mangling too:

```rust,ignore
#![feature(lang_items)]
#![feature(lang_items, core_intrinsics)]
#![feature(start)]
#![no_std]
#![no_main]
use core::intrinsics;

// Pull in the system libc library for what crt0.o likely requires.
extern crate libc;
Expand Down Expand Up @@ -112,7 +114,7 @@ pub extern fn rust_eh_unwind_resume() {
pub extern fn rust_begin_panic(_msg: core::fmt::Arguments,
_file: &'static str,
_line: u32) -> ! {
loop {}
unsafe { intrinsics::abort() }
}
```

Expand Down
4 changes: 3 additions & 1 deletion src/doc/nomicon/coercions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Coercion is allowed between the following types:
* `&T` to `*const T`
* `&mut T` to `*mut T`
* Unsizing: `T` to `U` if `T` implements `CoerceUnsized<U>`
* Deref coercion: Expression `&x` of type `&T` to `&*x` of type `&U` if `T` derefs to `U` (i.e. `T: Deref<Target=U>`)

`CoerceUnsized<Pointer<U>> for Pointer<T> where T: Unsize<U>` is implemented
for all pointer types (including smart pointers like Box and Rc). Unsize is
Expand All @@ -27,8 +28,9 @@ only implemented automatically, and enables the following transformations:
* `Foo<..., T, ...>` => `Foo<..., U, ...>` where:
* `T: Unsize<U>`
* `Foo` is a struct
* Only the last field of `Foo` has type `T`
* Only the last field of `Foo` has type involving `T`
* `T` is not part of the type of any other fields
* `Bar<T>: Unsize<Bar<U>>`, if the last field of `Foo` has type `Bar<T>`

Coercions occur at a *coercion site*. Any location that is explicitly typed
will cause a coercion to its type. If inference is necessary, the coercion will
Expand Down
71 changes: 58 additions & 13 deletions src/etc/unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
# Since this should not require frequent updates, we just store this
# out-of-line and check the unicode.rs file into git.

import fileinput, re, os, sys, operator

bytes_old = 0
bytes_new = 0
import fileinput, re, os, sys, operator, math

preamble = '''// Copyright 2012-2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
Expand Down Expand Up @@ -362,7 +359,23 @@ def emit_trie_lookup_range_table(f):
let leaf = r.r5[((child as usize) << 6) + ((c >> 6) & 0x3f)];
trie_range_leaf(c, r.r6[leaf as usize])
}
}\n
}

pub struct SmallBoolTrie {
r1: &'static [u8], // first level
r2: &'static [u64], // leaves
}

impl SmallBoolTrie {
fn lookup(&self, c: char) -> bool {
let c = c as usize;
match self.r1.get(c >> 6) {
Some(&child) => trie_range_leaf(c, self.r2[child as usize]),
None => false,
}
}
}

""")

def compute_trie(rawdata, chunksize):
Expand All @@ -379,8 +392,6 @@ def compute_trie(rawdata, chunksize):
return (root, child_data)

def emit_bool_trie(f, name, t_data, is_pub=True):
global bytes_old, bytes_new
bytes_old += 8 * len(t_data)
CHUNK = 64
rawdata = [False] * 0x110000
for (lo, hi) in t_data:
Expand Down Expand Up @@ -433,15 +444,50 @@ def emit_bool_trie(f, name, t_data, is_pub=True):
f.write("\n ],\n")

f.write(" };\n\n")
bytes_new += 256 + 992 + 256 + 8 * len(r3) + len(r5) + 8 * len(r6)

def emit_small_bool_trie(f, name, t_data, is_pub=True):
last_chunk = max(int(hi / 64) for (lo, hi) in t_data)
n_chunks = last_chunk + 1
chunks = [0] * n_chunks
for (lo, hi) in t_data:
for cp in range(lo, hi + 1):
if int(cp / 64) >= len(chunks):
print(cp, int(cp / 64), len(chunks), lo, hi)
chunks[int(cp / 64)] |= 1 << (cp & 63)

pub_string = ""
if is_pub:
pub_string = "pub "
f.write(" %sconst %s: &'static super::SmallBoolTrie = &super::SmallBoolTrie {\n"
% (pub_string, name))

(r1, r2) = compute_trie(chunks, 1)

f.write(" r1: &[\n")
data = ','.join(str(node) for node in r1)
format_table_content(f, data, 12)
f.write("\n ],\n")

f.write(" r2: &[\n")
data = ','.join('0x%016x' % node for node in r2)
format_table_content(f, data, 12)
f.write("\n ],\n")

f.write(" };\n\n")

def emit_property_module(f, mod, tbl, emit):
f.write("pub mod %s {\n" % mod)
for cat in sorted(emit):
emit_bool_trie(f, "%s_table" % cat, tbl[cat])
f.write(" pub fn %s(c: char) -> bool {\n" % cat)
f.write(" super::trie_lookup_range_table(c, %s_table)\n" % cat)
f.write(" }\n\n")
if cat in ["Cc", "White_Space", "Pattern_White_Space"]:
emit_small_bool_trie(f, "%s_table" % cat, tbl[cat])
f.write(" pub fn %s(c: char) -> bool {\n" % cat)
f.write(" %s_table.lookup(c)\n" % cat)
f.write(" }\n\n")
else:
emit_bool_trie(f, "%s_table" % cat, tbl[cat])
f.write(" pub fn %s(c: char) -> bool {\n" % cat)
f.write(" super::trie_lookup_range_table(c, %s_table)\n" % cat)
f.write(" }\n\n")
f.write("}\n\n")

def emit_conversions_module(f, to_upper, to_lower, to_title):
Expand Down Expand Up @@ -543,4 +589,3 @@ def emit_norm_module(f, canon, compat, combine, norm_props):
# normalizations and conversions module
emit_norm_module(rf, canon_decomp, compat_decomp, combines, norm_props)
emit_conversions_module(rf, to_upper, to_lower, to_title)
#print 'bytes before = %d, bytes after = %d' % (bytes_old, bytes_new)
3 changes: 1 addition & 2 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ impl<T: ?Sized> Arc<T> {
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> Drop for Arc<T> {
unsafe impl<#[may_dangle] T: ?Sized> Drop for Arc<T> {
/// Drops the `Arc`.
///
/// This will decrement the strong reference count. If the strong reference
Expand Down Expand Up @@ -736,7 +736,6 @@ impl<T: ?Sized> Drop for Arc<T> {
/// drop(foo); // Doesn't print anything
/// drop(foo2); // Prints "dropped!"
/// ```
#[unsafe_destructor_blind_to_params]
#[inline]
fn drop(&mut self) {
// Because `fetch_sub` is already atomic, we do not need to synchronize
Expand Down
Loading