]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoStabilize RangeArgument
Steven Fackler [Mon, 19 Jun 2017 05:01:29 +0000 (22:01 -0700)]
Stabilize RangeArgument

Move it and Bound to core::ops while we're at it.

Closes #30877

7 years agoStabilize ThreadId
Steven Fackler [Thu, 8 Jun 2017 15:41:23 +0000 (11:41 -0400)]
Stabilize ThreadId

Closes #21507

7 years agoStabilize OsString::shrink_to_fit
Steven Fackler [Thu, 8 Jun 2017 15:35:46 +0000 (11:35 -0400)]
Stabilize OsString::shrink_to_fit

Closes #40421

7 years agoStabilize cmp::Reverse
Steven Fackler [Thu, 8 Jun 2017 15:34:22 +0000 (11:34 -0400)]
Stabilize cmp::Reverse

Closes #40893

7 years agoStabilize Command::envs
Steven Fackler [Thu, 8 Jun 2017 15:31:25 +0000 (11:31 -0400)]
Stabilize Command::envs

Closes #38526

7 years agoAuto merge of #42784 - tlively:wasm-bot, r=alexcrichton
bors [Sat, 24 Jun 2017 22:34:08 +0000 (22:34 +0000)]
Auto merge of #42784 - tlively:wasm-bot, r=alexcrichton

Make wasm32 buildbot test LLVM backend

This adds the experimental targets option to configure so it can be used
by the builders and changes the wasm32 Dockerfile accordingly. Instead
of using LLVM from the emsdk, the builder's emscripten tools now uses
the Rust in-tree LLVM, since this is the one built with wasm support.

7 years agoRestore old emscripten.sh for use by asmjs
Thomas Lively [Sat, 24 Jun 2017 18:35:48 +0000 (11:35 -0700)]
Restore old emscripten.sh for use by asmjs

7 years agoAuto merge of #42864 - slo1:attempt, r=Mark-Simulacrum
bors [Sat, 24 Jun 2017 14:43:01 +0000 (14:43 +0000)]
Auto merge of #42864 - slo1:attempt, r=Mark-Simulacrum

Saves created temp directory if save-temps option is used.

Should fix #38068.

7 years agoAuto merge of #42541 - gilescope:patch-1, r=alexcrichton
bors [Sat, 24 Jun 2017 12:18:40 +0000 (12:18 +0000)]
Auto merge of #42541 - gilescope:patch-1, r=alexcrichton

assert_eq failure message easier to read

By having the left and right strings aligned with one another it helps spot the difference between the two far quicker than if they are on the same line.

E.g.
Before:

```
thread 'tests::test_safe_filename' panicked at 'assertion failed: `(left == right)` left:  `"-aandb--S123.html"` right: `"-aandb-S123.html"`',
```

After:

```
thread 'tests::test_safe_filename' panicked at 'assertion failed: `(left == right)`
left:  `"-aandb--S123.html"`
right: `"-aandb-S123.html"`',
```

When the strings are both on the same line it take a lot longer to spot the difference. It is a small change but the small time savings add up with repetition. This would help Rust be an excellent language to write tests in out of the box.

Closes https://github.com/rust-lang/rust/issues/41615

7 years agoAuto merge of #42854 - razielgn:relaxed-debug-constraints-on-maps-iterators, r=sfackler
bors [Sat, 24 Jun 2017 09:32:20 +0000 (09:32 +0000)]
Auto merge of #42854 - razielgn:relaxed-debug-constraints-on-maps-iterators, r=sfackler

Relaxed Debug constraints on {HashMap,BTreeMap}::{Keys,Values}.

I has hit by this yesterday too. ðŸ˜„
And I've realised that Debug for BTreeMap::{Keys,Values} wasn't formatting just keys and values respectively, but the whole map. ðŸ¤”

Fixed #41924

r? @jonhoo

7 years agoAuto merge of #42724 - Mark-Simulacrum:tests, r=alexcrichton
bors [Sat, 24 Jun 2017 07:10:10 +0000 (07:10 +0000)]
Auto merge of #42724 - Mark-Simulacrum:tests, r=alexcrichton

Add tests for a few issues.

Fixes #41998
Fixes #38381
Fixes #37515
Fixes #37510
Fixes #37366
Fixes #37323
Fixes #37051
Fixes #36839
Fixes #35570
Fixes #34373
Fixes #34222

Certainly not all of the E-needstest issues right now, but I started to get bored.

7 years agoAuto merge of #42687 - alexcrichton:windows-tls, r=sfackler
bors [Sat, 24 Jun 2017 04:42:18 +0000 (04:42 +0000)]
Auto merge of #42687 - alexcrichton:windows-tls, r=sfackler

rustc: Enable #[thread_local] for Windows

I think LLVM has had support for quite some time now for this, we just never got
around to testing it out and binding it. We've had some trouble landing this in
the past I believe, but it's time to try again!

This commit flags the `#[thread_local]` attribute as being available for Windows
targets and adds an implementation of `register_dtor` in the `thread::local`
module to ensure we can destroy these keys. The same functionality is
implemented in clang via a function called `__tlregdtor` (presumably provided in
some Windows runtime somewhere), but this function unfortunately does not take a
data pointer (just a thunk) which means we can't easily call it. For now
destructors are just run in the same way the Linux fallback is implemented,
which is just keeping track via a single OS-based TLS key.

7 years agoAdd Target (de)serialization for environment vars
Thomas Lively [Sat, 24 Jun 2017 00:26:39 +0000 (17:26 -0700)]
Add Target (de)serialization for environment vars

Also turn WebAssembly backend back on in its builder.

7 years agorustc: Enable #[thread_local] for Windows
Alex Crichton [Wed, 17 Feb 2016 07:07:09 +0000 (23:07 -0800)]
rustc: Enable #[thread_local] for Windows

I think LLVM has had support for quite some time now for this, we just never got
around to testing it out and binding it. We've had some trouble landing this in
the past I believe, but it's time to try again!

This commit flags the `#[thread_local]` attribute as being available for Windows
targets and adds an implementation of `register_dtor` in the `thread::local`
module to ensure we can destroy these keys. The same functionality is
implemented in clang via a function called `__tlregdtor` (presumably provided in
some Windows runtime somewhere), but this function unfortunately does not take a
data pointer (just a thunk) which means we can't easily call it. For now
destructors are just run in the same way the Linux fallback is implemented,
which is just keeping track via a single OS-based TLS key.

7 years agoSaves created temp directory if save-temps option is used.
slo [Fri, 23 Jun 2017 17:20:23 +0000 (13:20 -0400)]
Saves created temp directory if save-temps option is used.

7 years agoAdd tests for a few issues.
Mark Simulacrum [Sat, 17 Jun 2017 20:43:10 +0000 (14:43 -0600)]
Add tests for a few issues.

7 years agoAuto merge of #42856 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Fri, 23 Jun 2017 13:46:43 +0000 (13:46 +0000)]
Auto merge of #42856 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 8 pull requests

- Successful merges: #42777, #42783, #42787, #42821, #42822, #42825, #42829, #42833
- Failed merges:

7 years agoRollup merge of #42833 - durka:non-constant-used-with-constant, r=Mark-Simulacrum
Mark Simulacrum [Fri, 23 Jun 2017 12:02:15 +0000 (06:02 -0600)]
Rollup merge of #42833 - durka:non-constant-used-with-constant, r=Mark-Simulacrum

change span label for E0435

r? @Mark-Simulacrum

7 years agoRollup merge of #42829 - ids1024:cxx, r=alexcrichton
Mark Simulacrum [Fri, 23 Jun 2017 12:02:14 +0000 (06:02 -0600)]
Rollup merge of #42829 - ids1024:cxx, r=alexcrichton

Set CXX_<target> in bootstrap

I came across this trying to cross-compile rustc for Redox. It was also mentioned in a comment on https://github.com/rust-lang/rust/pull/42206, but doesn't seem to have been corrected.

7 years agoRollup merge of #42825 - letheed:patch-1, r=alexcrichton
Mark Simulacrum [Fri, 23 Jun 2017 12:02:12 +0000 (06:02 -0600)]
Rollup merge of #42825 - letheed:patch-1, r=alexcrichton

Fix ref as mutable ref in std::rc::Rc doc

7 years agoRollup merge of #42822 - ChrisMacNaughton:guard-traits, r=alexcrichton
Mark Simulacrum [Fri, 23 Jun 2017 12:02:11 +0000 (06:02 -0600)]
Rollup merge of #42822 - ChrisMacNaughton:guard-traits, r=alexcrichton

Ensure Guard types impl Display & Debug

Fixes #24372

7 years agoRollup merge of #42821 - michaelwoerister:incr-debug-output-on-stderr, r=alexcrichton
Mark Simulacrum [Fri, 23 Jun 2017 12:02:10 +0000 (06:02 -0600)]
Rollup merge of #42821 - michaelwoerister:incr-debug-output-on-stderr, r=alexcrichton

Print -Zincremental-info to stderr instead of stdout.

Fixes #42583.

The [cargo-incremental](https://github.com/nikomatsakis/cargo-incremental) tool probably does not need to be updated. It already merges stdout and stderr before parsing the compiler's output.

r? @alexcrichton

7 years agoRollup merge of #42787 - zackmdavis:explain_E0562, r=GuillaumeGomez
Mark Simulacrum [Fri, 23 Jun 2017 12:02:09 +0000 (06:02 -0600)]
Rollup merge of #42787 - zackmdavis:explain_E0562, r=GuillaumeGomez

add extended information for E0562; impl Trait can only be a return type

r? @GuillaumeGomez

7 years agoRollup merge of #42783 - ids1024:redox-env, r=sfackler
Mark Simulacrum [Fri, 23 Jun 2017 12:02:08 +0000 (06:02 -0600)]
Rollup merge of #42783 - ids1024:redox-env, r=sfackler

Redox: Use create() instead of open() when setting env variable

See https://github.com/redox-os/kernel/pull/25.

7 years agoRollup merge of #42777 - kennytm:kill-ignore-doctest, r=estebank
Mark Simulacrum [Fri, 23 Jun 2017 12:02:08 +0000 (06:02 -0600)]
Rollup merge of #42777 - kennytm:kill-ignore-doctest, r=estebank

Remove most "```ignore" doc tests.

Unconditional ` ```ignore ` doc tests lead to outdated examples (e.g. https://github.com/rust-lang/rust/issues/42729#issuecomment-309346572). This PR tries to change all existing ` ```ignore ` tests into one of the following:

* Add import and declarations to ensure the code is run-pass
* If the code is not Rust, change to ` ```text `/` ```sh `/` ```json `/` ```dot `
* If the code is expected compile-fail, change to ` ```compile_fail `
* If the code is expected run-fail, change to ` ```should_panic `
* If the code can type-check but cannot link/run, change to ` ```no_run `
* Otherwise, add an explanation after the ` ```ignore `

The `--explain` handling is changed to cope with hidden lines from the error index.

Tidy is changed to reject any unexplained ` ```ignore ` and ` ```rust,ignore `.

7 years agoRelax Debug constraints when debugging {HashMap,BTreeMap}::{Keys,Values}.
Federico Ravasio [Fri, 23 Jun 2017 10:48:19 +0000 (12:48 +0200)]
Relax Debug constraints when debugging {HashMap,BTreeMap}::{Keys,Values}.

Fixed #41924.

7 years agoCorrectly iterate on keys/values when debugging BTreeMap::{Keys,Values}.
Federico Ravasio [Fri, 23 Jun 2017 10:47:43 +0000 (12:47 +0200)]
Correctly iterate on keys/values when debugging BTreeMap::{Keys,Values}.

7 years agoAdded a tidy check to disallow "```ignore" and "```rust,ignore".
kennytm [Tue, 20 Jun 2017 17:00:02 +0000 (01:00 +0800)]
Added a tidy check to disallow "```ignore" and "```rust,ignore".

7 years agoModify --explain to handle hidden code (`# ...`) and indented code blocks.
kennytm [Tue, 20 Jun 2017 07:53:03 +0000 (15:53 +0800)]
Modify --explain to handle hidden code (`# ...`) and indented code blocks.

7 years agoRemoved as many "```ignore" as possible.
kennytm [Tue, 20 Jun 2017 07:15:16 +0000 (15:15 +0800)]
Removed as many "```ignore" as possible.

Replaced by adding extra imports, adding hidden code (`# ...`), modifying
examples to be runnable (sorry Homura), specifying non-Rust code, and
converting to should_panic, no_run, or compile_fail.

Remaining "```ignore"s received an explanation why they are being ignored.

7 years agoAuto merge of #42828 - parched:umulo, r=alexcrichton
bors [Fri, 23 Jun 2017 05:25:22 +0000 (05:25 +0000)]
Auto merge of #42828 - parched:umulo, r=alexcrichton

Update LLVM to fix unsigned multiplication overflow

check for some targets, notably ARMv6-M.

Fixes https://github.com/rust-lang-nursery/compiler-builtins/issues/150

7 years agoAdd wasm32-experimental-emscripten to wasm builder
Thomas Lively [Fri, 23 Jun 2017 01:04:20 +0000 (18:04 -0700)]
Add wasm32-experimental-emscripten to wasm builder

This modifies the builder to download and use the LLVM tools from the
last known good build on the WebAssembly buildbot waterfall, since these
tools are built with the WebAssembly LLVM backend enabled.

7 years agoAdd target option for linker environment variables
Thomas Lively [Thu, 22 Jun 2017 22:16:54 +0000 (15:16 -0700)]
Add target option for linker environment variables

This is used in wasm32-experimental-emscripten to ensure that emscripten
links against the libc bitcode files produced by the wasm LLVM backend,
instead of using fastcomp.

7 years agoMake wasm32 buildbot test LLVM backend
Thomas Lively [Tue, 20 Jun 2017 20:37:58 +0000 (13:37 -0700)]
Make wasm32 buildbot test LLVM backend

This adds the experimental targets option to configure so it can be used
by the builders and changes the wasm32 Dockerfile accordingly. Instead
of using LLVM from the emsdk, the builder's emscripten tools now uses
the Rust in-tree LLVM, since this is the one built with wasm support.

7 years agoAuto merge of #42304 - Mark-Simulacrum:issue-37157, r=nikomatsakis
bors [Fri, 23 Jun 2017 00:32:40 +0000 (00:32 +0000)]
Auto merge of #42304 - Mark-Simulacrum:issue-37157, r=nikomatsakis

Print the two types in the span label for transmute errors.

Fixes #37157. I'm not entirely happy with the changes here but overall it's better in my opinion; we certainly avoid the odd language in that issue, which changes to:

```
error[E0512]: transmute called with differently sized types: <C as TypeConstructor<'a>>::T (size can vary because of <C as TypeConstructor>::T) to <C as TypeConstructor<'b>>::T (size can vary because of <C as TypeConstructor>::T)
 --> test.rs:8:5
  |
8 |     ::std::mem::transmute(x)
  |     ^^^^^^^^^^^^^^^^^^^^^ transmuting between <C as TypeConstructor<'a>>::T and <C as TypeConstructor<'b>>::T

error: aborting due to previous error(s)
```

7 years agoAuto merge of #42614 - GuillaumeGomez:new-error-codes, r=pnkfelix
bors [Thu, 22 Jun 2017 21:46:08 +0000 (21:46 +0000)]
Auto merge of #42614 - GuillaumeGomez:new-error-codes, r=pnkfelix

New error codes

Part of #42229.

cc @Susurrus @frewsxcv @QuietMisdreavus

7 years agoAdding training commer to be more consistent with prior format.
Giles Cope [Thu, 22 Jun 2017 21:18:57 +0000 (22:18 +0100)]
Adding training commer to be more consistent with prior format.

7 years agoremove duplicate E0435 test
Alex Burka [Thu, 22 Jun 2017 19:13:09 +0000 (19:13 +0000)]
remove duplicate E0435 test

7 years agochange span label for E0435 (fix #41871)
Alex Burka [Thu, 22 Jun 2017 19:10:56 +0000 (19:10 +0000)]
change span label for E0435 (fix #41871)

7 years agoMake Build.cxx() return a Result instead of panicking
Ian Douglas Scott [Thu, 22 Jun 2017 18:51:32 +0000 (11:51 -0700)]
Make Build.cxx() return a Result instead of panicking

7 years agoSet CXX_<target> in bootstrap
Ian Douglas Scott [Thu, 22 Jun 2017 17:42:10 +0000 (10:42 -0700)]
Set CXX_<target> in bootstrap

7 years agoAuto merge of #42634 - Zoxc:for-desugar2, r=nikomatsakis
bors [Thu, 22 Jun 2017 15:24:58 +0000 (15:24 +0000)]
Auto merge of #42634 - Zoxc:for-desugar2, r=nikomatsakis

Change the for-loop desugar so the `break` does not affect type inference. Fixes #42618

Rewrite the `for` loop desugaring to avoid contaminating the inference results. Under the older desugaring, `for x in vec![] { .. }` would erroneously type-check, even though the type of `vec![]` is unconstrained. (written by @nikomatsakis)

7 years agoEnsure Guard types impl Display & Debug
Chris MacNaughton [Thu, 22 Jun 2017 10:01:22 +0000 (12:01 +0200)]
Ensure Guard types impl Display & Debug

Fixes #24372

7 years agoFix ref as mutable ref in std::rc::Rc doc
Letheed [Thu, 22 Jun 2017 13:48:20 +0000 (15:48 +0200)]
Fix ref as mutable ref in std::rc::Rc doc

7 years agoAuto merge of #42824 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Thu, 22 Jun 2017 12:48:54 +0000 (12:48 +0000)]
Auto merge of #42824 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 4 pull requests

- Successful merges: #42799, #42804, #42805, #42806
- Failed merges:

7 years agoRollup merge of #42806 - ollie27:rustbuild_compiler_docs, r=alexcrichton
Mark Simulacrum [Thu, 22 Jun 2017 12:30:12 +0000 (06:30 -0600)]
Rollup merge of #42806 - ollie27:rustbuild_compiler_docs, r=alexcrichton

rustbuild: Fix compiler docs yet again

Add support for `-Z force-unstable-if-unmarked` to rustdoc.

r? @alexcrichton

7 years agoRollup merge of #42805 - stepancheg:forward-python, r=alexcrichton
Mark Simulacrum [Thu, 22 Jun 2017 12:30:11 +0000 (06:30 -0600)]
Rollup merge of #42805 - stepancheg:forward-python, r=alexcrichton

Pass path to python from bootstrap.py to bootstrap.rs

When bootstrap is executed with python not in `$PATH`, (e. g.
`c:\Python27\python.exe x.py test`) bootstrap cannot find python
and crashes.

This commit passes path to python in `BOOTSTRAP_PYTHON` env var.

7 years agoRollup merge of #42804 - Mark-Simulacrum:rustbuild-colors, r=alexcrichton
Mark Simulacrum [Thu, 22 Jun 2017 12:30:10 +0000 (06:30 -0600)]
Rollup merge of #42804 - Mark-Simulacrum:rustbuild-colors, r=alexcrichton

Make rustc errors colorful.

Rustbuild passes --message-format=json to Cargo to learn about the
dependencies for a given build, which then makes Cargo steal the
stderr/stdout for the compiler process, leading to non colorful output.
To avoid this, detection of stderr being a tty is added to rustbuild,
and an environment variable is used to communicate with the rustc shim.

Fixes https://github.com/rust-lang/rust/issues/42801.

r? @alexcrichton

7 years agoRollup merge of #42799 - leodasvacas:impl-clone-for-default-hasher, r=sfackler
Mark Simulacrum [Thu, 22 Jun 2017 12:30:09 +0000 (06:30 -0600)]
Rollup merge of #42799 - leodasvacas:impl-clone-for-default-hasher, r=sfackler

Impl Clone for DefaultHasher

It's useful for a hasher to be `Clone`. It's also strange for any type to not be `Clone`. `DefaultHasher` is not meant to be used directly, but being in std it can be useful as a placeholder. I don't see any forward compatibility hazard if the hasher is changed since it's very rare for something to not be `Clone`.

7 years agoAuto merge of #42798 - stepancheg:args-debug, r=sfackler
bors [Thu, 22 Jun 2017 10:34:21 +0000 (10:34 +0000)]
Auto merge of #42798 - stepancheg:args-debug, r=sfackler

Better Debug for Args and ArgsOs

Display actual args instead of two dots.

7 years agoPrint -Zincremental-info to stderr instead of stdout.
Michael Woerister [Thu, 22 Jun 2017 08:27:45 +0000 (10:27 +0200)]
Print -Zincremental-info to stderr instead of stdout.

7 years agoAuto merge of #42803 - michaelwoerister:msdia-workaround, r=vadimcn
bors [Thu, 22 Jun 2017 08:10:27 +0000 (08:10 +0000)]
Auto merge of #42803 - michaelwoerister:msdia-workaround, r=vadimcn

debuginfo: Work around crash-bug in MSDIA library

Fixes https://github.com/rust-lang/rust/issues/40477 (which also contains a description of the issue being fixed).

r? @vadimcn

7 years agodebuginfo: Work around crash-bug in MSDIA library
Michael Woerister [Wed, 21 Jun 2017 14:38:22 +0000 (17:38 +0300)]
debuginfo: Work around crash-bug in MSDIA library

7 years agoAuto merge of #42785 - Mark-Simulacrum:fix-verbose-bootstrap, r=alexcrichton
bors [Thu, 22 Jun 2017 05:50:58 +0000 (05:50 +0000)]
Auto merge of #42785 - Mark-Simulacrum:fix-verbose-bootstrap, r=alexcrichton

Fixes bootstrapping with custom cargo/rustc.

config.mk is now always read when parsing the configuration to prevent
this from reoccurring in the future, hopefully.

Fixes https://github.com/rust-lang/rust/issues/42543.

r? @alexcrichton

cc @infinity0 @kyrias

7 years agoAuto merge of #42682 - alexcrichton:jobserver, r=michaelwoerister
bors [Thu, 22 Jun 2017 00:32:42 +0000 (00:32 +0000)]
Auto merge of #42682 - alexcrichton:jobserver, r=michaelwoerister

Integrate jobserver support to parallel codegen

This commit integrates the `jobserver` crate into the compiler. The crate was
previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose
here is to two-fold:

* Primarily the compiler can cooperate with Cargo on parallelism. When you run
  `cargo build -j4` then this'll make sure that the entire build process between
  Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc
  instances which may all try to spawn lots of threads.

* Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver.
  This means that if you call cargo/rustc from `make` or another
  jobserver-compatible implementation it'll use foreign parallelism settings
  instead of creating new ones locally.

As the number of parallel codegen instances in the compiler continues to grow
over time with the advent of incremental compilation it's expected that this'll
become more of a problem, so this is intended to nip concurrent concerns in the
bud by having all the tools to cooperate!

Note that while rustc has support for itself creating a jobserver it's far more
likely that rustc will always use the jobserver configured by Cargo. Cargo today
will now set a jobserver unconditionally for rustc to use.

7 years agoUpdating cargo to latest
Giles Cope [Wed, 21 Jun 2017 23:50:06 +0000 (00:50 +0100)]
Updating cargo to latest

7 years agoAuto merge of #42771 - arielb1:no-inline-unwind, r=nagisa
bors [Wed, 21 Jun 2017 21:29:45 +0000 (21:29 +0000)]
Auto merge of #42771 - arielb1:no-inline-unwind, r=nagisa

mark calls in the unwind path as !noinline

The unwind path is always cold, so that should not have bad performance
implications.  This avoids catastrophic exponential inlining, and also
decreases the size of librustc.so by 1.5% (OTOH, the size of `libstd.so`
increased by 0.5% for some reason).

Fixes #41696.

r? @nagisa

7 years agorustbuild: Fix compiler docs yet again
Oliver Middleton [Wed, 21 Jun 2017 16:59:10 +0000 (17:59 +0100)]
rustbuild: Fix compiler docs yet again

Add support for `-Z force-unstable-if-unmarked` to rustdoc.

7 years agoMake rustc errors colorful.
Mark Simulacrum [Wed, 21 Jun 2017 16:04:21 +0000 (10:04 -0600)]
Make rustc errors colorful.

Rustbuild passes --message-format=json to Cargo to learn about the
dependencies for a given build, which then makes Cargo steal the
stderr/stdout for the compiler process, leading to non colorful output.
To avoid this, detection of stderr being a tty is added to rustbuild,
and an environment variable is used to communicate with the rustc shim.

7 years agoPass path to python from bootstrap.py to bootstrap.rs
Stepan Koltsov [Wed, 21 Jun 2017 16:01:24 +0000 (19:01 +0300)]
Pass path to python from bootstrap.py to bootstrap.rs

When bootstrap is executed with python not in `$PATH`, (e. g.
`c:\Python27\python.exe x.py test`) bootstrap cannot find python
and crashes.

This commit passes path to python in `BOOTSTRAP_PYTHON` env var.

7 years agoUpdate LLVM to fix unsigned multiplication overflow
James Duley [Wed, 21 Jun 2017 15:38:36 +0000 (16:38 +0100)]
Update LLVM to fix unsigned multiplication overflow

check for some targets, notably ARMv6-M.

7 years agoAuto merge of #42802 - frewsxcv:rollup, r=frewsxcv
bors [Wed, 21 Jun 2017 15:26:55 +0000 (15:26 +0000)]
Auto merge of #42802 - frewsxcv:rollup, r=frewsxcv

Rollup of 4 pull requests

- Successful merges: #42397, #42620, #42762, #42766
- Failed merges:

7 years agoRollup merge of #42766 - nrc:versions, r=nagisa
Corey Farwell [Wed, 21 Jun 2017 14:40:17 +0000 (10:40 -0400)]
Rollup merge of #42766 - nrc:versions, r=nagisa

Update rls-data version

And update the RLS submod

7 years agoRollup merge of #42762 - jackpot51:patch-1, r=sfackler
Corey Farwell [Wed, 21 Jun 2017 14:40:16 +0000 (10:40 -0400)]
Rollup merge of #42762 - jackpot51:patch-1, r=sfackler

Disable repr(simd) in mem::swap on Redox

This addresses https://github.com/rust-lang/rust/issues/42761

7 years agoRollup merge of #42620 - wesleywiser:compile_error, r=brson
Corey Farwell [Wed, 21 Jun 2017 14:40:15 +0000 (10:40 -0400)]
Rollup merge of #42620 - wesleywiser:compile_error, r=brson

Add compile_error!

Related to #40872

7 years agoRollup merge of #42397 - sfackler:syncsender-sync, r=alexcrichton
Corey Farwell [Wed, 21 Jun 2017 14:40:14 +0000 (10:40 -0400)]
Rollup merge of #42397 - sfackler:syncsender-sync, r=alexcrichton

Implement Sync for SyncSender

r? @alexcrichton

7 years agoIntegrate jobserver support to parallel codegen
Alex Crichton [Thu, 15 Jun 2017 14:08:18 +0000 (07:08 -0700)]
Integrate jobserver support to parallel codegen

This commit integrates the `jobserver` crate into the compiler. The crate was
previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose
here is to two-fold:

* Primarily the compiler can cooperate with Cargo on parallelism. When you run
  `cargo build -j4` then this'll make sure that the entire build process between
  Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc
  instances which may all try to spawn lots of threads.

* Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver.
  This means that if you call cargo/rustc from `make` or another
  jobserver-compatible implementation it'll use foreign parallelism settings
  instead of creating new ones locally.

As the number of parallel codegen instances in the compiler continues to grow
over time with the advent of incremental compilation it's expected that this'll
become more of a problem, so this is intended to nip concurrent concerns in the
bud by having all the tools to cooperate!

Note that while rustc has support for itself creating a jobserver it's far more
likely that rustc will always use the jobserver configured by Cargo. Cargo today
will now set a jobserver unconditionally for rustc to use.

7 years agoImpl Clone for DefaultHasher
Leonardo Yvens [Wed, 21 Jun 2017 13:47:29 +0000 (10:47 -0300)]
Impl Clone for DefaultHasher

7 years agoBetter Debug for Args and ArgsOs
Stepan Koltsov [Wed, 21 Jun 2017 12:40:45 +0000 (15:40 +0300)]
Better Debug for Args and ArgsOs

Display actual args instead of two dots.

7 years agoAuto merge of #42751 - arielb1:fast-representable, r=eddyb
bors [Wed, 21 Jun 2017 12:28:48 +0000 (12:28 +0000)]
Auto merge of #42751 - arielb1:fast-representable, r=eddyb

Memoize types in `is_representable` to avoid exponential worst-case

I could have made representability a cached query, but that would have
been added complexity for not much benefit - outside of the exponential
worst-case, this pass is fast enough already.

Fixes #42747.

r? @eddyb

7 years agoAuto merge of #42750 - arielb1:unwind-stack, r=eddyb
bors [Wed, 21 Jun 2017 10:06:13 +0000 (10:06 +0000)]
Auto merge of #42750 - arielb1:unwind-stack, r=eddyb

Update LLVM to pick StackColoring improvement

Fixes #40883.

r? @eddyb

7 years agoAuto merge of #42664 - alexcrichton:moar-crates, r=eddyb
bors [Wed, 21 Jun 2017 06:27:36 +0000 (06:27 +0000)]
Auto merge of #42664 - alexcrichton:moar-crates, r=eddyb

Remove in-tree flate/getopts crates

Remove `src/libflate` in favor of `flate2` on crates.io and `src/libgetopts` in favor of `getopts` on crates.io. The replacements have slightly different APIs and the usage in the compiler has been updated to reflect this.

This uncovered an unfortunate limitation of the compiler today to deal with linking everything correctly, and the workaround can be found documented in `src/librustc/Cargo.toml`.

7 years agoAuto merge of #42002 - sfackler:trusted-read, r=alexcrichton
bors [Wed, 21 Jun 2017 04:14:46 +0000 (04:14 +0000)]
Auto merge of #42002 - sfackler:trusted-read, r=alexcrichton

Add a Read::initializer method

This is an API that allows types to indicate that they can be passed
buffers of uninitialized memory which can improve performance.

cc @SimonSapin

r? @alexcrichton

7 years agoAdd `Read::initializer`.
Steven Fackler [Mon, 15 May 2017 01:29:18 +0000 (21:29 -0400)]
Add `Read::initializer`.

This is an API that allows types to indicate that they can be passed
buffers of uninitialized memory which can improve performance.

7 years agoAuto merge of #42076 - alex-ozdemir:master, r=nrc
bors [Wed, 21 Jun 2017 00:06:02 +0000 (00:06 +0000)]
Auto merge of #42076 - alex-ozdemir:master, r=nrc

Clearer Error Message for Duplicate Definition

Clearer use of the error message and span labels to communicate duplication definitions/imports.

fixes #42061

7 years agoFixes bootstrapping with custom cargo/rustc.
Mark Simulacrum [Wed, 21 Jun 2017 00:04:36 +0000 (18:04 -0600)]
Fixes bootstrapping with custom cargo/rustc.

config.mk is now always read when parsing the configuration to prevent
this from reoccurring in the future, hopefully.

7 years agoadd extended information for E0562; impl Trait can only be a return type
Zack M. Davis [Tue, 20 Jun 2017 23:23:59 +0000 (16:23 -0700)]
add extended information for E0562; impl Trait can only be a return type

7 years agoRedox: Use create() instead of open() when setting env variable
Ian Douglas Scott [Tue, 20 Jun 2017 23:04:38 +0000 (16:04 -0700)]
Redox: Use create() instead of open() when setting env variable

7 years agoAuto merge of #42780 - frewsxcv:rollup, r=frewsxcv
bors [Tue, 20 Jun 2017 21:08:28 +0000 (21:08 +0000)]
Auto merge of #42780 - frewsxcv:rollup, r=frewsxcv

Rollup of 6 pull requests

- Successful merges: #42271, #42717, #42728, #42749, #42756, #42772
- Failed merges:

7 years agoRollup merge of #42772 - MaloJaffre:libc, r=alexcrichton
Corey Farwell [Tue, 20 Jun 2017 20:28:32 +0000 (16:28 -0400)]
Rollup merge of #42772 - MaloJaffre:libc, r=alexcrichton

Update libc to 0.2.24

Fixes  #42427.

7 years agoRollup merge of #42756 - sanxiyn:name-for-must-use, r=estebank
Corey Farwell [Tue, 20 Jun 2017 20:28:31 +0000 (16:28 -0400)]
Rollup merge of #42756 - sanxiyn:name-for-must-use, r=estebank

Show type name for unused_must_use lint

Fix #42688.

7 years agoRollup merge of #42749 - frewsxcv:frewsxcxv/doc-examples, r=QuietMisdreavus
Corey Farwell [Tue, 20 Jun 2017 20:28:30 +0000 (16:28 -0400)]
Rollup merge of #42749 - frewsxcv:frewsxcxv/doc-examples, r=QuietMisdreavus

Additions/improvements for doc examples.

None

7 years agoRollup merge of #42728 - jseyfried:fix_resolve_perf, r=nrc
Corey Farwell [Tue, 20 Jun 2017 20:28:27 +0000 (16:28 -0400)]
Rollup merge of #42728 - jseyfried:fix_resolve_perf, r=nrc

resolve: fix perf bug

Fixes #42544.
r? @nrc

7 years agoRollup merge of #42717 - ollie27:into_to_from2, r=sfackler
Corey Farwell [Tue, 20 Jun 2017 20:28:26 +0000 (16:28 -0400)]
Rollup merge of #42717 - ollie27:into_to_from2, r=sfackler

Convert `Into<Box<[T]>> for Vec<T>` into `From<Vec<T>> for Box<[T]>`

As the `collections` crate has been merged into `alloc` in #42648 this impl is now possible. This is the final part of #42129 missing from #42227.

7 years agoRollup merge of #42271 - tinaun:charfromstr, r=alexcrichton
Corey Farwell [Tue, 20 Jun 2017 20:28:25 +0000 (16:28 -0400)]
Rollup merge of #42271 - tinaun:charfromstr, r=alexcrichton

add `FromStr` Impl for `char`

fixes #24939.

is it possible to use pub(restricted) instead of using a stability attribute for the internal error representation? is it needed at all?

7 years agoSwitch to the crates.io `getopts` crate
Alex Crichton [Thu, 8 Jun 2017 21:20:55 +0000 (14:20 -0700)]
Switch to the crates.io `getopts` crate

This commit deletes the in-tree `getopts` crate in favor of the crates.io-based
`getopts` crate. The main difference here is with a new builder-style API, but
otherwise everything else remains relatively standard.

7 years agomark calls in the unwind path as !noinline
Ariel Ben-Yehuda [Tue, 20 Jun 2017 12:07:47 +0000 (15:07 +0300)]
mark calls in the unwind path as !noinline

The unwind path is always cold, so that should not have bad performance
implications.  This avoids catastrophic exponential inlining, and also
decreases the size of librustc.so by 1.5% (OTOH, the size of `libstd.so`
increased by 0.5% for some reason).

Fixes #41696.

7 years agoAdd a couple doc additional examples for `env::join_paths`.
Corey Farwell [Mon, 19 Jun 2017 02:21:17 +0000 (19:21 -0700)]
Add a couple doc additional examples for `env::join_paths`.

7 years agoAdd doc example for `CString::from_raw`.
Corey Farwell [Mon, 19 Jun 2017 01:22:54 +0000 (18:22 -0700)]
Add doc example for `CString::from_raw`.

7 years agoAdd doc example for `FromBytesWithNulError`.
Corey Farwell [Mon, 19 Jun 2017 00:44:41 +0000 (17:44 -0700)]
Add doc example for `FromBytesWithNulError`.

7 years agoAdd doc example for `NulError`.
Corey Farwell [Mon, 19 Jun 2017 00:31:06 +0000 (17:31 -0700)]
Add doc example for `NulError`.

7 years agoAdd doc example for `CStr::to_str`.
Corey Farwell [Sun, 18 Jun 2017 23:12:39 +0000 (16:12 -0700)]
Add doc example for `CStr::to_str`.

7 years agoAdd doc example for `CString::as_c_str`.
Corey Farwell [Sun, 18 Jun 2017 23:05:00 +0000 (16:05 -0700)]
Add doc example for `CString::as_c_str`.

7 years agoAdd doc example for `Box<CStr>::into_c_string`.
Corey Farwell [Sun, 18 Jun 2017 22:48:00 +0000 (15:48 -0700)]
Add doc example for `Box<CStr>::into_c_string`.

7 years agoAdd doc example for `CString::into_boxed_c_str`.
Corey Farwell [Sun, 18 Jun 2017 22:45:00 +0000 (15:45 -0700)]
Add doc example for `CString::into_boxed_c_str`.

7 years agoAdd doc example for `CStr::to_string_lossy`.
Corey Farwell [Sun, 18 Jun 2017 21:46:19 +0000 (14:46 -0700)]
Add doc example for `CStr::to_string_lossy`.

7 years agoAdd error scenario doc examples for `CStr::from_bytes_with_nul`.
Corey Farwell [Sun, 18 Jun 2017 21:28:10 +0000 (14:28 -0700)]
Add error scenario doc examples for `CStr::from_bytes_with_nul`.

7 years agoAdd doc example for `CStr::to_bytes_with_nul`.
Corey Farwell [Sun, 18 Jun 2017 21:12:17 +0000 (14:12 -0700)]
Add doc example for `CStr::to_bytes_with_nul`.

7 years agoAdd doc example for `CStr::to_bytes`.
Corey Farwell [Sun, 18 Jun 2017 21:11:34 +0000 (14:11 -0700)]
Add doc example for `CStr::to_bytes`.

7 years agoRemove the in-tree `flate` crate
Alex Crichton [Thu, 8 Jun 2017 21:10:36 +0000 (14:10 -0700)]
Remove the in-tree `flate` crate

A long time coming this commit removes the `flate` crate in favor of the
`flate2` crate on crates.io. The functionality in `flate2` originally flowered
out of `flate` itself and is additionally the namesake for the crate. This will
leave a gap in the naming (there's not `flate` crate), which will likely cause a
particle collapse of some form somewhere.