Skip to content

Rollup of 11 pull requests #43316

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 22 commits into from
Jul 19, 2017
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
aca6cd0
Update docs on Error struct. #29355
rthomas Jun 22, 2017
c329311
Update merge queue link
feadoor Jul 17, 2017
2e8859c
libstd: remove redundant & from &Path::new(...)
nodakai Jul 17, 2017
2d6c10f
Fix "Quasi-quoting is inefficient" warning in incremental rustbuild.
kennytm Jul 17, 2017
1ac98ae
`std::time::Duration`: improve _precision_ of terminology in docs
cjsut Jul 17, 2017
6f80cd7
redox: handle multiple paths in PATH
ids1024 Jul 18, 2017
ffefc9a
float_bits_conv made it into 1.20
est31 Jul 18, 2017
a7eb87e
Change Travis CI job order.
kennytm Jul 15, 2017
e185c6c
powerpc: Ignore the stack-probes test
lu-zero Jul 18, 2017
de7decc
Fix erroneous reference to Arc instead of Rc
lynn Jul 18, 2017
8340f74
travis: Switch `curl -s` to `curl -f`
alexcrichton Jul 18, 2017
b83285b
Rollup merge of #42837 - rthomas:29355-error, r=steveklabnik
Mark-Simulacrum Jul 18, 2017
413ef50
Rollup merge of #43282 - feadoor:patch-1, r=nikomatsakis
Mark-Simulacrum Jul 18, 2017
6a56671
Rollup merge of #43287 - kennytm:travis-ci-adjustments, r=alexcrichton
Mark-Simulacrum Jul 18, 2017
751c6e2
Rollup merge of #43290 - nodakai:fix-ref-path-new, r=Mark-Simulacrum
Mark-Simulacrum Jul 18, 2017
ac9e9e5
Rollup merge of #43292 - kennytm:fix-quasi-quoting-warning-in-rustbui…
Mark-Simulacrum Jul 18, 2017
f568249
Rollup merge of #43294 - insaneinside:std-time-duration-docs, r=aturon
Mark-Simulacrum Jul 18, 2017
b43f58b
Rollup merge of #43304 - ids1024:path2, r=aturon
Mark-Simulacrum Jul 18, 2017
0d004c5
Rollup merge of #43310 - lynn:rc-weak-doc-fix, r=apasel422
Mark-Simulacrum Jul 18, 2017
fc7f0fd
Rollup merge of #43312 - lu-zero:master, r=alexcrichton
Mark-Simulacrum Jul 18, 2017
21a7b26
Rollup merge of #43314 - alexcrichton:fail-curl, r=aidanhs
Mark-Simulacrum Jul 18, 2017
dc6606e
Rollup merge of #43315 - est31:stabilize_float_bits_conv, r=alexcrichton
Mark-Simulacrum Jul 18, 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
205 changes: 106 additions & 99 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -11,43 +11,28 @@ git:
matrix:
fast_finish: true
include:
# Linux builders, all docker images
- env: IMAGE=arm-android
- env: IMAGE=armhf-gnu
- env: IMAGE=cross DEPLOY=1
- env: IMAGE=dist-aarch64-linux DEPLOY=1
- env: IMAGE=dist-android DEPLOY=1
- env: IMAGE=dist-arm-linux DEPLOY=1
- env: IMAGE=dist-armhf-linux DEPLOY=1
- env: IMAGE=dist-armv7-linux DEPLOY=1
- env: IMAGE=dist-fuchsia DEPLOY=1
- env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
- env: IMAGE=dist-i686-freebsd DEPLOY=1
- env: IMAGE=dist-i686-linux DEPLOY=1
- env: IMAGE=dist-mips-linux DEPLOY=1
- env: IMAGE=dist-mips64-linux DEPLOY=1
- env: IMAGE=dist-mips64el-linux DEPLOY=1
- env: IMAGE=dist-mipsel-linux DEPLOY=1
- env: IMAGE=dist-powerpc-linux DEPLOY=1
- env: IMAGE=dist-powerpc64-linux DEPLOY=1
- env: IMAGE=dist-powerpc64le-linux DEPLOY=1
- env: IMAGE=dist-s390x-linux DEPLOY=1
- env: IMAGE=dist-x86_64-freebsd DEPLOY=1
- env: IMAGE=dist-x86_64-linux DEPLOY=1 ALLOW_TRY=1
- env: IMAGE=dist-x86_64-musl DEPLOY=1
- env: IMAGE=dist-x86_64-netbsd DEPLOY=1
- env: IMAGE=asmjs
- env: IMAGE=i686-gnu
- env: IMAGE=i686-gnu-nopt
# - env: IMAGE=wasm32 issue 42646
- env: IMAGE=x86_64-gnu
- env: IMAGE=x86_64-gnu-full-bootstrap
- env: IMAGE=x86_64-gnu-aux
- env: IMAGE=x86_64-gnu-debug
- env: IMAGE=x86_64-gnu-nopt
# Images used in testing PR and try-build should be run first.
- env: IMAGE=x86_64-gnu-llvm-3.7 ALLOW_PR=1 RUST_BACKTRACE=1
- env: IMAGE=x86_64-gnu-distcheck
- env: IMAGE=x86_64-gnu-incremental
- env: IMAGE=dist-x86_64-linux DEPLOY=1 ALLOW_TRY=1

# "alternate" deployments, these are "nightlies" but don't have assertions
# turned on, they're deployed to a different location primarily for projects
# which are stuck on nightly and don't want llvm assertions in the artifacts
# that they use.
- env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1
- env: >
RUST_CHECK_TARGET=dist
RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler"
SRC=.
DEPLOY_ALT=1
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
SCCACHE_ERROR_LOG=/tmp/sccache.log
MACOSX_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode7

# macOS builders. These are placed near the beginning because they are very
# slow to run.

# OSX builders running tests, these run the full test suite.
#
@@ -63,11 +48,6 @@ matrix:
MACOSX_STD_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode8.2
install: &osx_install_sccache >
travis_retry curl -fo /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-apple-darwin &&
chmod +x /usr/local/bin/sccache &&
travis_retry curl -fo /usr/local/bin/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
chmod +x /usr/local/bin/stamp
- env: >
RUST_CHECK_TARGET=check
RUST_CONFIGURE_ARGS=--build=i686-apple-darwin
@@ -78,7 +58,6 @@ matrix:
MACOSX_STD_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode8.2
install: *osx_install_sccache

# OSX builders producing releases. These do not run the full test suite and
# just produce a bunch of artifacts.
@@ -96,10 +75,6 @@ matrix:
MACOSX_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode7
install:
- travis_retry brew update
- travis_retry brew install xz
- *osx_install_sccache
- env: >
RUST_CHECK_TARGET=dist
RUST_CONFIGURE_ARGS="--target=aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios --enable-extended --enable-sanitizers --enable-profiler"
@@ -110,30 +85,42 @@ matrix:
MACOSX_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode7
install:
- travis_retry brew update
- travis_retry brew install xz
- *osx_install_sccache

# "alternate" deployments, these are "nightlies" but don't have assertions
# turned on, they're deployed to a different location primarily for projects
# which are stuck on nightly and don't want llvm assertions in the artifacts
# that they use.
- env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1
- env: >
RUST_CHECK_TARGET=dist
RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler"
SRC=.
DEPLOY_ALT=1
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
SCCACHE_ERROR_LOG=/tmp/sccache.log
MACOSX_DEPLOYMENT_TARGET=10.7
os: osx
osx_image: xcode7
install:
- travis_retry brew update
- travis_retry brew install xz
- *osx_install_sccache
# Linux builders, remaining docker images
- env: IMAGE=arm-android
- env: IMAGE=armhf-gnu
- env: IMAGE=cross DEPLOY=1
- env: IMAGE=dist-aarch64-linux DEPLOY=1
- env: IMAGE=dist-android DEPLOY=1
- env: IMAGE=dist-arm-linux DEPLOY=1
- env: IMAGE=dist-armhf-linux DEPLOY=1
- env: IMAGE=dist-armv7-linux DEPLOY=1
- env: IMAGE=dist-fuchsia DEPLOY=1
- env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
- env: IMAGE=dist-i686-freebsd DEPLOY=1
- env: IMAGE=dist-i686-linux DEPLOY=1
- env: IMAGE=dist-mips-linux DEPLOY=1
- env: IMAGE=dist-mips64-linux DEPLOY=1
- env: IMAGE=dist-mips64el-linux DEPLOY=1
- env: IMAGE=dist-mipsel-linux DEPLOY=1
- env: IMAGE=dist-powerpc-linux DEPLOY=1
- env: IMAGE=dist-powerpc64-linux DEPLOY=1
- env: IMAGE=dist-powerpc64le-linux DEPLOY=1
- env: IMAGE=dist-s390x-linux DEPLOY=1
- env: IMAGE=dist-x86_64-freebsd DEPLOY=1
- env: IMAGE=dist-x86_64-musl DEPLOY=1
- env: IMAGE=dist-x86_64-netbsd DEPLOY=1
- env: IMAGE=asmjs
- env: IMAGE=i686-gnu
- env: IMAGE=i686-gnu-nopt
# - env: IMAGE=wasm32 issue 42646
- env: IMAGE=x86_64-gnu
- env: IMAGE=x86_64-gnu-full-bootstrap
- env: IMAGE=x86_64-gnu-aux
- env: IMAGE=x86_64-gnu-debug
- env: IMAGE=x86_64-gnu-nopt
- env: IMAGE=x86_64-gnu-distcheck
- env: IMAGE=x86_64-gnu-incremental

env:
global:
@@ -142,41 +129,64 @@ env:
# AWS_SECRET_ACCESS_KEY=...
- secure: "Pixhh0hXDqGCdOyLtGFjli3J2AtDWIpyb2btIrLe956nCBDRutRoMm6rv5DI9sFZN07Mms7VzNNvhc9wCW1y63JAm414d2Co7Ob8kWMZlz9l9t7ACHuktUiis8yr+S4Quq1Vqd6pqi7pf2J++UxC8R/uLeqVrubzr6+X7AbmEFE="

# Note that this is overridden on OSX builders
install: >
travis_retry curl -fo $HOME/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-unknown-linux-musl &&
chmod +x $HOME/stamp &&
export PATH=$PATH:$HOME
before_install:
# If we are building a pull request, do the build if $ALLOW_PR == 1
# Otherwise, do the build if we are on the auto branch, or the try branch and $ALLOW_TRY == 1
- >
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
if [[ "$ALLOW_PR" == "1" ]]; then
export SKIP_BUILD=false;
else
export SKIP_BUILD=true;
fi;
elif [[ "$TRAVIS_BRANCH" == "auto" || ( "$ALLOW_TRY" == "1" && "$TRAVIS_BRANCH" == "try" ) ]]; then
export SKIP_BUILD=false;
else
export SKIP_BUILD=true;
fi
- >
if [[ "$SKIP_BUILD" == false ]]; then
zcat $HOME/docker/rust-ci.tar.gz | docker load || true
fi
- mkdir -p $HOME/rustsrc

install:
- >
if [[ "$SKIP_BUILD" == true ]]; then
echo echo skipping, not a full build > $HOME/stamp &&
chmod +x $HOME/stamp &&
export PATH=$PATH:$HOME;
else
case "$TRAVIS_OS_NAME" in
linux)
travis_retry curl -fo $HOME/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-unknown-linux-musl &&
chmod +x $HOME/stamp &&
export PATH=$PATH:$HOME
;;
osx)
if [[ "$RUST_CHECK_TARGET" == dist ]]; then
travis_retry brew update &&
travis_retry brew install xz;
fi &&
travis_retry curl -fo /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-apple-darwin &&
chmod +x /usr/local/bin/sccache &&
travis_retry curl -fo /usr/local/bin/stamp https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
chmod +x /usr/local/bin/stamp
;;
esac
fi

before_script:
- >
echo "#### Disk usage before running script:";
df -h;
du . | sort -nr | head -n100
# If we are building a pull request, do the build if $ALLOW_PR == 1
# Otherwise, do the build if we are on the auto branch, or the try branch and $ALLOW_TRY == 1
- >
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
if [[ "$ALLOW_PR" == "1" ]]; then
SKIP_BUILD=false;
else
SKIP_BUILD=true;
fi
elif [[ "$TRAVIS_BRANCH" == "auto" || ( "$ALLOW_TRY" == "1" && "$TRAVIS_BRANCH" == "try" ) ]]; then
SKIP_BUILD=false;
RUN_SCRIPT="src/ci/init_repo.sh . $HOME/rustsrc";
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
export RUN_SCRIPT="$RUN_SCRIPT && src/ci/run.sh";
else
SKIP_BUILD=true;
fi

if [[ "$SKIP_BUILD" == true ]]; then
export RUN_SCRIPT="echo 'skipping, not a full build'";
else
RUN_SCRIPT="src/ci/init_repo.sh . $HOME/rustsrc";
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
export RUN_SCRIPT="$RUN_SCRIPT && src/ci/run.sh";
else
export RUN_SCRIPT="$RUN_SCRIPT && src/ci/docker/run.sh $IMAGE";
fi
export RUN_SCRIPT="$RUN_SCRIPT && src/ci/docker/run.sh $IMAGE";
fi

# Log time information from this machine and an external machine for insight into possible
@@ -223,9 +233,6 @@ before_cache:
grep -v missing |
xargs docker save |
gzip > $HOME/docker/rust-ci.tar.gz
before_install:
- zcat $HOME/docker/rust-ci.tar.gz | docker load || true
- mkdir -p $HOME/rustsrc

notifications:
email: false
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -289,7 +289,7 @@ been approved. The PR then enters the [merge queue][merge-queue], where @bors
will run all the tests on every platform we support. If it all works out,
@bors will merge your code into `master` and close the pull request.

[merge-queue]: https://buildbot.rust-lang.org/homu/queue/rust
[merge-queue]: https://buildbot2.rust-lang.org/homu/queue/rust

Speaking of tests, Rust has a comprehensive test suite. More information about
it can be found
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/android-ndk.sh
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ URL=https://dl.google.com/android/repository
download_ndk() {
mkdir -p /android/ndk
cd /android/ndk
curl -sO $URL/$1
curl -fO $URL/$1
unzip -q $1
rm $1
mv android-ndk-* ndk
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/android-sdk.sh
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ URL=https://dl.google.com/android/repository
download_sdk() {
mkdir -p /android/sdk
cd /android/sdk
curl -sO $URL/$1
curl -fO $URL/$1
unzip -q $1
rm -rf $1
}
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/crosstool-ng.sh
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
set -ex

url="http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.22.0.tar.bz2"
curl -s $url | tar xjf -
curl -f $url | tar xjf -
cd crosstool-ng
./configure --prefix=/usr/local
make -j$(nproc)
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/dumb-init.sh
Original file line number Diff line number Diff line change
@@ -10,6 +10,6 @@

set -ex

curl -sOL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb
curl -fOL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb
dpkg -i dumb-init_*.deb
rm dumb-init_*.deb
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/emscripten-wasm.sh
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ exit 1
}

# Download last known good emscripten from WebAssembly waterfall
BUILD=$(curl -sL https://storage.googleapis.com/wasm-llvm/builds/linux/lkgr.json | \
BUILD=$(curl -fL https://storage.googleapis.com/wasm-llvm/builds/linux/lkgr.json | \
jq '.build | tonumber')
curl -sL https://storage.googleapis.com/wasm-llvm/builds/linux/$BUILD/wasm-binaries.tbz2 | \
hide_output tar xvkj
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/emscripten.sh
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ exit 1
}

cd /
curl -sL https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
curl -fL https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz | \
tar -xz

cd /emsdk-portable
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/make3.sh
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@

set -ex

curl -s https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf -
curl -f https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf -
cd make-3.81
./configure --prefix=/usr
make
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/sccache.sh
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@

set -ex

curl -so /usr/local/bin/sccache \
curl -fo /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-05-12-sccache-x86_64-unknown-linux-musl

chmod +x /usr/local/bin/sccache
2 changes: 1 addition & 1 deletion src/liballoc/rc.rs
Original file line number Diff line number Diff line change
@@ -973,7 +973,7 @@ impl<T> From<T> for Rc<T> {
/// A `Weak` pointer is useful for keeping a temporary reference to the value
/// within [`Rc`] without extending its lifetime. It is also used to prevent
/// circular references between [`Rc`] pointers, since mutual owning references
/// would never allow either [`Arc`] to be dropped. For example, a tree could
/// would never allow either [`Rc`] to be dropped. For example, a tree could
/// have strong [`Rc`] pointers from parent nodes to children, and `Weak`
/// pointers from children back to their parents.
///
2 changes: 1 addition & 1 deletion src/libcore/default.rs
Original file line number Diff line number Diff line change
@@ -126,7 +126,7 @@ pub trait Default: Sized {
}

macro_rules! default_impl {
($t:ty, $v:expr, $doc:expr) => {
($t:ty, $v:expr, $doc:tt) => {
#[stable(feature = "rust1", since = "1.0.0")]
impl Default for $t {
#[inline]
16 changes: 16 additions & 0 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
@@ -81,6 +81,22 @@ pub type Result = result::Result<(), Error>;
/// This type does not support transmission of an error other than that an error
/// occurred. Any extra information must be arranged to be transmitted through
/// some other means.
///
/// An important thing to remember is that the type `fmt::Error` should not be
/// confused with `std::io::Error` or `std::error::Error`, which you may also
/// have in scope.
///
/// # Examples
///
/// ```rust
/// use std::fmt::{self, write};
///
/// let mut output = String::new();
/// match write(&mut output, format_args!("Hello {}!", "world")) {
/// Err(fmt::Error) => panic!("An error occurred"),
/// _ => (),
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Error;
4 changes: 2 additions & 2 deletions src/libstd/f32.rs
Original file line number Diff line number Diff line change
@@ -1094,7 +1094,7 @@ impl f32 {
/// assert_eq!((12.5f32).to_bits(), 0x41480000);
///
/// ```
#[stable(feature = "float_bits_conv", since = "1.21.0")]
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[inline]
pub fn to_bits(self) -> u32 {
unsafe { ::mem::transmute(self) }
@@ -1125,7 +1125,7 @@ impl f32 {
/// let snan = 0x7F800001;
/// assert_ne!(f32::from_bits(snan).to_bits(), snan);
/// ```
#[stable(feature = "float_bits_conv", since = "1.21.0")]
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[inline]
pub fn from_bits(mut v: u32) -> Self {
const EXP_MASK: u32 = 0x7F800000;
4 changes: 2 additions & 2 deletions src/libstd/f64.rs
Original file line number Diff line number Diff line change
@@ -1009,7 +1009,7 @@ impl f64 {
/// assert_eq!((12.5f64).to_bits(), 0x4029000000000000);
///
/// ```
#[stable(feature = "float_bits_conv", since = "1.21.0")]
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[inline]
pub fn to_bits(self) -> u64 {
unsafe { ::mem::transmute(self) }
@@ -1040,7 +1040,7 @@ impl f64 {
/// let snan = 0x7FF0000000000001;
/// assert_ne!(f64::from_bits(snan).to_bits(), snan);
/// ```
#[stable(feature = "float_bits_conv", since = "1.21.0")]
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[inline]
pub fn from_bits(mut v: u64) -> Self {
const EXP_MASK: u64 = 0x7FF0000000000000;
6 changes: 3 additions & 3 deletions src/libstd/fs.rs
Original file line number Diff line number Diff line change
@@ -2346,17 +2346,17 @@ mod tests {

#[test]
fn recursive_mkdir_slash() {
check!(fs::create_dir_all(&Path::new("/")));
check!(fs::create_dir_all(Path::new("/")));
}

#[test]
fn recursive_mkdir_dot() {
check!(fs::create_dir_all(&Path::new(".")));
check!(fs::create_dir_all(Path::new(".")));
}

#[test]
fn recursive_mkdir_empty() {
check!(fs::create_dir_all(&Path::new("")));
check!(fs::create_dir_all(Path::new("")));
}

#[test]
4 changes: 2 additions & 2 deletions src/libstd/sys/redox/net/tcp.rs
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ impl TcpStream {
let mut options = OpenOptions::new();
options.read(true);
options.write(true);
Ok(TcpStream(File::open(&Path::new(path.as_str()), &options)?))
Ok(TcpStream(File::open(Path::new(path.as_str()), &options)?))
}

pub fn connect_timeout(_addr: &SocketAddr, _timeout: Duration) -> Result<TcpStream> {
@@ -177,7 +177,7 @@ impl TcpListener {
let mut options = OpenOptions::new();
options.read(true);
options.write(true);
Ok(TcpListener(File::open(&Path::new(path.as_str()), &options)?))
Ok(TcpListener(File::open(Path::new(path.as_str()), &options)?))
}

pub fn accept(&self) -> Result<(TcpStream, SocketAddr)> {
2 changes: 1 addition & 1 deletion src/libstd/sys/redox/net/udp.rs
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ impl UdpSocket {
let mut options = OpenOptions::new();
options.read(true);
options.write(true);
Ok(UdpSocket(File::open(&Path::new(path.as_str()), &options)?, UnsafeCell::new(None)))
Ok(UdpSocket(File::open(Path::new(path.as_str()), &options)?, UnsafeCell::new(None)))
}

fn get_conn(&self) -> &mut Option<SocketAddr> {
6 changes: 3 additions & 3 deletions src/libstd/sys/redox/os.rs
Original file line number Diff line number Diff line change
@@ -73,10 +73,10 @@ pub fn split_paths(unparsed: &OsStr) -> SplitPaths {
fn bytes_to_path(b: &[u8]) -> PathBuf {
PathBuf::from(<OsStr as OsStrExt>::from_bytes(b))
}
fn is_colon(b: &u8) -> bool { *b == b':' }
fn is_semicolon(b: &u8) -> bool { *b == b';' }
let unparsed = unparsed.as_bytes();
SplitPaths {
iter: unparsed.split(is_colon as fn(&u8) -> bool)
iter: unparsed.split(is_semicolon as fn(&u8) -> bool)
.map(bytes_to_path as fn(&[u8]) -> PathBuf)
}
}
@@ -94,7 +94,7 @@ pub fn join_paths<I, T>(paths: I) -> Result<OsString, JoinPathsError>
where I: Iterator<Item=T>, T: AsRef<OsStr>
{
let mut joined = Vec::new();
let sep = b':';
let sep = b';';

for (i, path) in paths.enumerate() {
let path = path.as_ref().as_bytes();
39 changes: 23 additions & 16 deletions src/libstd/sys/redox/process.rs
Original file line number Diff line number Diff line change
@@ -9,11 +9,12 @@
// except according to those terms.

use collections::hash_map::HashMap;
use env;
use env::{self, split_paths};
use ffi::OsStr;
use os::unix::ffi::OsStrExt;
use fmt;
use io::{self, Error, ErrorKind};
use path::Path;
use path::{Path, PathBuf};
use sys::fd::FileDesc;
use sys::fs::{File, OpenOptions};
use sys::pipe::{self, AnonPipe};
@@ -313,23 +314,29 @@ impl Command {
}

let program = if self.program.contains(':') || self.program.contains('/') {
self.program.to_owned()
} else {
let mut path_env = ::env::var("PATH").unwrap_or(".".to_string());

if ! path_env.ends_with('/') {
path_env.push('/');
Some(PathBuf::from(&self.program))
} else if let Ok(path_env) = ::env::var("PATH") {
let mut program = None;
for mut path in split_paths(&path_env) {
path.push(&self.program);
if path.exists() {
program = Some(path);
break;
}
}

path_env.push_str(&self.program);

path_env
program
} else {
None
};

if let Err(err) = syscall::execve(&program, &args) {
io::Error::from_raw_os_error(err.errno as i32)
if let Some(program) = program {
if let Err(err) = syscall::execve(program.as_os_str().as_bytes(), &args) {
io::Error::from_raw_os_error(err.errno as i32)
} else {
panic!("return from exec without err");
}
} else {
panic!("return from exec without err");
io::Error::new(io::ErrorKind::NotFound, "")
}
}

@@ -393,7 +400,7 @@ impl Stdio {
let mut opts = OpenOptions::new();
opts.read(readable);
opts.write(!readable);
let fd = File::open(&Path::new("null:"), &opts)?;
let fd = File::open(Path::new("null:"), &opts)?;
Ok((ChildStdio::Owned(fd.into_fd()), None))
}
}
6 changes: 3 additions & 3 deletions src/libstd/sys/redox/syscall/call.rs
Original file line number Diff line number Diff line change
@@ -77,9 +77,9 @@ pub fn dup2(fd: usize, newfd: usize, buf: &[u8]) -> Result<usize> {
}

/// Replace the current process with a new executable
pub fn execve(path: &str, args: &[[usize; 2]]) -> Result<usize> {
unsafe { syscall4(SYS_EXECVE, path.as_ptr() as usize, path.len(),
args.as_ptr() as usize, args.len()) }
pub fn execve<T: AsRef<[u8]>>(path: T, args: &[[usize; 2]]) -> Result<usize> {
unsafe { syscall4(SYS_EXECVE, path.as_ref().as_ptr() as usize,
path.as_ref().len(), args.as_ptr() as usize, args.len()) }
}

/// Exit the current process
30 changes: 16 additions & 14 deletions src/libstd/time/duration.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
@@ -18,9 +18,10 @@ const MILLIS_PER_SEC: u64 = 1_000;
/// A `Duration` type to represent a span of time, typically used for system
/// timeouts.
///
/// Each `Duration` is composed of a number of seconds and nanosecond precision.
/// APIs binding a system timeout will typically round up the nanosecond
/// precision if the underlying system does not support that level of precision.
/// Each `Duration` is composed of a whole number of seconds and a fractional part
/// represented in nanoseconds. If the underlying system does not support
/// nanosecond-level precision, APIs binding a system timeout will typically round up
/// the number of nanoseconds.
///
/// `Duration`s implement many common traits, including [`Add`], [`Sub`], and other
/// [`ops`] traits.
@@ -50,11 +51,11 @@ pub struct Duration {
}

impl Duration {
/// Creates a new `Duration` from the specified number of seconds and
/// additional nanosecond precision.
/// Creates a new `Duration` from the specified number of whole seconds and
/// additional nanoseconds.
///
/// If the nanoseconds is greater than 1 billion (the number of nanoseconds
/// in a second), then it will carry over into the seconds provided.
/// If the number of nanoseconds is greater than 1 billion (the number of
/// nanoseconds in a second), then it will carry over into the seconds provided.
///
/// # Panics
///
@@ -77,7 +78,7 @@ impl Duration {
Duration { secs: secs, nanos: nanos }
}

/// Creates a new `Duration` from the specified number of seconds.
/// Creates a new `Duration` from the specified number of whole seconds.
///
/// # Examples
///
@@ -115,10 +116,10 @@ impl Duration {
Duration { secs: secs, nanos: nanos }
}

/// Returns the number of whole seconds represented by this `Duration`.
/// Returns the number of _whole_ seconds contained by this `Duration`.
///
/// The extra precision represented by this duration is ignored (i.e. extra
/// nanoseconds are not represented in the returned value).
/// The returned value does not include the fractional (nanosecond) part of the
/// duration, which can be obtained using [`subsec_nanos`].
///
/// # Examples
///
@@ -147,7 +148,7 @@ impl Duration {
#[inline]
pub fn as_secs(&self) -> u64 { self.secs }

/// Returns the nanosecond precision represented by this `Duration`.
/// Returns the fractional part of this `Duration`, in nanoseconds.
///
/// This method does **not** return the length of the duration when
/// represented by nanoseconds. The returned number always represents a
@@ -159,7 +160,8 @@ impl Duration {
/// use std::time::Duration;
///
/// let duration = Duration::from_millis(5010);
/// assert_eq!(duration.subsec_nanos(), 10000000);
/// assert_eq!(duration.as_secs(), 5);
/// assert_eq!(duration.subsec_nanos(), 10_000_000);
/// ```
#[stable(feature = "duration", since = "1.3.0")]
#[inline]
1 change: 1 addition & 0 deletions src/test/codegen/stack-probes.rs
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
// except according to those terms.

// ignore-arm
// ignore-powerpc
// ignore-wasm
// ignore-emscripten
// ignore-windows