Commit Graph

65554 Commits

Author SHA1 Message Date
Michael Woerister
089860b603 incr.comp.: Manage dependency graph on main thread. 2017-07-10 12:21:39 +02:00
Michael Woerister
13e87d1dbb Fix some tidy errors. 2017-07-10 12:20:56 +02:00
Michael Woerister
f8b774f1cf Deduplicate DepNode::ConstEval() 2017-07-10 12:20:56 +02:00
Michael Woerister
e00bec2dd4 Allow 'tcx in define_dep_nodes! and deduplicate some DepNodes. 2017-07-10 12:20:56 +02:00
Michael Woerister
9808661b3d Add StableHash implementation for ty::Instance. 2017-07-10 12:20:56 +02:00
Michael Woerister
ca0a40396c incr.comp.: Improve debug output for work products. 2017-07-10 12:20:56 +02:00
Michael Woerister
2557800fd6 Split DepNode::ItemSignature into non-overlapping variants. 2017-07-10 12:20:56 +02:00
bors
d84693b93d Auto merge of #43115 - petrochenkov:methlife2, r=eddyb
Store all generic arguments for method calls in AST/HIR

The first part of https://github.com/rust-lang/rust/pull/42492.
Landed separately to start the process of merging libsyntax changes breaking rustfmt, which is not easy these days.
2017-07-09 21:40:16 +00:00
Vadim Petrochenkov
9ac79e4934 Update rls to pull rustfmt with libsyntax changes 2017-07-10 00:20:25 +03:00
Vadim Petrochenkov
8c44a9dca7 Store all generic arguments for method calls in HIR 2017-07-10 00:20:25 +03:00
Vadim Petrochenkov
287de2595a Store all generic arguments for method calls in AST 2017-07-10 00:20:25 +03:00
bors
8b1271fcdd Auto merge of #43130 - GuillaumeGomez:rustdoc-fn-spacing, r=QuietMisdreavus
Add spacing between trait functions

Fixes #42988.

<img width="1440" alt="screen shot 2017-07-09 at 17 02 16" src="https://user-images.githubusercontent.com/3050060/27995068-672a3208-64c8-11e7-9bc7-c7288f2cd27b.png">
2017-07-09 17:58:10 +00:00
bors
55ad73b026 Auto merge of #43117 - MJDSys:fix_rustbuild_libdir_2, r=alexcrichton
Fix stage 2 builds with a custom libdir.

When copying libstd for the stage 2 compiler, the builder ignores the
configured libdir/libdir_relative configuration parameters.  This causes
the compiler to fail to find libstd, which cause any tools built with the
stage 2 compiler to fail.

To fix this, make the copy steps of rustbuild aware of the libdir_relative
parameter when the stage >= 2.  Also update the dist target to be aware of
the new location of libstd.
2017-07-09 15:42:47 +00:00
Guillaume Gomez
12dccbde41 Add spacing between trait functions 2017-07-09 16:47:29 +02:00
bors
12fef71f18 Auto merge of #43082 - ids1024:condvar2, r=alexcrichton
Redox: Fix Condvar.wait(); do not lock mutex twice

The atomic_xchg() loop locks the mutex, so the call to mutex_lock is
incorrect, and blocks.
2017-07-09 04:23:29 +00:00
bors
79f5c4eb58 Auto merge of #43128 - ibabushkin:master, r=eddyb
Implemented `TypeFoldable` for `TypeError`s.

This is quite handy in some user code, for instance to pull out type errors from an inference context when `fresh_substs_for_item` has been used before.
2017-07-09 01:48:11 +00:00
bors
4b7f41a225 Auto merge of #43097 - PlasmaPower:large-align, r=eddyb
Raise alignment limit from 2^15 to 2^31 - 1

Fixes #42960
2017-07-08 22:09:04 +00:00
Inokentiy Babushkin
41e62105d6
Implemented TypeFoldable for TypeErrors. 2017-07-08 23:24:00 +02:00
bors
720c596ec6 Auto merge of #43075 - durka:error-long-link, r=nikomatsakis
Fix links for typeck diagnostics without tripping tidy

Pick up #42624 to fix #43070 (cc @frewsxcv). I fixed a few other links while I was at it.
2017-07-08 19:50:13 +00:00
Lee Bousfield
b4973e9619
Internally limit alignment to 2^30 2017-07-08 13:43:52 -04:00
bors
b695889fd6 Auto merge of #43019 - kevinmehall:cleanup-errors, r=nikomatsakis
Remove unused code from librustc_errors

While extracting librustc_errors into a [reusable library](https://github.com/kevinmehall/codemap-diagnostic), I noticed some obsolete code that the `dead_code` warning missed because it was marked `pub` but not used elsewhere.
2017-07-08 17:30:37 +00:00
Lee Bousfield
da81a33b05
Box large array to avoid blowing the stack 2017-07-08 13:02:52 -04:00
bors
1e5162ce5b Auto merge of #42996 - Boreeas:merge-e0609-e0612, r=GuillaumeGomez
Fold E0612, E0613 into E0609

As discussed in #42945, with PR 1506 tuple indices are no longer considered a separate case from normal field. This PR folds E06012 ("tuple index out of bounds") and E0613 ("type is not a tuple") into E0609 ("type does not have field with that name")

Resolves #42945
2017-07-08 15:18:46 +00:00
Lee Bousfield
afed75a2d9 Lower alignment limit down to 2^31 - 1 (from LLVM) 2017-07-08 10:28:56 -04:00
Lee Bousfield
a10213f297 Raised alignment limit from 2^15 to 2^31 2017-07-08 10:28:56 -04:00
bors
ac1b675c58 Auto merge of #43104 - nbaksalyar:rustbuild-illumos-fix, r=sanxiyn
Fix Rustbuild linking on Illumos

Illumos (an OpenSolaris fork) expects to get several extra library references for some system functions used by Rust standard library. This commit adds required linker options to rustbuild, which is currently doesn't work on Illumos-based operating systems.
2017-07-08 13:08:11 +00:00
bors
4d4d76cf42 Auto merge of #43077 - SimonSapin:ranges, r=alexcrichton
Implement O(1)-time Iterator::nth for Range*, and slim the Step trait

Fixes #43064.
Fixes part of #39975.
Fixes items 1 <s>and 3</s> of #42168.
CC #27741.

I think #42310 and #43012 should not have landed without the `nth` part of this PR, but oh well.
2017-07-08 07:30:21 +00:00
Simon Sapin
e9a61eeb04 Add tests for reaching the end of RangeInclusive as an iterator 2017-07-08 08:55:55 +02:00
Simon Sapin
7a40307a7c Add tests for Range*::nth 2017-07-08 08:55:55 +02:00
Simon Sapin
de4afc6797 Implement O(1)-time Iterator::nth for Range* 2017-07-08 08:55:55 +02:00
Simon Sapin
8e8fd02419 Factorize some macros in iter/range.rs 2017-07-08 08:55:55 +02:00
Simon Sapin
d1ec6c22d1 Remove Step::steps_between, rename steps_between_by_one to steps_between 2017-07-08 08:55:55 +02:00
Simon Sapin
4b2f40dfdf Remove unused Step methods 2017-07-08 08:55:55 +02:00
Simon Sapin
dbed18ca20 Remove unused Add bounds in iterator for ranges impls. 2017-07-08 08:55:28 +02:00
bors
4b6af9704a Auto merge of #43072 - cuviper:linux-stack-guard, r=alexcrichton
Skip the main thread's manual stack guard on Linux

Linux doesn't allocate the whole stack right away, and the kernel has its own stack-guard mechanism to fault when growing too close to an existing mapping.  If we map our own guard, then the kernel starts enforcing a rather large gap above that, rendering much of the possible stack space useless.

Instead, we'll just note where we expect rlimit to start faulting, so our handler can report "stack overflow", and trust that the kernel's own stack guard will work.

Fixes #43052.
r? @alexcrichton

### Kernel compatibility:

Strictly speaking, Rust claims support for Linux kernels >= 2.6.18, and stack guards were only added to mainline in 2.6.36 for [CVE-2010-2240].  But since that vulnerability was so severe, the guards were backported to many stable branches, and Red Hat patched this all the way back to RHEL3's 2.4.21!  I think it's reasonable for us to assume that any *supportable* kernel should have these stack guards.

At that time, the kernel only enforced one page of padding between the stack and other mappings, but thanks to [Stack Clash] that padding is now much larger, causing #43052.  The kernel side of those fixes are in [CVE-2017-1000364], which Red Hat has backported to at least RHEL5's 2.6.18 so far.

[CVE-2010-2240]: https://access.redhat.com/security/cve/CVE-2010-2240
[CVE-2017-1000364]: https://access.redhat.com/security/cve/CVE-2017-1000364
[Stack Clash]: https://access.redhat.com/security/vulnerabilities/stackguard
2017-07-08 04:22:49 +00:00
Matthew Dawson
ce3abc5801
Fix stage 2 builds with a custom libdir.
When copying libstd for the stage 2 compiler, the builder ignores the
configured libdir/libdir_relative configuration parameters.  This causes
the compiler to fail to find libstd, which cause any tools built with the
stage 2 compiler to fail.

To fix this, make the copy steps of rustbuild aware of the libdir_relative
parameter when the stage >= 2.  Also update the dist target to be aware of
the new location of libstd.
2017-07-07 23:07:01 -04:00
bors
fb4fa6080f Auto merge of #42894 - petrochenkov:deny, r=nikomatsakis
Make sufficiently old or low-impact compatibility lints deny-by-default

Needs crater run before proceeding.

r? @nikomatsakis
2017-07-08 02:03:38 +00:00
Vadim Petrochenkov
9196f874e4 Make patterns_in_fns_without_body warn-by-default again
Fix some tests on Linux
2017-07-08 03:01:11 +03:00
Vadim Petrochenkov
bdffb9722d Move public reexports of private extern crates into a separate lint
This is going to be a hard error while all private-in-public errors from rustc_privacy will be reclassified into lints.
2017-07-08 01:56:27 +03:00
Vadim Petrochenkov
96bcdac9e4 Make sufficiently old or low-impact compatibility lints deny-by-default 2017-07-08 01:56:27 +03:00
Vadim Petrochenkov
affb8ee831 Remove more anonymous trait method parameters 2017-07-08 01:56:27 +03:00
bors
9b85e1cfa5 Auto merge of #42840 - arielb1:poison-smoke-and-mirrors, r=nikomatsakis
Replace the global fulfillment cache with the evaluation cache

This uses the new "Chalk" ParamEnv refactoring to check "global" predicates in an empty environment, which should be correct because global predicates aren't affected by a consistent environment.

Fixes #39970.
Fixes #42796.

r? @nikomatsakis
2017-07-07 21:15:30 +00:00
boreeas
c215d08c4c Fold E0613 into E0609
Resolves #42945
2017-07-07 21:47:39 +02:00
bors
13157c4ebc Auto merge of #42809 - seanmonstar:stable-associated-consts, r=nikomatsakis
remove associated_consts feature gate

Currently struggling to run tests locally (something about jemalloc target missing).

cc #29646
2017-07-07 18:42:14 +00:00
Ariel Ben-Yehuda
b7b965a3e7 return EvaluatedToRecur when evaluating a recursive obligation tree
This helps avoid cache pollution. Also add more comments explaining
that.
2017-07-07 14:05:21 -04:00
Ariel Ben-Yehuda
87a11812e1 use the evaluation cache instead of the global fulfillment cache
The evaluation cache already exists, and it can handle differing
parameter environments natively.

Fixes #39970.
Fixes #42796.
2017-07-07 14:05:02 -04:00
Ariel Ben-Yehuda
16d1700337 use dep-graph reads for the evaluation cache
This is just duplicating the logic from the old fulfillment cache, so
I'm not sure it is 100% correct, but it should not be more wrong than
the old logic.
2017-07-07 14:03:47 -04:00
Ariel Ben-Yehuda
14875fd3b7 prevent illegal coinductive matching in trait evaluation
Previously, coinductive matching was only blocked on the fulfillment
path, and ignored on the evaluation path.
2017-07-07 14:03:23 -04:00
Josh Stone
be509b3387 Skip the main thread's manual stack guard on Linux
Linux doesn't allocate the whole stack right away, and the kernel has
its own stack-guard mechanism to fault when growing too close to an
existing mapping.  If we map our own guard, then the kernel starts
enforcing a rather large gap above that, rendering much of the possible
stack space useless.

Instead, we'll just note where we expect rlimit to start faulting, so
our handler can report "stack overflow", and trust that the kernel's own
stack guard will work.

Fixes #43052.
2017-07-07 09:19:04 -07:00
Ian Douglas Scott
59981e4057
Redox: Fix Condvar.wait(); do not lock mutex twice
The atomic_xchg() loop locks the mutex, so the call to mutex_lock is
incorrect, and blocks.
2017-07-07 08:34:48 -07:00