Skip to content

Rollup of 11 pull requests #43454

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

Merged
merged 23 commits into from
Jul 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ffae5de
configure: allow distros to disable debuginfo-only-std
infinity0 Jul 17, 2017
daa276e
Update liblibc
jackpot51 Jul 19, 2017
fa91eeb
Remove unused DefTable::retrace_path().
michaelwoerister Jul 20, 2017
72e8009
Remove mut where possible
Jul 20, 2017
9a51055
Clarify that sort_unstable is deterministic
Jul 20, 2017
9d0946a
Tell `tidy` about `compiler_builtins_lib` feature
ranweiler Jul 20, 2017
e74f611
Document use of `compiler_builtins` with `no_std` binaries
ranweiler Jul 19, 2017
3cefd2b
Add a missing verb to the description of std::process::ExitStatus::su…
s3rvac Jul 21, 2017
5c6ccdc
Correct the spelling of "homogeneous"
cuviper Jul 22, 2017
0221964
rustc: Add some build scripts for librustc crates
alexcrichton Jul 22, 2017
539df81
Fix some doc/comment typos.
waywardmonkeys Jul 23, 2017
749dcba
rustdoc: add unions to whitelist of sidebar types
zackmdavis Jul 24, 2017
953f381
Rollup merge of #43297 - infinity0:master, r=alexcrichton
Mark-Simulacrum Jul 24, 2017
da24118
Rollup merge of #43322 - redox-os:redox_liblibc, r=alexcrichton
Mark-Simulacrum Jul 24, 2017
295a789
Rollup merge of #43342 - ranweiler:no-std-exe-docs, r=alexcrichton
Mark-Simulacrum Jul 24, 2017
7e72b41
Rollup merge of #43361 - michaelwoerister:remove-retrace-path, r=niko…
Mark-Simulacrum Jul 24, 2017
f1537da
Rollup merge of #43366 - leshow:bufreader-docs, r=aturon
Mark-Simulacrum Jul 24, 2017
32e607d
Rollup merge of #43374 - stjepang:fix-sort-randomization-comment, r=a…
Mark-Simulacrum Jul 24, 2017
d1ba747
Rollup merge of #43379 - s3rvac:fix-exit-status-success-description, …
Mark-Simulacrum Jul 24, 2017
bf5d661
Rollup merge of #43401 - cuviper:homogeneous, r=Mark-Simulacrum
Mark-Simulacrum Jul 24, 2017
fd2331c
Rollup merge of #43421 - alexcrichton:add-some-build-scripts, r=Mark-…
Mark-Simulacrum Jul 24, 2017
659bfe5
Rollup merge of #43428 - waywardmonkeys:doc-fixes, r=estebank
Mark-Simulacrum Jul 24, 2017
0bb4291
Rollup merge of #43446 - zackmdavis:rustdoc_sidebar_unions, r=Guillau…
Mark-Simulacrum Jul 24, 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
8 changes: 4 additions & 4 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@ case "$CFG_RELEASE_CHANNEL" in
*-pc-windows-gnu)
;;
*)
CFG_ENABLE_DEBUGINFO_LINES=1
CFG_ENABLE_DEBUGINFO_ONLY_STD=1
enable_if_not_disabled debuginfo-lines
enable_if_not_disabled debuginfo-only-std
;;
esac

Expand All @@ -572,8 +572,8 @@ case "$CFG_RELEASE_CHANNEL" in
*-pc-windows-gnu)
;;
*)
CFG_ENABLE_DEBUGINFO_LINES=1
CFG_ENABLE_DEBUGINFO_ONLY_STD=1
enable_if_not_disabled debuginfo-lines
enable_if_not_disabled debuginfo-only-std
;;
esac
;;
Expand Down
8 changes: 8 additions & 0 deletions src/doc/unstable-book/src/language-features/lang-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ pub extern fn rust_begin_panic(_msg: core::fmt::Arguments,
}
```

In many cases, you may need to manually link to the `compiler_builtins` crate
when building a `no_std` binary. You may observe this via linker error messages
such as "```undefined reference to `__rust_probestack'```". Using this crate
also requires enabling the library feature `compiler_builtins_lib`. You can read
more about this [here][compiler-builtins-lib].

[compiler-builtins-lib]: library-features/compiler-builtins-lib.html

## More about the language items

The compiler currently makes a few assumptions about symbols which are
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# `compiler_builtins_lib`

The tracking issue for this feature is: None.

------------------------

This feature is required to link to the `compiler_builtins` crate which contains
"compiler intrinsics". Compiler intrinsics are software implementations of basic
operations like multiplication of `u64`s. These intrinsics are only required on
platforms where these operations don't directly map to a hardware instruction.

You should never need to explicitly link to the `compiler_builtins` crate when
building "std" programs as `compiler_builtins` is already in the dependency
graph of `std`. But you may need it when building `no_std` **binary** crates. If
you get a *linker* error like:

``` text
$PWD/src/main.rs:11: undefined reference to `__aeabi_lmul'
$PWD/src/main.rs:11: undefined reference to `__aeabi_uldivmod'
```

That means that you need to link to this crate.

When you link to this crate, make sure it only appears once in your crate
dependency graph. Also, it doesn't matter where in the dependency graph you
place the `compiler_builtins` crate.

<!-- NOTE(ignore) doctests don't support `no_std` binaries -->

``` rust,ignore
#![feature(compiler_builtins_lib)]
#![no_std]

extern crate compiler_builtins;
```
33 changes: 18 additions & 15 deletions src/liballoc/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1252,12 +1252,13 @@ impl<T> [T] {
///
/// # Current implementation
///
/// The current algorithm is based on Orson Peters' [pattern-defeating quicksort][pdqsort],
/// which is a quicksort variant designed to be very fast on certain kinds of patterns,
/// sometimes achieving linear time. It is randomized but deterministic, and falls back to
/// heapsort on degenerate inputs.
/// The current algorithm is based on [pattern-defeating quicksort][pdqsort] by Orson Peters,
/// which combines the fast average case of randomized quicksort with the fast worst case of
/// heapsort, while achieving linear time on slices with certain patterns. It uses some
/// randomization to avoid degenerate cases, but with a fixed seed to always provide
/// deterministic behavior.
///
/// It is generally faster than stable sorting, except in a few special cases, e.g. when the
/// It is typically faster than stable sorting, except in a few special cases, e.g. when the
/// slice consists of several concatenated sorted sequences.
///
/// # Examples
Expand Down Expand Up @@ -1286,12 +1287,13 @@ impl<T> [T] {
///
/// # Current implementation
///
/// The current algorithm is based on Orson Peters' [pattern-defeating quicksort][pdqsort],
/// which is a quicksort variant designed to be very fast on certain kinds of patterns,
/// sometimes achieving linear time. It is randomized but deterministic, and falls back to
/// heapsort on degenerate inputs.
/// The current algorithm is based on [pattern-defeating quicksort][pdqsort] by Orson Peters,
/// which combines the fast average case of randomized quicksort with the fast worst case of
/// heapsort, while achieving linear time on slices with certain patterns. It uses some
/// randomization to avoid degenerate cases, but with a fixed seed to always provide
/// deterministic behavior.
///
/// It is generally faster than stable sorting, except in a few special cases, e.g. when the
/// It is typically faster than stable sorting, except in a few special cases, e.g. when the
/// slice consists of several concatenated sorted sequences.
///
/// # Examples
Expand Down Expand Up @@ -1323,12 +1325,13 @@ impl<T> [T] {
///
/// # Current implementation
///
/// The current algorithm is based on Orson Peters' [pattern-defeating quicksort][pdqsort],
/// which is a quicksort variant designed to be very fast on certain kinds of patterns,
/// sometimes achieving linear time. It is randomized but deterministic, and falls back to
/// heapsort on degenerate inputs.
/// The current algorithm is based on [pattern-defeating quicksort][pdqsort] by Orson Peters,
/// which combines the fast average case of randomized quicksort with the fast worst case of
/// heapsort, while achieving linear time on slices with certain patterns. It uses some
/// randomization to avoid degenerate cases, but with a fixed seed to always provide
/// deterministic behavior.
///
/// It is generally faster than stable sorting, except in a few special cases, e.g. when the
/// It is typically faster than stable sorting, except in a few special cases, e.g. when the
/// slice consists of several concatenated sorted sequences.
///
/// # Examples
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ macro_rules! generate_pattern_iterators {
internal:
$internal_iterator:ident yielding ($iterty:ty);

// Kind of delgation - either single ended or double ended
// Kind of delegation - either single ended or double ended
delegate $($t:tt)*
} => {
$(#[$forward_iterator_attribute])*
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/str/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub enum SearchStep {
/// Note that there might be more than one `Reject` between two `Match`es,
/// there is no requirement for them to be combined into one.
Reject(usize, usize),
/// Expresses that every byte of the haystack has been visted, ending
/// Expresses that every byte of the haystack has been visited, ending
/// the iteration.
Done
}
Expand All @@ -101,7 +101,7 @@ pub enum SearchStep {
/// the haystack. This enables consumers of this trait to
/// slice the haystack without additional runtime checks.
pub unsafe trait Searcher<'a> {
/// Getter for the underlaying string to be searched in
/// Getter for the underlying string to be searched in
///
/// Will always return the same `&str`
fn haystack(&self) -> &'a str;
Expand Down Expand Up @@ -1153,7 +1153,7 @@ impl TwoWaySearcher {
// The maximal suffix is a possible critical factorization (u', v') of `arr`.
//
// Returns `i` where `i` is the starting index of v', from the back;
// returns immedately when a period of `known_period` is reached.
// returns immediately when a period of `known_period` is reached.
//
// `order_greater` determines if lexical order is `<` or `>`. Both
// orders must be computed -- the ordering with the largest `i` gives
Expand Down
2 changes: 1 addition & 1 deletion src/liblibc
Submodule liblibc updated 62 files
+25 −70 .travis.yml
+9 −9 Cargo.lock
+1 −1 Cargo.toml
+5 −4 ci/android-install-ndk.sh
+8 −1 ci/docker/i686-unknown-linux-musl/Dockerfile
+9 −0 ci/docker/s390x-unknown-linux-gnu/Dockerfile
+1 −1 ci/docker/x86_64-linux-android/Dockerfile
+8 −1 ci/docker/x86_64-unknown-linux-musl/Dockerfile
+0 −1 ci/run-docker.sh
+5 −0 ci/run.sh
+38 −2 libc-test/build.rs
+9 −1 src/redox.rs
+33 −0 src/unix/bsd/apple/b32.rs
+38 −0 src/unix/bsd/apple/b64.rs
+49 −27 src/unix/bsd/apple/mod.rs
+58 −1 src/unix/bsd/freebsdlike/dragonfly/mod.rs
+18 −0 src/unix/bsd/freebsdlike/freebsd/mod.rs
+118 −55 src/unix/bsd/freebsdlike/mod.rs
+34 −2 src/unix/bsd/mod.rs
+27 −22 src/unix/bsd/netbsdlike/mod.rs
+117 −28 src/unix/bsd/netbsdlike/netbsd/mod.rs
+150 −30 src/unix/bsd/netbsdlike/openbsdlike/mod.rs
+2 −0 src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs
+57 −5 src/unix/haiku/mod.rs
+22 −0 src/unix/mod.rs
+5 −0 src/unix/newlib/arm/mod.rs
+605 −0 src/unix/newlib/mod.rs
+3 −0 src/unix/notbsd/android/b32/mod.rs
+2 −0 src/unix/notbsd/android/b32/x86.rs
+3 −0 src/unix/notbsd/android/b64/aarch64.rs
+5 −0 src/unix/notbsd/android/b64/x86_64.rs
+90 −4 src/unix/notbsd/android/mod.rs
+2 −0 src/unix/notbsd/linux/mips/mips32.rs
+2 −0 src/unix/notbsd/linux/mips/mips64.rs
+101 −5 src/unix/notbsd/linux/mips/mod.rs
+192 −12 src/unix/notbsd/linux/mod.rs
+12 −0 src/unix/notbsd/linux/musl/b32/arm.rs
+12 −0 src/unix/notbsd/linux/musl/b32/asmjs.rs
+12 −0 src/unix/notbsd/linux/musl/b32/mips.rs
+1 −0 src/unix/notbsd/linux/musl/b32/mod.rs
+12 −0 src/unix/notbsd/linux/musl/b32/x86.rs
+1 −0 src/unix/notbsd/linux/musl/b64/aarch64.rs
+12 −0 src/unix/notbsd/linux/musl/b64/mod.rs
+1 −0 src/unix/notbsd/linux/musl/b64/powerpc64.rs
+1 −0 src/unix/notbsd/linux/musl/b64/x86_64.rs
+19 −5 src/unix/notbsd/linux/musl/mod.rs
+13 −0 src/unix/notbsd/linux/other/b32/arm.rs
+12 −1 src/unix/notbsd/linux/other/b32/mod.rs
+9 −2 src/unix/notbsd/linux/other/b32/powerpc.rs
+392 −5 src/unix/notbsd/linux/other/b32/x86.rs
+12 −3 src/unix/notbsd/linux/other/b64/aarch64.rs
+1 −0 src/unix/notbsd/linux/other/b64/mod.rs
+10 −3 src/unix/notbsd/linux/other/b64/powerpc64.rs
+19 −0 src/unix/notbsd/linux/other/b64/sparc64.rs
+347 −6 src/unix/notbsd/linux/other/b64/x86_64.rs
+90 −3 src/unix/notbsd/linux/other/mod.rs
+194 −2 src/unix/notbsd/linux/s390x.rs
+34 −5 src/unix/notbsd/mod.rs
+157 −60 src/unix/solaris/mod.rs
+13 −6 src/unix/uclibc/mod.rs
+64 −15 src/unix/uclibc/x86_64/mod.rs
+12 −0 src/windows.rs
15 changes: 15 additions & 0 deletions src/librustc/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-env-changed=CFG_LIBDIR_RELATIVE");
println!("cargo:rerun-if-env-changed=CFG_COMPILER_HOST_TRIPLE");
}
2 changes: 1 addition & 1 deletion src/librustc/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,7 @@ not apply to structs.
representation of enums isn't strictly defined in Rust, and this attribute
won't work on enums.

`#[repr(simd)]` will give a struct consisting of a homogenous series of machine
`#[repr(simd)]` will give a struct consisting of a homogeneous series of machine
types (i.e. `u8`, `i32`, etc) a representation that permits vectorization via
SIMD. This doesn't make much sense for enums since they don't consist of a
single list of data.
Expand Down
4 changes: 4 additions & 0 deletions src/librustc/hir/def_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ impl DefIndex {
pub fn as_array_index(&self) -> usize {
(self.0 & !DEF_INDEX_HI_START.0) as usize
}

pub fn from_array_index(i: usize, address_space: DefIndexAddressSpace) -> DefIndex {
DefIndex::new(address_space.start() + i)
}
}

/// The start of the "high" range of DefIndexes.
Expand Down
Loading