]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAuto merge of #42732 - cengizIO:master, r=Mark-Simulacrum
bors [Tue, 4 Jul 2017 23:50:11 +0000 (23:50 +0000)]
Auto merge of #42732 - cengizIO:master, r=Mark-Simulacrum

Add pager support for `rustc --explain EXXXX`

Hello!

Fixes #32665.

Thanks!

**EDIT:** _I've limited access to a Windows machine so this is taking longer than I've anticipated_. 🐢

cc @alexcrichton @nikomatsakis @Mark-Simulacrum @retep998 @ollie27 @afiune

7 years agoAuto merge of #43051 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Tue, 4 Jul 2017 15:58:24 +0000 (15:58 +0000)]
Auto merge of #43051 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 8 pull requests

- Successful merges: #42227, #42836, #42975, #42994, #43041, #43042, #43043, #43045
- Failed merges:

7 years agoRollup merge of #43045 - PlasmaPower:patch-1, r=Mark-Simulacrum
Mark Simulacrum [Tue, 4 Jul 2017 13:41:45 +0000 (07:41 -0600)]
Rollup merge of #43045 - PlasmaPower:patch-1, r=Mark-Simulacrum

README: note how to enable debugging for rustc

I got stuck on this for a bit, looking for a debug option in `./x.py build --help`.

Diff without newline changes:

Before:

> Various other options are also supported, and are documented in the config file.

After:

> Various other options, such as enabling debug information, are also supported, and are documented in the config file.

7 years agoRollup merge of #43043 - sfackler:reverse-stability, r=Mark-Simulacrum
Mark Simulacrum [Tue, 4 Jul 2017 13:41:44 +0000 (07:41 -0600)]
Rollup merge of #43043 - sfackler:reverse-stability, r=Mark-Simulacrum

Add a stability marker for core::cmp::Reverse.0

Closes #43027

7 years agoRollup merge of #43042 - Mark-Simulacrum:rustbuild-cleanup, r=alexcrichton
Mark Simulacrum [Tue, 4 Jul 2017 13:41:43 +0000 (07:41 -0600)]
Rollup merge of #43042 - Mark-Simulacrum:rustbuild-cleanup, r=alexcrichton

Various minor cleanups to rustbuild

This is work I did before the migration to the new rustbuild. I'd prefer to land this first, before my other PR, to make the diff a little clearer.

r? @alexcrichton

7 years agoRollup merge of #43041 - andersk:dedup_by, r=alexcrichton
Mark Simulacrum [Tue, 4 Jul 2017 13:41:42 +0000 (07:41 -0600)]
Rollup merge of #43041 - andersk:dedup_by, r=alexcrichton

Document unintuitive argument order for Vec::dedup_by relation

When trying to use `dedup_by` to merge some auxiliary information from removed elements into kept elements, I was surprised to observe that `vec.dedup_by(same_bucket)` calls `same_bucket(a, b)` where `b` appears before `a` in the vector, and discards `a` when true is returned.  This argument order is probably a bug, but since it has already been stabilized, I guess we should document it as a feature and move on.

(`Vec::dedup` also uses `==` with this unexpected argument order, but I figure that’s not important since `==` is expected to be symmetric with no side effects.)

7 years agoRollup merge of #42994 - stepancheg:ignore-iml, r=aturon
Mark Simulacrum [Tue, 4 Jul 2017 13:41:41 +0000 (07:41 -0600)]
Rollup merge of #42994 - stepancheg:ignore-iml, r=aturon

Ignore *.iml files

... which are IntelliJ IDEA module files. (`.idea` is IDEA project files.)

7 years agoRollup merge of #42975 - ids1024:symlink2, r=aturon
Mark Simulacrum [Tue, 4 Jul 2017 13:41:40 +0000 (07:41 -0600)]
Rollup merge of #42975 - ids1024:symlink2, r=aturon

redox: symlink and readlink

7 years agoRollup merge of #42836 - rthomas:29355-debug, r=GuillaumeGomez
Mark Simulacrum [Tue, 4 Jul 2017 13:41:39 +0000 (07:41 -0600)]
Rollup merge of #42836 - rthomas:29355-debug, r=GuillaumeGomez

Update docs for Debug* structs. #29355

This adds docs for the Debug* structs as well as examples from the
Formatter::debug_* methods, so that a user knows how to construct them.

I added these examples as the builders module is not public and hence
the debug_*_new() functions are not available to a user.

r? @steveklabnik

7 years agoRollup merge of #42227 - ollie27:into_to_from, r=aturon
Mark Simulacrum [Tue, 4 Jul 2017 13:41:33 +0000 (07:41 -0600)]
Rollup merge of #42227 - ollie27:into_to_from, r=aturon

Convert Intos to Froms.

This is a resubmission of #42129 without `impl<T> From<Vec<T>> for Box<[T]>`.

7 years agoUse build.build instead of build.config.build
Mark Simulacrum [Tue, 27 Jun 2017 21:59:43 +0000 (15:59 -0600)]
Use build.build instead of build.config.build

7 years agoMove targets, hosts, and build triple into Build.
Mark Simulacrum [Tue, 27 Jun 2017 21:52:46 +0000 (15:52 -0600)]
Move targets, hosts, and build triple into Build.

7 years agoStore verbosity on Build
Mark Simulacrum [Tue, 27 Jun 2017 19:49:21 +0000 (13:49 -0600)]
Store verbosity on Build

Prevents accidental mistakes in not using the right verbosity by going
to only config or flags.

7 years agoStore positive instead of negative fail_fast.
Mark Simulacrum [Tue, 27 Jun 2017 19:37:24 +0000 (13:37 -0600)]
Store positive instead of negative fail_fast.

This makes later negation much easier to interpret.

7 years agoRemove src_is_git, instead call method on rust_info directly.
Mark Simulacrum [Tue, 27 Jun 2017 19:34:26 +0000 (13:34 -0600)]
Remove src_is_git, instead call method on rust_info directly.

7 years agoClarify meaning of Build.cargo, Build.rustc.
Mark Simulacrum [Tue, 27 Jun 2017 19:32:04 +0000 (13:32 -0600)]
Clarify meaning of Build.cargo, Build.rustc.

Rename Build.{cargo, rustc} to {initial_cargo, initial_rustc}.

7 years agoUpdate a few comments.
Mark Simulacrum [Tue, 27 Jun 2017 19:24:37 +0000 (13:24 -0600)]
Update a few comments.

7 years agoClippy lints
Mark Simulacrum [Tue, 27 Jun 2017 15:51:26 +0000 (09:51 -0600)]
Clippy lints

7 years agoCleanup dist
Mark Simulacrum [Tue, 27 Jun 2017 15:05:47 +0000 (09:05 -0600)]
Cleanup dist

7 years agoCleanup utils
Mark Simulacrum [Tue, 27 Jun 2017 15:05:40 +0000 (09:05 -0600)]
Cleanup utils

7 years agoCleanup compile.rs.
Mark Simulacrum [Tue, 27 Jun 2017 00:13:10 +0000 (18:13 -0600)]
Cleanup compile.rs.

7 years agoCleanups to check code.
Mark Simulacrum [Mon, 26 Jun 2017 16:23:50 +0000 (10:23 -0600)]
Cleanups to check code.

7 years agoRemove 'static lifetimes from channels.
Mark Simulacrum [Sat, 24 Jun 2017 11:42:38 +0000 (05:42 -0600)]
Remove 'static lifetimes from channels.

7 years agoClean up and restructure sanity checking.
Mark Simulacrum [Wed, 21 Jun 2017 23:03:14 +0000 (17:03 -0600)]
Clean up and restructure sanity checking.

7 years agoDon't allocate args in order to run find.
Mark Simulacrum [Wed, 21 Jun 2017 17:15:49 +0000 (11:15 -0600)]
Don't allocate args in order to run find.

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 agoREADME: note how to enable debugging for rustc
Lee Bousfield [Tue, 4 Jul 2017 02:04:57 +0000 (22:04 -0400)]
README: note how to enable debugging for rustc

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 agoAdd a stability marker for core::cmp::Reverse.0
Steven Fackler [Mon, 3 Jul 2017 23:46:37 +0000 (13:46 -1000)]
Add a stability marker for core::cmp::Reverse.0

Closes #43027

7 years agoDocument unintuitive argument order for Vec::dedup_by relation
Anders Kaseorg [Mon, 3 Jul 2017 21:18:01 +0000 (17:18 -0400)]
Document unintuitive argument order for Vec::dedup_by relation

When trying to use dedup_by to merge some auxiliary information from
removed elements into kept elements, I was surprised to observe that
vec.dedup_by(same_bucket) calls same_bucket(a, b) where b appears
before a in the vector, and discards a when true is returned.  This
argument order is probably a bug, but since it has already been
stabilized, I guess we should document it as a feature and move on.

(Vec::dedup also uses == with this unexpected argument order, but I
figure that’s not important since == is expected to be symmetric with
no side effects.)

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
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 agoremove isatty dependency
Cengiz Can [Mon, 3 Jul 2017 08:46:12 +0000 (11:46 +0300)]
remove isatty dependency

7 years agouse single line comments
Cengiz Can [Mon, 3 Jul 2017 08:45:31 +0000 (11:45 +0300)]
use single line comments

7 years agouse embedded implementation instead of istty crate
Cengiz Can [Sun, 2 Jul 2017 22:34:25 +0000 (01:34 +0300)]
use embedded implementation instead of istty crate

7 years agodo not spawn pager if not tty
Cengiz Can [Sun, 2 Jul 2017 20:27:10 +0000 (23:27 +0300)]
do not spawn pager if not tty

7 years agouse unwrap_or_else to prevent unnecessary alloc
Cengiz Can [Thu, 29 Jun 2017 14:57:54 +0000 (17:57 +0300)]
use unwrap_or_else to prevent unnecessary alloc

7 years agodo not append an extra newline char
Cengiz Can [Thu, 29 Jun 2017 07:40:51 +0000 (10:40 +0300)]
do not append an extra newline char

7 years agouse PAGER to view --explain output #32665
Cengiz Can [Mon, 29 May 2017 21:13:09 +0000 (00:13 +0300)]
use PAGER to view --explain output #32665

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 agoAdd docs for Debug* structs. #29355
Ryan Thomas [Thu, 22 Jun 2017 19:49:22 +0000 (20:49 +0100)]
Add docs for Debug* structs. #29355

This adds docs for the Debug* structs as well as examples from the
Formatter::debug_* methods, so that a user knows how to construct them.

I added these examples as the builders module is not public and hence
the debug_*_new() functions are not available to a user.

r? @steveklabnik

Review comments.

Mainly adding in the links for all of the structs and functions.

Remove rust tag on code blocks.

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 agoFix long line
Ian Douglas Scott [Fri, 30 Jun 2017 20:37:05 +0000 (13:37 -0700)]
Fix long line

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 agoIgnore *.iml files
Stepan Koltsov [Fri, 30 Jun 2017 20:18:47 +0000 (23:18 +0300)]
Ignore *.iml files

... which are IntelliJ IDEA module files. (`.idea` is IDEA project files.)

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 agoredox: symlink and readlink
Ian Douglas Scott [Fri, 30 Jun 2017 00:22:36 +0000 (17:22 -0700)]
redox: symlink and readlink

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