Commit Graph

65356 Commits

Author SHA1 Message Date
Guillaume Gomez
bda06de5dc Rollup merge of #42987 - cuviper:iterator_for_each, r=Mark-Simulacrum
Track `iterator_for_each` in #42986

None
2017-06-30 22:44:48 +02:00
Guillaume Gomez
953d679362 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
2017-06-30 22:44:47 +02:00
Guillaume Gomez
bbdb21efbf Rollup merge of #42957 - GuillaumeGomez:add-e0619, r=nikomatsakis
Add E0619 error explanation

r? @eddyb
2017-06-30 22:44:46 +02:00
Guillaume Gomez
db004d4f55 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
2017-06-30 22:44:45 +02:00
Guillaume Gomez
ed04f56e9d Rollup merge of #42911 - nrc:rls-update, r=brson
Update RLS submodule
2017-06-30 22:44:44 +02:00
Guillaume Gomez
fc0fb0328b 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
2017-06-30 22:44:43 +02:00
Guillaume Gomez
162b5a3475 Fix error codes mixup 2017-06-30 22:43:35 +02:00
Guillaume Gomez
aa3fa25476 Add E0619 error explanation 2017-06-30 22:38:57 +02:00
Venkata Giri Reddy
4f13da7362 rustc_{a,l,m,t}san: re-run build script if env var LLVM_CONFIG changes 2017-06-30 17:35:00 +00:00
Josh Stone
741dc2bad5 Track iterator_for_each in #42986 2017-06-30 10:21:46 -07:00
Venkata Giri Reddy
401614b75a rustc_llvm: re-run build script when env var LLVM_CONFIG changes 2017-06-30 16:55:32 +00:00
bors
e72580cf09 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.
2017-06-30 13:39:25 +00:00
gaurikholkar
37a88f478d rename compile-fail test 2017-06-30 02:33:33 -07:00
bors
919c4a6707 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
2017-06-30 09:15:21 +00:00
Niko Matsakis
a43377773f move ERROR line 2017-06-30 05:11:28 -04:00
bors
4c5b437176 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
2017-06-30 06:17:52 +00:00
bors
a4c68c62f0 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.)
2017-06-30 03:56:33 +00:00
bors
5eef7c7966 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
2017-06-29 23:48:17 +00:00
Niko Matsakis
cb26a25d4b tweak comments in E0495.rs 2017-06-29 18:02:31 -04:00
gaurikholkar
4abcf28d2b adding compile-fail test 2017-06-29 14:13:53 -07:00
bors
3bfc18a961 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
2017-06-29 20:04:14 +00:00
bors
686ec28cea 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.
2017-06-29 15:04:31 +00:00
gaurikholkar
5be4fa864a code fixes for error code use warning 2017-06-29 06:37:18 -07:00
gaurikholkar
5841021f07 conflict fixes 2017-06-29 06:37:18 -07:00
gaurikholkar
e8b8f30373 Code review fixes 2017-06-29 06:37:18 -07:00
Niko Matsakis
95409016f8 remove fn main() { } from extended errors 2017-06-29 06:37:18 -07:00
gaurikholkar
aebc4e0074 Changing the error code to E0621 2017-06-29 06:37:18 -07:00
gaurikholkar
82f25b32ae code review fixes 2017-06-29 06:37:18 -07:00
gaurikholkar
a851e1e543 Adding changes to track anonymous region in self 2017-06-29 06:37:18 -07:00
gaurikholkar
2d99ffd11b track anonymous regions in return types, fix tidy errors 2017-06-29 06:37:18 -07:00
gaurikholkar
8fb6f74e57 Enabling E0611 for inherent functions 2017-06-29 06:37:18 -07:00
gaurikholkar
ae92bd095c Interchange ^ and - 2017-06-29 06:37:18 -07:00
Niko Matsakis
4bed5f0094 update reference for test 2017-06-29 06:37:18 -07:00
gaurikholkar
5df7a2c863 Adding new ui test for trait impl 2017-06-29 06:37:18 -07:00
gaurikholkar
176225c4dd Adding diagnostic code 0611 for lifetime errors with one named, one anonymous lifetime parameter 2017-06-29 06:37:18 -07:00
Masaki Hara
94862c601b
Correct comments about unsizing regarding #40319. 2017-06-29 21:25:35 +09:00
Masaki Hara
141265dfe8
Give a tracking-issue number for unsized tuple coercion. 2017-06-29 21:25:35 +09:00
Masaki Hara
03660b6476
Move unsized_tuple_coercion behind a feature gate. 2017-06-29 21:25:35 +09:00
Masaki Hara
b0bf1b4682
Split dst-dtor-{1,2} tests into four. 2017-06-29 21:23:33 +09:00
Masaki Hara
23d1521684
Add unsized tuple coercions. 2017-06-29 21:23:33 +09:00
Masaki Hara
17fca8b460
Check explicitly that tuple initializer is Sized. 2017-06-29 21:23:33 +09:00
petrochenkov
b33fd6d759 Change some terminology around keywords and reserved identifiers 2017-06-29 15:19:53 +03:00
Vadim Petrochenkov
e03948ef3e Make $crate a keyword 2017-06-29 15:19:52 +03:00
bors
d0e0f53376 Auto merge of #42887 - GuillaumeGomez:remove-err-methods, r=nikomatsakis
Remove err methods

To be merged after #42519.

cc @Susurrus @QuietMisdreavus
2017-06-29 11:13:39 +00:00
bors
7acce3724d 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:
2017-06-29 08:40:39 +00:00
Ariel Ben-Yehuda
d3329d7102 Rollup merge of #42958 - aidanhs:aphs-better-stamping, r=Mark-Simulacrum
Better timestamps in builds

r? @Mark-Simulacrum
2017-06-29 08:40:13 +00:00
Ariel Ben-Yehuda
b0ed6d11e1 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](47faf1d519/src/libstd/sys/windows/path.rs (L26)) do treat it as a file separator, and because it is [actually used](abf01e1edd/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?
2017-06-29 08:40:12 +00:00
Ariel Ben-Yehuda
4f121542e9 Rollup merge of #42953 - estebank:fix-20729, r=petrochenkov
Move type parameter shadowing test to `ui`

Fix #20729.
2017-06-29 08:40:10 +00:00
Ariel Ben-Yehuda
486aca787a Rollup merge of #42946 - AndiDog:patch-1, r=GuillaumeGomez
compile-error.md: Fix link reference

Was a copy-paste mistake, I guess
2017-06-29 08:40:09 +00:00
Ariel Ben-Yehuda
647a36da73 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.
2017-06-29 08:40:08 +00:00