Commit Graph

67069 Commits

Author SHA1 Message Date
bors
bef07b859d Auto merge of #43999 - arielb1:immediate-project, r=nikomatsakis
clear out projection subobligations after they are processed

After a projection was processed, its derived subobligations no longer
need any processing when encountered, and can be removed. This improves
the status of #43787.

This is actually complementary to #43938 - that PR fixes selection
caching (and @remram44's example, which "accidentally" worked because of
the buggy projection caching) while this PR fixes projection caching.

r? @nikomatsakis
2017-08-28 20:42:27 +00:00
bors
9a59d69323 Auto merge of #43076 - Zoxc:gen, r=arielb1
Generator support

This adds experimental support for generators intended to land once https://github.com/rust-lang/rfcs/pull/2033 is approved.

This is not yet ready to be merged. Things to do:
- [x] Make closure arguments on generators an error
- [x] Spot FIXMEs
- [x] Pass make tidy
- [x] Write tests
- [x] Document the current syntax and semantics for generators somewhere
- [x] Use proper error message numbers
- [x] ~~Make the implicit argument type default to `()`~~
2017-08-28 16:36:03 +00:00
Alex Crichton
a996d5eec7 Tweak rls submodule again 2017-08-28 07:32:25 -07:00
bors
5caca6fa02 Auto merge of #44114 - daboross:patch-1, r=dtolnay
Clarify that VecDeque::swap can panic

The previous documentation mentioned this, but ambiguously used the term "fail".

This clarifies that the function will panic if the index is out of bounds, instead of silently failing and not doing anything.

If there's anything else I can do to improve this PR, I'd be happy to do so! Just saw this when reading through the docs in passing - it was slightly unclear what "fail" meant.
2017-08-28 10:42:11 +00:00
Alex Crichton
876278f395 Ignore a threaded test on emscripten 2017-08-27 23:37:50 -07:00
bors
a0c3bd2d23 Auto merge of #44107 - alexcrichton:no-shell-configure, r=Mark-Simulacrum
rustbuild: Rewrite the configure script in Python

This commit rewrites our ancient `./configure` script from shell into Python.
The impetus for this change is to remove `config.mk` which is just a vestige of
the old makefile build system at this point. Instead all configuration is now
solely done through `config.toml`.

The python script allows us to more flexibly program (aka we can use loops
easily) and create a `config.toml` which is based off `config.toml.example`.
This way we can preserve comments and munge various values as we see fit.

It is intended that the configure script here is a drop-in replacement for the
previous configure script, no functional change is intended. Also note that the
rationale for this is also because our build system requires Python, so having a
python script a bit earlier shouldn't cause too many problems.

Closes #40730
Closes #43295
Closes #42255
Closes #38058
Closes #32176
2017-08-28 06:04:10 +00:00
Alex Crichton
9eff522c6d Update the rls submodule again 2017-08-27 21:01:16 -07:00
Alex Crichton
a9b0a7ba93 rustbuild: Rewrite the configure script in Python
This commit rewrites our ancient `./configure` script from shell into Python.
The impetus for this change is to remove `config.mk` which is just a vestige of
the old makefile build system at this point. Instead all configuration is now
solely done through `config.toml`.

The python script allows us to more flexibly program (aka we can use loops
easily) and create a `config.toml` which is based off `config.toml.example`.
This way we can preserve comments and munge various values as we see fit.

It is intended that the configure script here is a drop-in replacement for the
previous configure script, no functional change is intended. Also note that the
rationale for this is also because our build system requires Python, so having a
python script a bit earlier shouldn't cause too many problems.

Closes #40730
2017-08-27 18:53:30 -07:00
Alex Crichton
8a9e32b3fa Update lock file 2017-08-27 18:52:02 -07:00
John Kåre Alsaker
d29af37999 Merge branch 'master' of https://github.com/rust-lang/rust into gen 2017-08-28 02:41:16 +02:00
John Kåre Alsaker
7c5780b356 Update rls 2017-08-28 02:39:17 +02:00
bors
e266888240 Auto merge of #44110 - alexcrichton:docker-init, r=Mark-Simulacrum
ci: Remove the need for `dumb-init`

Newer versions of Docker have a `--init` argument which spawns an init process
in the container, which we should be able to use everywhere now.
2017-08-27 15:31:11 +00:00
Ariel Ben-Yehuda
7534f7375b clear out projection subobligations after they are processed
After a projection was processed, its derived subobligations no longer
need any processing when encountered, and can be removed. This improves
the status of #43787.

This is actually complementary to #43938 - that PR fixes selection
caching (and @remram44's example, which "accidentally" worked because of
the buggy projection caching) while this PR fixes projection caching
2017-08-27 18:13:23 +03:00
bors
eb8f2586eb Auto merge of #44060 - taleks:issue-43205, r=arielb1
Fixes issue #43205: ICE in Rvalue::Len evaluation.

- fixes evaluation of array length for zero-sized type referenced by rvalue operand.
- adds test to verify fix.

*Cause of the issue*.

Zero-sized aggregates are handled as operands, not lvalues. Therefore while visiting `Assign` statement by `LocalAnalyser`, `mark_as_lvalue()` is not called for related `Local`. This behaviour is controlled by `rvalue_creates_operand()` method.

As result it causes error later, when rvalue operand is evaluated in `trans_rvalue_operand()` while handling `Rvalue::Len` case. Array length evaluation invokes `trans_lvalue()` which expects referenced `Local` to be value, not operand.

*How it is fixed*.

In certain cases result of `Rvalue::Len` can be evaluated without calling
`trans_lvalue()`. Method `evaluate_array_len()` is introduced to handle length
evaluation for zero-sized types referenced by Locals.

*Some concerns*.

- `trans_lvalue()` has two other entry points in `rvalue.rs`: it is invoked while handling `Rvalue::Ref` and `Rvalue::Discriminant`. There is a chance those may produce the same issue, but I've failed to write a specific test that leads to this.
- `evaluate_array_len()` performs the same check (matches lvalue and `Local`), which is performed again in `trans_lvalue()`. Without changing `trans_lvalue()` signature to make it aware that caller deals with rvalue, it seems there is no cheap solution to avoid this check.
2017-08-27 12:53:48 +00:00
David Ross
f1b91f4037 Clarify that VecDeque::swap can panic
The previous documentation mentioned this, but ambiguously used the term "fail".

This clarifies that the function will panic if the index is out of bounds, instead of silently failing and not doing anything.
2017-08-27 03:22:53 -07:00
bors
78e95bb7ac Auto merge of #42588 - ishitatsuyuki:patch-1, r=petrochenkov
Make unused-extern-crate warn-by-default

Apart from enabling the lint, this pull request also removes existing unused crates in the codebase, and fix some amount of false positives on crates with special purposes.

Now that all false positive issues are closed, it should be possible to make it available to wider users.

Quote:
> Now that macro modularization is implemented, this is true today! *https://github.com/rust-lang/rust/issues/30849#issuecomment-286573218*

Concerns: can break some `#[deny(warnings)]`.

Close #42591
2017-08-27 10:02:51 +00:00
Tatsuyuki Ishi
a91bdf4ad5 Update Cargo submodule 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
2140a1e5c6 Whitelist for dummy_jemalloc 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
7a8d38e522 Additional libc cleanup 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
7f054990b6 Platform gate libc in libtest 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
bf9bdefe8a Whitelist unwind import in std
This is a part of libbacktrace linkage and thus the compiler cannot detect if it's used or not.
2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
6e18fe4d22 Add missing dependency for Windows 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
8309a4c43b Address review comments, second turn 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
611b111139 Move unused-extern-crate to late pass 2017-08-27 19:02:24 +09:00
Tatsuyuki Ishi
bc5bd51c45 Make unused-extern-crate warn-by-default 2017-08-27 19:02:24 +09:00
bors
93cdf5e3c4 Auto merge of #44112 - alexcrichton:thread-join, r=sfackler
std: Handle OS errors when joining threads

Also add to the documentation that the `join` method can panic.

cc #34971
cc #43539
2017-08-27 04:20:28 +00:00
Alex Crichton
dc7c7ba0c9 std: Handle OS errors when joining threads
Also add to the documentation that the `join` method can panic.

cc #34971
cc #43539
2017-08-26 19:36:46 -07:00
bors
3e96461230 Auto merge of #44102 - Mark-Simulacrum:update-cargo, r=alexcrichton
Update cargo

Should permit https://github.com/rust-lang/rust/pull/41991 to move forward. I think it's best to land this as a separate patch and rebase that, though.

r? @alexcrichton
2017-08-27 01:41:45 +00:00
Alex Crichton
ffe64a26ab ci: Remove the need for dumb-init
Newer versions of Docker have a `--init` argument which spawns an init process
in the container, which we should be able to use everywhere now.
2017-08-26 18:34:13 -07:00
bors
ff33b60a80 Auto merge of #44096 - Dushistov:master, r=japaric
Add test for wrong code generation for HashSet creation on arm cpu

This is test for #42918.
To reproduce bug you need machine with arm cpu and compile with optimization.
I tried with rustc 1.19.0-nightly (3d5b8c626 2017-06-09),
if compile test with -C opt-level=3 for target=arm-linux-androideabi
and run on "Qualcomm MSM 8974 arm cpu" then assert fails,
if compile and run with -C opt-level=2 it gives segmentation fault.
So I add `compile-flags: -O`.
With rustc 1.19.0 (0ade33941 2017-07-17) all works fine.
Closes #42918
2017-08-26 23:11:44 +00:00
bors
003a929f99 Auto merge of #44084 - alexcrichton:msvc-ninja, r=Mark-Simulacrum
rustbuild: Automatically enable Ninja on MSVC

Discovered in #43767 it turns out the default MSBuild generator in CMake for
whatever reason isn't supporting many of the configuration options we give to
LLVM. To improve the contributor experience automatically enable Ninja if we
find it to ensure that "flavorful" configurations of LLVM work by default in
more situations.

Closes #43767
2017-08-26 20:21:28 +00:00
Mark Simulacrum
a947c6a595 Update cargo 2017-08-26 12:30:57 -06:00
bors
315e7022f3 Auto merge of #44082 - pnkfelix:issue-43457, r=eddyb
Fix destruction extent lookup during HIR -> HAIR translation

My method for finding the destruction extent, if any, from cbed41a174 (in #39409), was buggy in that it sometimes failed to find an extent that was nonetheless present.

This fixes that, and is cleaner code to boot.

Fix #43457
2017-08-26 17:48:29 +00:00
bors
32f6056079 Auto merge of #44098 - frewsxcv:rollup, r=frewsxcv
Rollup of 7 pull requests

- Successful merges: #43776, #43966, #43979, #44072, #44086, #44090, #44091
- Failed merges:
2017-08-26 15:17:32 +00:00
Corey Farwell
502a11d53e Rollup merge of #44091 - kallisti5:haiku-fix, r=eddyb
haiku/librustc_back: Remove incorrect no_integrated_as

* Makes rust bootstrap incorrectly search for xxx.s vs xxx.0.s
* Not needed or incorrect fix for another issue.
2017-08-26 06:46:37 -07:00
Corey Farwell
fdf4598f8c Rollup merge of #44090 - GuillaumeGomez:str-doc, r=steveklabnik
Add missing link in string doc

r? @rust-lang/docs
2017-08-26 06:46:36 -07:00
Corey Farwell
cc5c1e39f4 Rollup merge of #44086 - kennytm:htmldocck-python3, r=Mark-Simulacrum
Allow `htmldocck.py` to run using Python 3
2017-08-26 06:46:35 -07:00
Corey Farwell
7e8753d1c1 Rollup merge of #44072 - lukaramu:fix-doc-headings, r=steveklabnik
Fix inconsistent doc headings

This fixes headings reading "Unsafety" and "Example", they should be "Safety" and "Examples" according to RFC 1574.

r? @steveklabnik
2017-08-26 06:46:34 -07:00
Corey Farwell
b4dcdee0fd Rollup merge of #43979 - Jouan:Add-links-for-impls, r=GuillaumeGomez
Add links for impls

Implements a solution for issue #23552
r? @QuietMisdreavus
2017-08-26 06:46:33 -07:00
Corey Farwell
e9a6dccce0 Rollup merge of #43966 - GuillaumeGomez:remove-dup, r=QuietMisdreavus
Remove duplicates in rustdoc

Fixes #43934.

Two things however:

 1. I'm not happy with the current check. It seems completely overkill and unsatisfying.
 2. I have no idea how to test if there is only one element and not two.

r? @rust-lang/docs
2017-08-26 06:46:32 -07:00
Corey Farwell
1412ff5512 Rollup merge of #43776 - zackmdavis:feature_gate_fn_must_use, r=alexcrichton
feature-gate #[must_use] for functions as `fn_must_use`

@eddyb I [was](https://github.com/rust-lang/rust/pull/43728#issuecomment-320854120) [dithering](https://github.com/rust-lang/rust/pull/43728#issuecomment-320856407) on this, but [your comment](https://github.com/rust-lang/rust/issues/43302#issuecomment-321174989) makes it sound like we do want a feature gate for this? Please advise.

r? @eddyb
2017-08-26 06:46:31 -07:00
bors
669d4770f2 Auto merge of #44081 - est31:master, r=eddyb
Fix a byte/char confusion issue in the error emitter

Fixes #44078. Fixes #44023.

The start_col member is given in chars, while the code previously assumed it was given in bytes.

The more basic issue #44080 doesn't get fixed.
2017-08-26 12:50:11 +00:00
bors
e7070dd019 Auto merge of #44071 - alexcrichton:no-cycles, r=nikomatsakis
rustc: Start moving toward "try_get is a bug" for incremental

This PR is an effort to burn down some of the work items on #42633. The basic change here was to leave the `try_get` function exposed but have it return a `DiagnosticBuilder` instead of a `CycleError`. This means that it should be a compiler bug to *not* handle the error as dropping a diagnostic should result in a complier panic.

After that change it was then necessary to update the compiler's callsites of `try_get` to handle the error coming out. These were handled as:

* The `sized_constraint` and `needs_drop_raw` checks take the diagnostic and defer it as a compiler bug. This was a new piece of functionality added to the error handling infrastructure, and the idea is that for both these checks a "real" compiler error should be emitted elsewhere, so it's only a bug if we don't actually emit the complier error elsewhere.
* MIR inlining was updated to just ignore the diagnostic. This is being tracked by https://github.com/rust-lang/rust/issues/43542 which sounded like it either already had some work underway or was planning to change regardless.
* The final case, `item_path`, is still sort of up for debate. At the time of this writing this PR simply removes the invocations of `try_get` there, assuming that the query will always succeed. This turns out to be true for the test suite anyway! It sounds like, though, that this logic was intended to assist in "weird" situations like `RUST_LOG` where debug implementations can trigger at any time. This PR would therefore, however, break those implementations.

I'm unfortunately sort of out of ideas on how to handle `item_path`, but other thoughts would be welcome!

Closes #42633
2017-08-26 08:25:44 +00:00
Evgeniy A. Dushistov
911a15d5a8 Add test for wrong code generation for HashSet creation on arm cpu
This is test for #42918.
To reproduce bug you need machine with arm cpu and compile with optimization.
I tried with rustc 1.19.0-nightly (3d5b8c626 2017-06-09),
if compile test with -C opt-level=3 for target=arm-linux-androideabi
and run on "Qualcomm MSM 8974 arm cpu" then assert fails,
if compile and run with -C opt-level=2 it gives segmentation fault.
So I add `compile-flags: -O`.
With rustc 1.19.0 (0ade33941 2017-07-17) all works fine.
Closes #42918
2017-08-26 08:33:35 +03:00
bors
398aaffc94 Auto merge of #44028 - nrc:rls-update, r=alexcrichton
Update RLS and Cargo

r? @alexcrichton
2017-08-26 01:28:57 +00:00
Nick Cameron
7cb3f45063 Update RLS and Cargo 2017-08-25 18:12:47 -07:00
Alex Crichton
c766aa4e3b rustc: Make report_cycle and CycleError private 2017-08-25 17:37:21 -07:00
Alex Crichton
c77213d0cc rustc: Skip cyclic checks in item_path
This seems like it may be likely to cause bugs with `RUST_LOG` and other
"interesting" scenarios, but it removes the usage of `try_get` for now!
2017-08-25 16:08:35 -07:00
Alex Crichton
82bad957c0 rustc: Add a FIXME for try_get in MIR inlining
It sounds like this is being handled elsewhere, so for now just preserve the
existing behavior of ignoring th error.
2017-08-25 16:08:35 -07:00
Alex Crichton
ecb29c11bb rustc: Fix two instances of try_get
The `sized_constraint` and `needs_drop_raw` queries both use `try_get` to detect
cycles, but in both of these cases the cycle indicates an error has happened
elsewhere in compilation. In these cases we can just delay the diagnostic to get
emitted as a bug later if we ended up forgetting to emit the error diagnostic.
2017-08-25 16:08:35 -07:00