Commit Graph

65189 Commits

Author SHA1 Message Date
bors
7e76505e01 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
2017-06-24 09:32:20 +00:00
bors
b0081b36b4 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.
2017-06-24 07:10:10 +00:00
bors
1ccc330d4b 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.
2017-06-24 04:42:18 +00:00
Alex Crichton
06540cb205 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.
2017-06-23 16:11:39 -07:00
Mark Simulacrum
2346169f99 Add tests for a few issues. 2017-06-23 07:51:01 -06:00
bors
229d0d3266 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:
2017-06-23 13:46:43 +00:00
Mark Simulacrum
9037ef2c78 Rollup merge of #42833 - durka:non-constant-used-with-constant, r=Mark-Simulacrum
change span label for E0435

r? @Mark-Simulacrum
2017-06-23 06:02:15 -06:00
Mark Simulacrum
747643ff3a 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.
2017-06-23 06:02:14 -06:00
Mark Simulacrum
97b7783333 Rollup merge of #42825 - letheed:patch-1, r=alexcrichton
Fix ref as mutable ref in std::rc::Rc doc
2017-06-23 06:02:12 -06:00
Mark Simulacrum
bb2db942ee Rollup merge of #42822 - ChrisMacNaughton:guard-traits, r=alexcrichton
Ensure Guard types impl Display & Debug

Fixes #24372
2017-06-23 06:02:11 -06:00
Mark Simulacrum
f3aebb0a83 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
2017-06-23 06:02:10 -06:00
Mark Simulacrum
ddc2333fab Rollup merge of #42787 - zackmdavis:explain_E0562, r=GuillaumeGomez
add extended information for E0562; impl Trait can only be a return type

r? @GuillaumeGomez
2017-06-23 06:02:09 -06:00
Mark Simulacrum
d22eb081ef 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.
2017-06-23 06:02:08 -06:00
Mark Simulacrum
377ff895a5 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 `.
2017-06-23 06:02:08 -06:00
Federico Ravasio
545bfcd864
Relax Debug constraints when debugging {HashMap,BTreeMap}::{Keys,Values}.
Fixed #41924.
2017-06-23 12:48:29 +02:00
Federico Ravasio
2ea1d2d007
Correctly iterate on keys/values when debugging BTreeMap::{Keys,Values}. 2017-06-23 12:47:43 +02:00
kennytm
9addd3ba65
Added a tidy check to disallow "``ignore" and "``rust,ignore". 2017-06-23 15:31:54 +08:00
kennytm
2c89165814
Modify --explain to handle hidden code (# ...) and indented code blocks. 2017-06-23 15:31:53 +08:00
kennytm
4711982314
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.
2017-06-23 15:31:53 +08:00
bors
bd32b1ba0d 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
2017-06-23 05:25:22 +00:00
bors
737962056a 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)
```
2017-06-23 00:32:40 +00:00
bors
bd62230fbd Auto merge of #42614 - GuillaumeGomez:new-error-codes, r=pnkfelix
New error codes

Part of #42229.

cc @Susurrus @frewsxcv @QuietMisdreavus
2017-06-22 21:46:08 +00:00
Alex Burka
369d4f1883 remove duplicate E0435 test 2017-06-22 19:13:09 +00:00
Alex Burka
0883ce1b43 change span label for E0435 (fix #41871) 2017-06-22 19:10:56 +00:00
Ian Douglas Scott
f98ffb5bc3
Make Build.cxx() return a Result instead of panicking 2017-06-22 11:51:32 -07:00
Ian Douglas Scott
526afcb0a3
Set CXX_<target> in bootstrap 2017-06-22 10:42:10 -07:00
bors
ab5bec2553 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)
2017-06-22 15:24:58 +00:00
Chris MacNaughton
14df54989a Ensure Guard types impl Display & Debug
Fixes #24372
2017-06-22 16:54:32 +02:00
Letheed
fc581457ec Fix ref as mutable ref in std::rc::Rc doc 2017-06-22 15:48:20 +02:00
bors
74fa27928a Auto merge of #42824 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 4 pull requests

- Successful merges: #42799, #42804, #42805, #42806
- Failed merges:
2017-06-22 12:48:54 +00:00
Mark Simulacrum
7f693e2cb9 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
2017-06-22 06:30:12 -06:00
Mark Simulacrum
ea7db0787d 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.
2017-06-22 06:30:11 -06:00
Mark Simulacrum
a859f2bd4b 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
2017-06-22 06:30:10 -06:00
Mark Simulacrum
a56fef8d2c 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`.
2017-06-22 06:30:09 -06:00
bors
6f01c84fc8 Auto merge of #42798 - stepancheg:args-debug, r=sfackler
Better Debug for Args and ArgsOs

Display actual args instead of two dots.
2017-06-22 10:34:21 +00:00
Michael Woerister
12b11d8346 Print -Zincremental-info to stderr instead of stdout. 2017-06-22 10:27:51 +02:00
bors
03c8b92dc1 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
2017-06-22 08:10:27 +00:00
Michael Woerister
8261413591 debuginfo: Work around crash-bug in MSDIA library 2017-06-22 09:49:44 +02:00
bors
efdf55d048 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
2017-06-22 05:50:58 +00:00
bors
80271e8edf 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.
2017-06-22 00:32:42 +00:00
bors
6de26f42de 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
2017-06-21 21:29:45 +00:00
Oliver Middleton
ae1dc2a6f9 rustbuild: Fix compiler docs yet again
Add support for `-Z force-unstable-if-unmarked` to rustdoc.
2017-06-21 17:59:10 +01:00
Mark Simulacrum
305f5263f9 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.
2017-06-21 10:04:21 -06:00
Stepan Koltsov
f441e07feb 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.
2017-06-21 19:01:24 +03:00
James Duley
7b4ff1c7b8 Update LLVM to fix unsigned multiplication overflow
check for some targets, notably ARMv6-M.
2017-06-21 16:38:36 +01:00
bors
622e7e6487 Auto merge of #42802 - frewsxcv:rollup, r=frewsxcv
Rollup of 4 pull requests

- Successful merges: #42397, #42620, #42762, #42766
- Failed merges:
2017-06-21 15:26:55 +00:00
Corey Farwell
80e14a0fe3 Rollup merge of #42766 - nrc:versions, r=nagisa
Update rls-data version

And update the RLS submod
2017-06-21 10:40:17 -04:00
Corey Farwell
30a7bfcaae 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
2017-06-21 10:40:16 -04:00
Corey Farwell
d33e2c5181 Rollup merge of #42620 - wesleywiser:compile_error, r=brson
Add compile_error!

Related to #40872
2017-06-21 10:40:15 -04:00
Corey Farwell
292fcc880f Rollup merge of #42397 - sfackler:syncsender-sync, r=alexcrichton
Implement Sync for SyncSender

r? @alexcrichton
2017-06-21 10:40:14 -04:00