]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAuto merge of #43025 - est31:nan_cross_platform, r=BurntSushi
bors [Tue, 4 Jul 2017 13:21:20 +0000 (13:21 +0000)]
Auto merge of #43025 - est31:nan_cross_platform, r=BurntSushi

Make sNaN removal code tolerate different sNaN encodings

IEEE 754-1985 specifies the encoding of NaN floating point numbers,
but while it mentions that NaNs can be subdivided into signaling
and quiet ones, it doesn't fix the encoding of signaling NaNs in binary
formats. This led to different implementations (CPUs) having different
encodings. IEEE 754-2008 finally specified the encoding of signaling NaNs
but some architectures are compatible with it, while others aren't.
Certain MIPS and PA-RISC CPUs have different encodings for signaling
NaNs.

In order to have the float <-> binary cast feature of the std library be
portable to them, we don't mask any quiet NaNs like we did before (only
being compliant to IEEE 754-2008 and nothing else), but instead we
simply pass a known good NaN instead.

Note that in the code removed there was a bug; the 64 bit mask for quiet
NaNs should have been `0x0008000000000000` instead of the specified
`0x0001000000000000`.

7 years agoAuto merge of #43012 - scottmcm:delete-range-step-by, r=alexcrichton
bors [Tue, 4 Jul 2017 04:49:59 +0000 (04:49 +0000)]
Auto merge of #43012 - scottmcm:delete-range-step-by, r=alexcrichton

Delete deprecated & unstable range-specific `step_by`

Using the new one is annoying while this one exists, since the inherent method hides the one on iterator.

Tracking issue: #27741
Replacement: #41439
Deprecation: #42310 for 1.19
Fixes #41477

7 years agoAuto merge of #42993 - stepancheg:editorconfig, r=brson
bors [Tue, 4 Jul 2017 01:08:15 +0000 (01:08 +0000)]
Auto merge of #42993 - stepancheg:editorconfig, r=brson

Add .editorconfig to src/rustllvm

... which uses 2 space indent instead of common 4 spaces.

7 years agoMake sNaN removal code tolerate different sNaN encodings
est31 [Mon, 3 Jul 2017 14:16:45 +0000 (16:16 +0200)]
Make sNaN removal code tolerate different sNaN encodings

IEEE 754-1985 specifies the encoding of NaN floating point numbers,
but while it mentions that NaNs can be subdivided into signaling
and quiet ones, it doesn't fix the encoding of signaling NaNs in binary
formats. This led to different implementations (CPUs) having different
encodings. IEEE 754-2008 finally specified the encoding of signaling NaNs
but some architectures are compatible with it, while others aren't.
Certain MIPS and PA-RISC CPUs have different encodings for signaling
NaNs.

In order to have the float <-> binary cast feature of the std library be
portable to them, we don't mask any quiet NaNs like we did before (only
being compliant to IEEE 754-2008 and nothing else), but instead we
simply pass a known good NaN instead.

Note that in the code removed there was a bug; the 64 bit mask for quiet
NaNs should have been `0x0008000000000000` instead of the specified
`0x0001000000000000`.

7 years agoAuto merge of #42999 - behnam:ucd10, r=alexcrichton
bors [Mon, 3 Jul 2017 17:00:17 +0000 (17:00 +0000)]
Auto merge of #42999 - behnam:ucd10, r=alexcrichton

[libstd_unicode] Upgrade to Unicode 10.0.0

Update `libstd_unicode`'s data tables to Unicode 10.0.0, as released on 2017 June 20: http://www.unicode.org/versions/Unicode10.0.0/

7 years agoAuto merge of #42976 - ids1024:redoxfix, r=sfackler
bors [Mon, 3 Jul 2017 12:20:57 +0000 (12:20 +0000)]
Auto merge of #42976 - ids1024:redoxfix, r=sfackler

Fix Redox build, apparently broken by #42687

7 years agoAuto merge of #43010 - stjepang:stabilize-sort-unstable, r=alexcrichton
bors [Sun, 2 Jul 2017 23:54:32 +0000 (23:54 +0000)]
Auto merge of #43010 - stjepang:stabilize-sort-unstable, r=alexcrichton

Stabilize feature sort_unstable

Closes #40585

7 years agoRemove the remaining feature gates
Stjepan Glavina [Sun, 2 Jul 2017 19:29:39 +0000 (21:29 +0200)]
Remove the remaining feature gates

7 years agoFix lint errors
Stjepan Glavina [Sun, 2 Jul 2017 17:14:16 +0000 (19:14 +0200)]
Fix lint errors

7 years agoAuto merge of #42938 - est31:col_number, r=eddyb
bors [Sun, 2 Jul 2017 15:40:26 +0000 (15:40 +0000)]
Auto merge of #42938 - est31:col_number, r=eddyb

Output column number info when panicking

Outputs the column number when panicking. Useful when you e.g. have code like `foo[i] = bar[k] + bar[l]` and you get a panic with index out of bounds, or when you have an expression like `a = b + c + d + e` and the addition overflows. Now you know which operation to blame!

The format is `file:line:column`, just like for compiler errors. Example output with the patch:

```
thread 'main' panicked at 'index out of bounds: the len is 5 but the index is 8', src/main.rs:3:8
```

As some of the API between the compiler and the library landscape gets broken, this is a bit hackier than I'd originally wanted it to be.

* `panic` and `panic_bounds_check` lang items got an additional column param, on stage0 I still have to use the previous version. After a SNAP this should be resolved.
* For `#[derive(RustcDeserialze)]`, stage0 requires a fixed signature for `std::rt::begin_panic`, so we can't change it right away. What we need to do instead is to keep the signature, and add a `begin_panic_new` function that we use in later stages instead. After a SNAP we can change the `begin_panic` function and rely on it instead of `begin_panic_new`, and one SNAP later we can remove `begin_panic_new`.
* Fortunately I didn't have to break anything about the panic hook API, I could easily extend it.

Note that debuginfo remains unchanged, so RUST_BACKTRACE output won't contain any column info. See issue #42921 for discussion on including the column in debuginfo.

7 years agoUpdate cargo
est31 [Sun, 2 Jul 2017 11:51:28 +0000 (13:51 +0200)]
Update cargo

... to get https://github.com/rust-lang/cargo/pull/4244 and
https://github.com/rust-lang/cargo/pull/4246

7 years agoAuto merge of #43015 - arielb1:every-error-counts, r=eddyb
bors [Sun, 2 Jul 2017 13:22:23 +0000 (13:22 +0000)]
Auto merge of #43015 - arielb1:every-error-counts, r=eddyb

report the total number of errors on compilation failure

Prior to this PR, when we aborted because a "critical pass" failed, we displayed the number of errors from that critical pass. While that's the number of errors that caused compilation to abort in *that place*, that's not what people really want to know. Instead, always report the total number of errors, and don't bother to track the number of errors from the last pass that failed.

This changes the compiler driver API to handle errors more smoothly, therefore is a compiler-api-[breaking-change].

Fixes #42793.

r? @eddyb

7 years agoreport the total number of errors on compilation failure
Ariel Ben-Yehuda [Sun, 2 Jul 2017 13:09:09 +0000 (16:09 +0300)]
report the total number of errors on compilation failure

Prior to this PR, when we aborted because a "critical pass" failed, we
displayed the number of errors from that critical pass. While that's the
number of errors that caused compilation to abort in *that place*,
that's not what people really want to know. Instead, always report the
total number of errors, and don't bother to track the number of errors
from the last pass that failed.

This changes the compiler driver API to handle errors more smoothly,
and therefore is a compiler-api-[breaking-change].

Fixes #42793.

7 years agoStyle fix
est31 [Sun, 2 Jul 2017 07:06:08 +0000 (09:06 +0200)]
Style fix

7 years agoDocumentation
est31 [Wed, 28 Jun 2017 00:41:24 +0000 (02:41 +0200)]
Documentation

7 years agoFix the test failure, add comment, and refactor a little bit
est31 [Tue, 27 Jun 2017 23:15:29 +0000 (01:15 +0200)]
Fix the test failure, add comment, and refactor a little bit

7 years agoOutput line column info when panicking
est31 [Tue, 27 Jun 2017 02:26:52 +0000 (04:26 +0200)]
Output line column info when panicking

7 years agoRevert "Change error count messages"
Ariel Ben-Yehuda [Sun, 2 Jul 2017 10:49:30 +0000 (13:49 +0300)]
Revert "Change error count messages"

This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.

7 years agoFix tidy errors
Stjepan Glavina [Sun, 2 Jul 2017 09:16:37 +0000 (11:16 +0200)]
Fix tidy errors

7 years agoDelete deprecated & unstable range-specific `step_by`
Scott McMurray [Sun, 2 Jul 2017 02:18:02 +0000 (19:18 -0700)]
Delete deprecated & unstable range-specific `step_by`

Replacement: 41439
Deprecation: 42310 for 1.19
Fixes 41477

7 years agoAuto merge of #43003 - milmazz:bootstrap-pep8, r=alexcrichton
bors [Sun, 2 Jul 2017 01:51:30 +0000 (01:51 +0000)]
Auto merge of #43003 - milmazz:bootstrap-pep8, r=alexcrichton

bootstrap: Fix all the pep-8 issues reported by flake8

This commit also adds a few missing docstrings.

Today, after reading this [article](https://blog.rust-lang.org/2017/06/27/Increasing-Rusts-Reach.html), I downloaded this project and started building from source. In the meantime, I began to read the `bootstrap.py`, to know more about the building process, and I made a few changes, this is my first contribution to the project, hope you like it.

BTW, I have a few doubts about the `bootstrap.py`, any guidance is more than welcome:

* Where can I find the unit tests for this script? In case it doesn't exist yet, do you like to include some unit tests with pytest?
* Some methods like `fix_executable`, `get_string`, and `exe_suffix` in the `RustBuild` class should be converted to a function because it doesn't use `self` anywhere. What do you think?

7 years agoStabilize feature sort_unstable
Stjepan Glavina [Sun, 2 Jul 2017 00:09:21 +0000 (02:09 +0200)]
Stabilize feature sort_unstable

7 years agoAuto merge of #43002 - SergioBenitez:more-io-inner-stable, r=BurntSushi
bors [Sat, 1 Jul 2017 21:54:13 +0000 (21:54 +0000)]
Auto merge of #43002 - SergioBenitez:more-io-inner-stable, r=BurntSushi

Stabilize 'more_io_inner_methods' feature.

As in the title. Closes #41519.

7 years agoAuto merge of #42882 - stjepang:improve-sort-tests-and-benches, r=alexcrichton
bors [Sat, 1 Jul 2017 13:31:32 +0000 (13:31 +0000)]
Auto merge of #42882 - stjepang:improve-sort-tests-and-benches, r=alexcrichton

Improve tests and benchmarks for slice::sort and slice::sort_unstable

This PR just hardens the tests and improves benchmarks.
More specifically:

1. Benchmarks don't generate vectors in `Bencher::iter` loops, but simply clone pregenerated vectors.
2. Benchmark `*_strings` doesn't allocate Strings in `Bencher::iter` loops, but merely clones a `Vec<&str>`.
3. Benchmarks use seeded `XorShiftRng` to be more consistent.
4. Additional tests for `slice::sort` are added, which test sorting on slices with several ascending/descending runs. The implementation identifies such runs so it's a good idea to test that scenario a bit.
5. More checks are added to `run-pass/vector-sort-panic-safe.rs`. Sort algorithms copy elements around a lot (merge sort uses an auxilliary buffer and pdqsort copies the pivot onto the stack before partitioning, then writes it back into the slice). If elements that are being sorted are internally mutable and comparison function mutates them, it is important to make sure that sort algorithms always use the latest "versions" of elements. New checks verify that this is true for both `slice::sort` and `slice::sort_unstable`.

As a side note, all of those improvements were made as part of the parallel sorts PR in Rayon (nikomatsakis/rayon#379) and now I'm backporting them into libcore/libstd.

r? @alexcrichton

7 years agoSimplify print arguments
Milton Mazzarri [Sat, 1 Jul 2017 12:16:57 +0000 (07:16 -0500)]
Simplify print arguments

7 years agoAuto merge of #42991 - sfackler:unstable-rangeargument, r=alexcrichton
bors [Sat, 1 Jul 2017 11:21:53 +0000 (11:21 +0000)]
Auto merge of #42991 - sfackler:unstable-rangeargument, r=alexcrichton

Revert "Stabilize RangeArgument"

This reverts commit 143206d54d7558c2326212df99efc98110904fdb.

From the discussion in #30877 it seems like this is premature.

7 years agoAuto merge of #42977 - Keruspe:master, r=alexcrichton
bors [Sat, 1 Jul 2017 09:10:13 +0000 (09:10 +0000)]
Auto merge of #42977 - Keruspe:master, r=alexcrichton

 rustbuild: set __CARGO_DEFAULT_LIB_METADATA to channel

Also, update the cargo submodule to handle the new value.

7 years agoAuto merge of #42971 - stepancheg:ir-demangle, r=nagisa
bors [Sat, 1 Jul 2017 05:52:08 +0000 (05:52 +0000)]
Auto merge of #42971 - stepancheg:ir-demangle, r=nagisa

When writing LLVM IR output demangled fn name in comments

`--emit=llvm-ir` looks like this now:

```
; <alloc::vec::Vec<T> as core::ops::index::IndexMut<core::ops::range::RangeFull>>::index_mut
; Function Attrs: inlinehint uwtable
define internal { i8*, i64 } @"_ZN106_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..index..IndexMut$LT$core..ops..range..RangeFull$GT$$GT$9index_mut17h7f7b576609f30262E"(%"alloc::vec::Vec<u8>"* dereferenceable(24)) unnamed_addr #0 {
start:
  ...
```

cc https://github.com/integer32llc/rust-playground/issues/15

7 years agobootstrap: Fix some PEP8 issues
Milton Mazzarri [Sat, 1 Jul 2017 04:24:35 +0000 (23:24 -0500)]
bootstrap: Fix some PEP8 issues

This commit also adds a few missing docstrings

7 years agoAuto merge of #42896 - llogiq:clippy_compiletest, r=alexcrichton
bors [Sat, 1 Jul 2017 03:26:29 +0000 (03:26 +0000)]
Auto merge of #42896 - llogiq:clippy_compiletest, r=alexcrichton

fixed some clippy warnings in compiletest

This is mainly readability stuff. Whenever the `clone_ref` lint asked me to clone the dereferenced object, I removed the `.clone()` instead, relying on the fact that it has worked so far and the immutable borrow ensures that the value won't change.

7 years agoStabilize 'more_io_inner_methods' feature.
Sergio Benitez [Sat, 1 Jul 2017 01:05:04 +0000 (18:05 -0700)]
Stabilize 'more_io_inner_methods' feature.

7 years agoWhen writing LLVM IR output demangled fn name in comments
Stepan Koltsov [Thu, 29 Jun 2017 14:52:43 +0000 (17:52 +0300)]
When writing LLVM IR output demangled fn name in comments

`--emit=llvm-ir` looks like this now:

```
; <alloc::vec::Vec<T> as core::ops::index::IndexMut<core::ops::range::RangeFull>>::index_mut
; Function Attrs: inlinehint uwtable
define internal { i8*, i64 } @"_ZN106_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..index..IndexMut$LT$core..ops..range..RangeFull$GT$$GT$9index_mut17h7f7b576609f30262E"(%"alloc::vec::Vec<u8>"* dereferenceable(24)) unnamed_addr #0 {
start:
  ...
```

cc https://github.com/integer32llc/rust-playground/issues/15

7 years ago[libstd_unicode] Upgrade to Unicode 10.0.0
Behnam Esfahbod [Fri, 30 Jun 2017 23:25:28 +0000 (17:25 -0600)]
[libstd_unicode] Upgrade to Unicode 10.0.0

7 years agoAuto merge of #42995 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Fri, 30 Jun 2017 22:14:56 +0000 (22:14 +0000)]
Auto merge of #42995 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 6 pull requests

- Successful merges: #42669, #42911, #42925, #42957, #42985, #42987
- Failed merges: #42936

7 years agoRollup merge of #42987 - cuviper:iterator_for_each, r=Mark-Simulacrum
Guillaume Gomez [Fri, 30 Jun 2017 20:44:48 +0000 (22:44 +0200)]
Rollup merge of #42987 - cuviper:iterator_for_each, r=Mark-Simulacrum

Track `iterator_for_each` in #42986

None

7 years agoRollup merge of #42985 - venkatagiri:issue_42444, r=Mark-Simulacrum
Guillaume Gomez [Fri, 30 Jun 2017 20:44:47 +0000 (22:44 +0200)]
Rollup merge of #42985 - venkatagiri:issue_42444, r=Mark-Simulacrum

rustc_llvm: re-run build script when env var LLVM_CONFIG changes

This removes the changes done in #42429 and use the newly introduced `cargo:rerun-if-env-changed` in https://github.com/rust-lang/cargo/pull/4125.
As `LLVM_CONFIG` env var points to the `llvm-config` and changes when it gets configured in `config.toml` or removed from it, we can re-run the build script if this env var changes.

closes #42444

r? @alexcrichton

7 years agoRollup merge of #42957 - GuillaumeGomez:add-e0619, r=nikomatsakis
Guillaume Gomez [Fri, 30 Jun 2017 20:44:46 +0000 (22:44 +0200)]
Rollup merge of #42957 - GuillaumeGomez:add-e0619, r=nikomatsakis

Add E0619 error explanation

r? @eddyb

7 years agoRollup merge of #42925 - tbu-:pr_document_file_open_errors, r=GuillaumeGomez
Guillaume Gomez [Fri, 30 Jun 2017 20:44:45 +0000 (22:44 +0200)]
Rollup merge of #42925 - tbu-:pr_document_file_open_errors, r=GuillaumeGomez

Document possible `io::ErrorKind`s of `fs::open`

Try to make clear that this isn't an API guarantee for now, as we likely
want to refine these errors in the future, e.g. `ENOSPC` "No space left
on device".

CC #40322

7 years agoRollup merge of #42911 - nrc:rls-update, r=brson
Guillaume Gomez [Fri, 30 Jun 2017 20:44:44 +0000 (22:44 +0200)]
Rollup merge of #42911 - nrc:rls-update, r=brson

Update RLS submodule

7 years agoRollup merge of #42669 - gaurikholkar:master, r=nikomatsakis
Guillaume Gomez [Fri, 30 Jun 2017 20:44:43 +0000 (22:44 +0200)]
Rollup merge of #42669 - gaurikholkar:master, r=nikomatsakis

Adding diagnostic code 0611 for lifetime errors with one named, one anonymous lifetime parameter

This is a fix for #42517
Note that this only handles the above case for **function declarations** and **traits**.
`impl items` and `closures` will be handled in a later PR.
Example
```
fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
    if x > y { x } else { y }
}
```
now displays the following error message. ui tests have been added for the same.
```
error[E0611]: explicit lifetime required in the type of `x`
11 | fn foo<'a>(x: &i32, y: &'a i32) -> &'a i32 {
   |                     ^ consider changing the type of `x` to `&'a i32`
12 |     if x > y { x } else { y }
   |                  - lifetime `'a` required
```
#42516
r? @nikomatsakis

7 years agoFix error codes mixup
Guillaume Gomez [Thu, 29 Jun 2017 19:03:19 +0000 (21:03 +0200)]
Fix error codes mixup

7 years agoAdd E0619 error explanation
Guillaume Gomez [Wed, 28 Jun 2017 22:02:21 +0000 (00:02 +0200)]
Add E0619 error explanation

7 years agoAdd .editorconfig to src/rustllvm
Stepan Koltsov [Fri, 30 Jun 2017 20:13:40 +0000 (23:13 +0300)]
Add .editorconfig to src/rustllvm

... which uses 2 space indent instead of common 4 spaces.

7 years agoAuto merge of #42969 - arielb1:struct-err, r=eddyb
bors [Fri, 30 Jun 2017 19:51:19 +0000 (19:51 +0000)]
Auto merge of #42969 - arielb1:struct-err, r=eddyb

mem_categorization: handle type-based paths in variant patterns

These can't be used in correct programs, but must be handled in order to
prevent ICEs.

Fixes #42880.

r? @eddyb

7 years agoRevert "Stabilize RangeArgument"
Steven Fackler [Fri, 30 Jun 2017 18:34:53 +0000 (08:34 -1000)]
Revert "Stabilize RangeArgument"

This reverts commit 143206d54d7558c2326212df99efc98110904fdb.

7 years agorustc_{a,l,m,t}san: re-run build script if env var LLVM_CONFIG changes
Venkata Giri Reddy [Fri, 30 Jun 2017 17:35:00 +0000 (17:35 +0000)]
rustc_{a,l,m,t}san: re-run build script if env var LLVM_CONFIG changes

7 years agoTrack `iterator_for_each` in #42986
Josh Stone [Fri, 30 Jun 2017 17:21:46 +0000 (10:21 -0700)]
Track `iterator_for_each` in #42986

7 years agorustc_llvm: re-run build script when env var LLVM_CONFIG changes
Venkata Giri Reddy [Fri, 30 Jun 2017 16:55:32 +0000 (16:55 +0000)]
rustc_llvm: re-run build script when env var LLVM_CONFIG changes

7 years agoAuto merge of #42807 - arielb1:consistent-coercion, r=eddyb
bors [Fri, 30 Jun 2017 13:39:25 +0000 (13:39 +0000)]
Auto merge of #42807 - arielb1:consistent-coercion, r=eddyb

Coerce fields to the expected field type

Fully fixes #31260.

This needs a crater run. I was supposed to do this last month but it slipped. Let's get this done.

7 years agorename compile-fail test
gaurikholkar [Fri, 30 Jun 2017 09:33:33 +0000 (02:33 -0700)]
rename compile-fail test

7 years agoAuto merge of #42782 - cuviper:iterator_for_each, r=alexcrichton
bors [Fri, 30 Jun 2017 09:15:21 +0000 (09:15 +0000)]
Auto merge of #42782 - cuviper:iterator_for_each, r=alexcrichton

Add `Iterator::for_each`

This works like a `for` loop in functional style, applying a closure to
every item in the `Iterator`.  It doesn't allow `break`/`continue` like
a `for` loop, nor any other control flow outside the closure, but it may
be a more legible style for tying up the end of a long iterator chain.

This was tried before in #14911, but nobody made the case for using it
with longer iterators.  There was also `Iterator::advance` at that time
which was more capable than `for_each`, but that no longer exists.

The `itertools` crate has `Itertools::foreach` with the same behavior,
but thankfully the names won't collide.  The `rayon` crate also has a
`ParallelIterator::for_each` where simple `for` loops aren't possible.

> I really wish we had `for_each` on seq iterators. Having to use a
> dummy operation is annoying.  - [@nikomatsakis][1]

[1]: https://github.com/nikomatsakis/rayon/pull/367#issuecomment-308455185

7 years agomove ERROR line
Niko Matsakis [Fri, 30 Jun 2017 09:11:28 +0000 (05:11 -0400)]
move ERROR line

7 years agoupdate cargo submodule
Marc-Antoine Perennou [Fri, 30 Jun 2017 07:38:13 +0000 (09:38 +0200)]
update cargo submodule

This brings in several fixes and the new handling of __CARGO_DEFAULT_LIB_METADATA

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
7 years agorustbuild: set __CARGO_DEFAULT_LIB_METADATA to channel
Marc-Antoine Perennou [Thu, 29 Jun 2017 08:03:56 +0000 (10:03 +0200)]
rustbuild: set __CARGO_DEFAULT_LIB_METADATA to channel

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
7 years agoAuto merge of #42930 - arielb1:llvm-next, r=alexcrichton
bors [Fri, 30 Jun 2017 06:17:52 +0000 (06:17 +0000)]
Auto merge of #42930 - arielb1:llvm-next, r=alexcrichton

Rebase LLVM on top of LLVM 4.0.1

Fixes #42893.

Please don't backport this to beta as-is - I'm not sure I want rust-lang/llvm#84 to sneak to beta before it gets sufficient testing.

r? @alexcrichton

7 years agoAuto merge of #42924 - pnkfelix:mir-dataflow, r=arielb1
bors [Fri, 30 Jun 2017 03:56:33 +0000 (03:56 +0000)]
Auto merge of #42924 - pnkfelix:mir-dataflow, r=arielb1

Shift mir-dataflow from `rustc_borrowck` to `rustc_mir` crate.

Shift mir-dataflow from `rustc_borrowck` to `rustc_mir` crate.

Turn `elaborate_drops` and `rustc_peek` implementations into MIR passes that also live in `rustc_mir` crate.

Rewire things so `rustc_driver` uses the `ElaborateDrops` from `rustc_mir` crate.

(This PR is another baby step for mir-borrowck; it is a piece of work that other people want to rebase their stuff on top of, namely developers who are doing other dataflow analyses on top of MIR.)

I have deliberately architected this PR in an attempt to minimize the number of actual code changes. The majority of the diff should be little more than changes to mod and use declarations, as well as a few visibility promotions to pub(crate) when a declaration was moved downward in the module hierarchy.

(I have no problem with other PR's that move declarations around to try to clean this up; my goal was to ensure that the diff here was as small as possible, to make the review nearly trivial.)

7 years agoFix Redox build, apparently broken by #42687
Ian Douglas Scott [Fri, 30 Jun 2017 01:18:32 +0000 (18:18 -0700)]
Fix Redox build, apparently broken by #42687

7 years agoAuto merge of #42902 - petrochenkov:keydcrate, r=jseyfried
bors [Thu, 29 Jun 2017 23:48:17 +0000 (23:48 +0000)]
Auto merge of #42902 - petrochenkov:keydcrate, r=jseyfried

Make `$crate` a keyword

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

r? @jseyfried or @nrc

7 years agotweak comments in E0495.rs
Niko Matsakis [Thu, 29 Jun 2017 22:02:31 +0000 (18:02 -0400)]
tweak comments in E0495.rs

7 years agofix a stray semicolon
Andre Bogus [Thu, 29 Jun 2017 21:38:13 +0000 (23:38 +0200)]
fix a stray semicolon

7 years agoadding compile-fail test
gaurikholkar [Thu, 29 Jun 2017 21:13:53 +0000 (14:13 -0700)]
adding compile-fail test

7 years agoAuto merge of #42900 - sfackler:jemalloc-tweak, r=alexcrichton
bors [Thu, 29 Jun 2017 20:04:14 +0000 (20:04 +0000)]
Auto merge of #42900 - sfackler:jemalloc-tweak, r=alexcrichton

Stop disabling fill in jemalloc

The underlying bug has been fixed for over 2 years!

r? @alexcrichton

7 years agomem_categorization: handle type-based paths in variant patterns
Ariel Ben-Yehuda [Thu, 29 Jun 2017 16:47:12 +0000 (19:47 +0300)]
mem_categorization: handle type-based paths in variant patterns

These can't be used in correct programs, but must be handled in order to
prevent ICEs.

Fixes #42880.

7 years agoAuto merge of #42527 - qnighy:unsized-tuple-coercions, r=arielb1
bors [Thu, 29 Jun 2017 15:04:31 +0000 (15:04 +0000)]
Auto merge of #42527 - qnighy:unsized-tuple-coercions, r=arielb1

Unsized tuple coercions

Part of #18469. Fixes #32702.

#37685 and #34451 might also be related.

This PR does the following:

- Introduce explicit `Sized` constraints on tuple initializers, similar to that of record-struct initializers. Not much relevant to the main contribution but I noticed this when making tests for unsized tuple coercions.
- Implement `(.., T): Unsize<(.., U)>` where `T: Unsize<U>`.
- Assume `(.., T)` is MaybeUnsizedUnivariant.
- Modify `src/librustc/ty/util.rs` and `src/librustc_trans/glue.rs` so that tuples and structs are uniformly traversed when translating.

7 years agocode fixes for error code use warning
gaurikholkar [Thu, 29 Jun 2017 13:35:09 +0000 (06:35 -0700)]
code fixes for error code use warning

7 years agoconflict fixes
gaurikholkar [Wed, 28 Jun 2017 19:18:21 +0000 (12:18 -0700)]
conflict fixes

7 years agoCode review fixes
gaurikholkar [Tue, 27 Jun 2017 19:54:15 +0000 (12:54 -0700)]
Code review fixes

7 years agoremove `fn main() { }` from extended errors
Niko Matsakis [Tue, 27 Jun 2017 17:16:47 +0000 (13:16 -0400)]
remove `fn main() { }` from extended errors

7 years agoChanging the error code to E0621
gaurikholkar [Mon, 26 Jun 2017 18:26:01 +0000 (11:26 -0700)]
Changing the error code to E0621

7 years agocode review fixes
gaurikholkar [Thu, 22 Jun 2017 17:56:05 +0000 (10:56 -0700)]
code review fixes

7 years agoAdding changes to track anonymous region in self
gaurikholkar [Wed, 21 Jun 2017 14:01:35 +0000 (07:01 -0700)]
Adding changes to track anonymous region in self

7 years agotrack anonymous regions in return types, fix tidy errors
gaurikholkar [Tue, 20 Jun 2017 13:42:11 +0000 (06:42 -0700)]
track anonymous regions in return types, fix tidy errors

7 years agoEnabling E0611 for inherent functions
gaurikholkar [Sat, 17 Jun 2017 23:27:07 +0000 (16:27 -0700)]
Enabling E0611 for inherent functions

7 years agoInterchange ^ and -
gaurikholkar [Thu, 15 Jun 2017 20:53:49 +0000 (13:53 -0700)]
Interchange ^ and -

7 years agoupdate reference for test
Niko Matsakis [Thu, 15 Jun 2017 19:01:44 +0000 (15:01 -0400)]
update reference for test

7 years agoAdding new ui test for trait impl
gaurikholkar [Thu, 15 Jun 2017 10:50:02 +0000 (03:50 -0700)]
Adding new ui test for trait impl

7 years agoAdding diagnostic code 0611 for lifetime errors with one named, one anonymous lifetim...
gaurikholkar [Mon, 12 Jun 2017 18:45:19 +0000 (11:45 -0700)]
Adding diagnostic code 0611 for lifetime errors with one named, one anonymous lifetime parameter

7 years agoCorrect comments about unsizing regarding #40319.
Masaki Hara [Thu, 29 Jun 2017 11:00:31 +0000 (20:00 +0900)]
Correct comments about unsizing regarding #40319.

7 years agoGive a tracking-issue number for unsized tuple coercion.
Masaki Hara [Sat, 24 Jun 2017 22:32:00 +0000 (07:32 +0900)]
Give a tracking-issue number for unsized tuple coercion.

7 years agoMove unsized_tuple_coercion behind a feature gate.
Masaki Hara [Sat, 24 Jun 2017 07:20:27 +0000 (16:20 +0900)]
Move unsized_tuple_coercion behind a feature gate.

7 years agoSplit dst-dtor-{1,2} tests into four.
Masaki Hara [Wed, 14 Jun 2017 03:27:51 +0000 (12:27 +0900)]
Split dst-dtor-{1,2} tests into four.

7 years agoAdd unsized tuple coercions.
Masaki Hara [Thu, 8 Jun 2017 05:49:54 +0000 (14:49 +0900)]
Add unsized tuple coercions.

7 years agoCheck explicitly that tuple initializer is Sized.
Masaki Hara [Thu, 8 Jun 2017 05:46:46 +0000 (14:46 +0900)]
Check explicitly that tuple initializer is Sized.

7 years agoChange some terminology around keywords and reserved identifiers
petrochenkov [Thu, 29 Jun 2017 10:16:35 +0000 (13:16 +0300)]
Change some terminology around keywords and reserved identifiers

7 years agoMake `$crate` a keyword
Vadim Petrochenkov [Sun, 25 Jun 2017 17:34:49 +0000 (20:34 +0300)]
Make `$crate` a keyword

7 years agoAuto merge of #42887 - GuillaumeGomez:remove-err-methods, r=nikomatsakis
bors [Thu, 29 Jun 2017 11:13:39 +0000 (11:13 +0000)]
Auto merge of #42887 - GuillaumeGomez:remove-err-methods, r=nikomatsakis

Remove err methods

To be merged after #42519.

cc @Susurrus @QuietMisdreavus

7 years agoAuto merge of #42964 - arielb1:rollup, r=arielb1
bors [Thu, 29 Jun 2017 08:40:39 +0000 (08:40 +0000)]
Auto merge of #42964 - arielb1:rollup, r=arielb1

Rollup of 12 pull requests

- Successful merges: #42219, #42831, #42832, #42884, #42886, #42901, #42919, #42920, #42946, #42953, #42955, #42958
- Failed merges:

7 years agoRollup merge of #42958 - aidanhs:aphs-better-stamping, r=Mark-Simulacrum
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:13 +0000 (08:40 +0000)]
Rollup merge of #42958 - aidanhs:aphs-better-stamping, r=Mark-Simulacrum

Better timestamps in builds

r? @Mark-Simulacrum

7 years agoRollup merge of #42955 - matklad:doc-path, r=steveklabnik
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:12 +0000 (08:40 +0000)]
Rollup merge of #42955 - matklad:doc-path, r=steveklabnik

Document that `/` works as separator on Windows

Hi Whenever I see code like `Path::new("./src/bin/main.rs")` or `path.ends_with("foo/bar")`, I wonder if it will work on Windows as I expect. Unfortunately, reading the current docs does not help to answer this question, because all examples are Unix-specific.

However, I believe that using `/` is fine, because both Windows itself [and Rust stdlib](https://github.com/rust-lang/rust/blob/47faf1d51952ecd9d4c8a7325332fba34fbe00bd/src/libstd/sys/windows/path.rs#L26) do treat it as a file separator, and because it is [actually used](https://github.com/rust-lang/cargo/blob/abf01e1eddb3145c83f71b469ea7bee37141e5e1/tests/git.rs#L579) in Cargo. So looks like we can just document it?

r? @steveklabnik

cc @retep998 I don't actually program for windows that much, so I might be totally wrong, and perhaps we should advise to always use (allocating) `.join` method to construct paths of more than one component?

7 years agoRollup merge of #42953 - estebank:fix-20729, r=petrochenkov
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:10 +0000 (08:40 +0000)]
Rollup merge of #42953 - estebank:fix-20729, r=petrochenkov

Move type parameter shadowing test to `ui`

Fix #20729.

7 years agoRollup merge of #42946 - AndiDog:patch-1, r=GuillaumeGomez
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:09 +0000 (08:40 +0000)]
Rollup merge of #42946 - AndiDog:patch-1, r=GuillaumeGomez

compile-error.md: Fix link reference

Was a copy-paste mistake, I guess

7 years agoRollup merge of #42920 - behnam:cmp, r=BurntSushi
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:08 +0000 (08:40 +0000)]
Rollup merge of #42920 - behnam:cmp, r=BurntSushi

[libcore/cmp] Expand Ord/PartialOrd Derivable doc for enum types

Expand Derivable docblock section for `Ord` and `PartialOrd` to cover
`enum` types, in addition to the existing language explaining it for
`struct` types.

7 years agoRollup merge of #42919 - zackmdavis:once_again_we_heard_you_the_first_time, r=eddyb
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:07 +0000 (08:40 +0000)]
Rollup merge of #42919 - zackmdavis:once_again_we_heard_you_the_first_time, r=eddyb

make lint on-by-default/implied-by messages appear only once

From review discussion on #38103 (https://github.com/rust-lang/rust/pull/38103#discussion_r94845060).

![we_heard](https://user-images.githubusercontent.com/1076988/27564103-6284b78e-5a8a-11e7-9d35-f7f297ca9573.png)

r? @nikomatsakis

7 years agoRollup merge of #42901 - alexcrichton:alloc-one, r=sfackler
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:06 +0000 (08:40 +0000)]
Rollup merge of #42901 - alexcrichton:alloc-one, r=sfackler

std: Fix implementation of `Alloc::alloc_one`

This had an accidental `u8 as *mut T` where it was intended to have just a
normal pointer-to-pointer cast.

Closes #42827

7 years agoRollup merge of #42886 - durka:pplmm-mwe, r=petrochenkov
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:05 +0000 (08:40 +0000)]
Rollup merge of #42886 - durka:pplmm-mwe, r=petrochenkov

syntax: allow negative integer literal expression to be interpolated as pattern

Fixes #42820.

r? @jseyfried

7 years agoRollup merge of #42884 - stepancheg:set-env-run-pass, r=alexcrichton
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:04 +0000 (08:40 +0000)]
Rollup merge of #42884 - stepancheg:set-env-run-pass, r=alexcrichton

Move global vars changing tests into run-pass

Should fix race #42795

7 years agoRollup merge of #42832 - rthomas:doc-fmt, r=steveklabnik
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:03 +0000 (08:40 +0000)]
Rollup merge of #42832 - rthomas:doc-fmt, r=steveklabnik

Update docs for std::fmt::format #29355.

This rewords and removes the `Arguments` section from the docs for
fmt::format.

r? @steveklabnik

7 years agoRollup merge of #42831 - rthomas:master, r=QuietMisdreavus
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:02 +0000 (08:40 +0000)]
Rollup merge of #42831 - rthomas:master, r=QuietMisdreavus

Update docs for fmt::write.

#29355

I reworded it slightly to make it more clear that the function only take
two arguments - the output and the Arguments struct that can be
generated from the format_args! macro.

r? @steveklabnik

7 years agoRollup merge of #42219 - pwoolcoc:add-allow-fail-to-libtest, r=GuillaumeGomez
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:01 +0000 (08:40 +0000)]
Rollup merge of #42219 - pwoolcoc:add-allow-fail-to-libtest, r=GuillaumeGomez

add `allow_fail` test attribute

This change allows the user to add an `#[allow_fail]` attribute to
tests that will cause the test to compile & run, but if the test fails
it will not cause the entire test run to fail. The test output will
show the failure, but in yellow instead of red, and also indicate that
it was an allowed failure.

Here is an example of the output: http://imgur.com/a/wt7ga

7 years agoImprove long error explanations for E0620 and E0621
Guillaume Gomez [Tue, 27 Jun 2017 21:07:56 +0000 (23:07 +0200)]
Improve long error explanations for E0620 and E0621