]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAdapt cgu-partitioning tests to pre-trans symbol internalization.
Michael Woerister [Thu, 13 Jul 2017 11:29:14 +0000 (13:29 +0200)]
Adapt cgu-partitioning tests to pre-trans symbol internalization.

6 years agotrans: Internalize symbols at the trans-item level, without relying on LLVM.
Michael Woerister [Wed, 12 Jul 2017 15:37:58 +0000 (17:37 +0200)]
trans: Internalize symbols at the trans-item level, without relying on LLVM.

6 years agotrans: Collect all accesses between trans-items, not just inlining edges.
Michael Woerister [Wed, 12 Jul 2017 15:35:30 +0000 (17:35 +0200)]
trans: Collect all accesses between trans-items, not just inlining edges.

6 years agoAuto merge of #43107 - michaelwoerister:less-span-info-in-debug, r=nikomatsakis
bors [Wed, 12 Jul 2017 08:45:39 +0000 (08:45 +0000)]
Auto merge of #43107 - michaelwoerister:less-span-info-in-debug, r=nikomatsakis

incr.comp.: Don't include span information in the ICH of type definitions

This should improve some of the `regex` tests on perf.rlo. Not including spans into the ICH is harmless until we also cache warnings. To really solve the problem, we need to do more refactoring (see #43088).

r? @nikomatsakis

6 years agoAuto merge of #42697 - Mark-Simulacrum:take-limit, r=aturon
bors [Wed, 12 Jul 2017 06:23:38 +0000 (06:23 +0000)]
Auto merge of #42697 - Mark-Simulacrum:take-limit, r=aturon

Allow setting the limit on std::io::Take.

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

6 years agoAuto merge of #42936 - steveklabnik:update-mdbook, r=alexcrichton
bors [Wed, 12 Jul 2017 04:07:32 +0000 (04:07 +0000)]
Auto merge of #42936 - steveklabnik:update-mdbook, r=alexcrichton

update crate dependencies

I wanted to update mdbook's version. This ended up updating a bunch of other stuff too.

I am not sure if updating this much stuff is considered a Good Idea or not; happy to figure out how to make it smaller if someone can help me figure out how to use x.py to do it.

6 years agoupdate crate dependencies
steveklabnik [Tue, 27 Jun 2017 17:33:32 +0000 (13:33 -0400)]
update crate dependencies

I wanted to update mdbook's version. This ended up updating a bunch of other stuff too.

6 years agoAuto merge of #43056 - ids1024:nofollow2, r=burntsushi
bors [Wed, 12 Jul 2017 00:49:51 +0000 (00:49 +0000)]
Auto merge of #43056 - ids1024:nofollow2, r=burntsushi

Redox: Use O_NOFOLLOW for lstat()

6 years agoRedox: Use O_NOFOLLOW for lstat()
Ian Douglas Scott [Tue, 4 Jul 2017 02:21:03 +0000 (19:21 -0700)]
Redox: Use O_NOFOLLOW for lstat()

6 years agoAuto merge of #43083 - kennytm:fix-42434-custom-stdxxx-normalization, r=nikomatsakis
bors [Tue, 11 Jul 2017 22:02:20 +0000 (22:02 +0000)]
Auto merge of #43083 - kennytm:fix-42434-custom-stdxxx-normalization, r=nikomatsakis

compilertest (UI test): Support custom normalization.

Closes #42434.

Adds this header for UI tests:

```rust
// normalize-stderr-32bit: "fn() (32 bits)" -> "fn() ($PTR bits)"
```

It will normalize the `stderr` output on 32-bit platforms, by replacing all instances of `fn() (32 bits)` by `fn() ($PTR bits)`.

Extends the UI tests in #42304 and #41968 to 32-bit targets.

r? @nikomatsakis

6 years agoAuto merge of #43116 - alexcrichton:probestack, r=sfackler
bors [Tue, 11 Jul 2017 17:52:42 +0000 (17:52 +0000)]
Auto merge of #43116 - alexcrichton:probestack, r=sfackler

Update compiler_builtins submodule for probestack fix

Closes #43102

6 years agoAuto merge of #42388 - tschottdorf:projty-substs, r=nikomatsakis
bors [Tue, 11 Jul 2017 15:14:32 +0000 (15:14 +0000)]
Auto merge of #42388 - tschottdorf:projty-substs, r=nikomatsakis

Downgrade ProjectionTy's TraitRef to its substs

Addresses the second part of #42171 by removing the `TraitRef` from
`ProjectionTy`, and directly storing its `Substs`.

Closes #42171.

6 years agoDowngrade ProjectionTy's TraitRef to its substs
Tobias Schottdorf [Tue, 11 Jul 2017 14:33:09 +0000 (10:33 -0400)]
Downgrade ProjectionTy's TraitRef to its substs

Addresses the second part of #42171 by removing the `TraitRef` from
`ProjectionTy`, and directly storing its `Substs`.

Closes #42171.

6 years agoAllow setting the limit on std::io::Take.
Mark Simulacrum [Fri, 16 Jun 2017 14:24:10 +0000 (08:24 -0600)]
Allow setting the limit on std::io::Take.

7 years agoAuto merge of #43006 - GuillaumeGomez:e0611-cleanup, r=nikomatsakis
bors [Tue, 11 Jul 2017 10:07:24 +0000 (10:07 +0000)]
Auto merge of #43006 - GuillaumeGomez:e0611-cleanup, r=nikomatsakis

Clean up some code

From #42669.

r? @nikomatsakis

7 years agoMerge ui/README.md into COMPILER_TESTS.md and describe how custom UI normalization...
kennytm [Thu, 6 Jul 2017 18:10:48 +0000 (02:10 +0800)]
Merge ui/README.md into COMPILER_TESTS.md and describe how custom UI normalization works.

7 years agocompiletest: Support custom normalization rules.
kennytm [Thu, 6 Jul 2017 05:54:58 +0000 (13:54 +0800)]
compiletest: Support custom normalization rules.

7 years agotweak word ordering
Niko Matsakis [Mon, 10 Jul 2017 17:45:10 +0000 (13:45 -0400)]
tweak word ordering

7 years agoClean up some code
Guillaume Gomez [Sat, 1 Jul 2017 13:41:49 +0000 (15:41 +0200)]
Clean up some code

7 years agocompiletest: Refactor: Move the `ignore-{}` logic into its own method.
kennytm [Thu, 6 Jul 2017 03:25:29 +0000 (11:25 +0800)]
compiletest: Refactor: Move the `ignore-{}` logic into its own method.

Prepare for `normalize-std???` which will share the same logic.
Added `ignore-32bit` and `ignore-64bit`.

7 years agoAuto merge of #43147 - oyvindln:deflate_fix, r=alexcrichton
bors [Tue, 11 Jul 2017 07:42:13 +0000 (07:42 +0000)]
Auto merge of #43147 - oyvindln:deflate_fix, r=alexcrichton

Use similar compression settings as before updating to use flate2

Fixes #42879

(My first PR to rust-lang yay)

This changes the compression settings back to how they were before the change to use the flate2 crate rather than the in-tree flate library. The specific changes are to use the `Fast` compression level (which should be equivialent to what was used before), and use a raw deflate stream rather than wrapping the stream in a zlib wrapper. The [zlib](https://tools.ietf.org/html/rfc1950) wrapper adds an extra 2 bytes of header data, and 4 bytes for a checksum at the end. The change to use a faster compression level did give some compile speedups in the past (see #37298). Having to calculate a checksum also added a small overhead, which didn't exist before the change to flate2.

r? @alexcrichton

7 years agoAuto merge of #42913 - kennytm:fix-40569-ident-without-backtrack, r=jseyfried
bors [Tue, 11 Jul 2017 04:04:11 +0000 (04:04 +0000)]
Auto merge of #42913 - kennytm:fix-40569-ident-without-backtrack, r=jseyfried

Only match a fragment specifier the if it starts with certain tokens.

When trying to match a fragment specifier, we first predict whether the current token can be matched at all. If it cannot be matched, don't bother to push the Earley item to `bb_eis`. This can fix a lot of issues which otherwise requires full backtracking (#42838).

In this PR the prediction treatment is not done for `:item`, `:stmt` and `:tt`, but it could be expanded in the future.

Fixes #24189.
Fixes #26444.
Fixes #27832.
Fixes #34030.
Fixes #35650.
Fixes #39964.
Fixes the 4th comment in #40569.
Fixes the issue blocking #40984.

7 years agoAuto merge of #43028 - michaelwoerister:dedup-dep-nodes, r=nikomatsakis
bors [Mon, 10 Jul 2017 21:18:14 +0000 (21:18 +0000)]
Auto merge of #43028 - michaelwoerister:dedup-dep-nodes, r=nikomatsakis

incr.comp.: Deduplicate some DepNodes and introduce anonymous DepNodes

This is a parallel PR to the pending https://github.com/rust-lang/rust/pull/42769. It implements most of what is possible in terms of DepNode re-opening without having anonymous DepNodes yet (https://github.com/rust-lang/rust/issues/42298).

r? @nikomatsakis

7 years agodon't panic in `dep_node_debug_str` if `self.data` is `None`
Niko Matsakis [Mon, 10 Jul 2017 19:45:36 +0000 (15:45 -0400)]
don't panic in `dep_node_debug_str` if `self.data` is `None`

7 years agoAuto merge of #43152 - Mark-Simulacrum:test-src-doc, r=alexcrichton
bors [Mon, 10 Jul 2017 18:17:00 +0000 (18:17 +0000)]
Auto merge of #43152 - Mark-Simulacrum:test-src-doc, r=alexcrichton

Test src/doc once more

This was accidentally broken in https://github.com/rust-lang/rust/pull/42437 since we filtered too early to recurse into sub-directories.

In theory, @bors p=10

r? @alexcrichton

7 years agoTest src/doc once more
Mark Simulacrum [Mon, 10 Jul 2017 17:43:02 +0000 (11:43 -0600)]
Test src/doc once more

7 years agoUse similar compression settings as before updating to use flate2
oyvindln [Mon, 10 Jul 2017 15:54:50 +0000 (17:54 +0200)]
Use similar compression settings as before updating to use flate2

Fixes #42879

7 years agoAuto merge of #43109 - pnkfelix:fix-link_args-gate, r=nikomatsakis
bors [Mon, 10 Jul 2017 15:39:47 +0000 (15:39 +0000)]
Auto merge of #43109 - pnkfelix:fix-link_args-gate, r=nikomatsakis

Fix feature gate for `#[link_args(..)]` attribute

Fix feature gate for `#[link_args(..)]` attribute so that it will fire regardless of context of attribute.

See also #29596 and #43106

7 years agoFix feature gate for `#[link_args(..)]` attribute so that it will fire
Felix S. Klock II [Fri, 7 Jul 2017 14:09:46 +0000 (16:09 +0200)]
Fix feature gate for `#[link_args(..)]` attribute so that it will fire
regardless of context of attribute.

Extend the gating test to include the attribute in "weird" places.

7 years agoincr.comp.: Cache DepNodes with corresponding query results.
Michael Woerister [Tue, 4 Jul 2017 15:33:43 +0000 (17:33 +0200)]
incr.comp.: Cache DepNodes with corresponding query results.

7 years agoincr.comp.: Introduce the concept of anonymous DepNodes.
Michael Woerister [Fri, 23 Jun 2017 14:37:12 +0000 (16:37 +0200)]
incr.comp.: Introduce the concept of anonymous DepNodes.

7 years agoincr.comp.: Manage dependency graph on main thread.
Michael Woerister [Tue, 4 Jul 2017 13:06:57 +0000 (15:06 +0200)]
incr.comp.: Manage dependency graph on main thread.

7 years agoFix some `tidy` errors.
Michael Woerister [Tue, 4 Jul 2017 12:23:07 +0000 (14:23 +0200)]
Fix some `tidy` errors.

7 years agoDeduplicate DepNode::ConstEval()
Michael Woerister [Mon, 3 Jul 2017 14:37:48 +0000 (16:37 +0200)]
Deduplicate DepNode::ConstEval()

7 years agoAllow 'tcx in define_dep_nodes! and deduplicate some DepNodes.
Michael Woerister [Fri, 30 Jun 2017 21:53:35 +0000 (14:53 -0700)]
Allow 'tcx in define_dep_nodes! and deduplicate some DepNodes.

7 years agoAdd StableHash implementation for ty::Instance.
Michael Woerister [Fri, 30 Jun 2017 21:51:03 +0000 (14:51 -0700)]
Add StableHash implementation for ty::Instance.

7 years agoincr.comp.: Improve debug output for work products.
Michael Woerister [Fri, 23 Jun 2017 14:37:12 +0000 (16:37 +0200)]
incr.comp.: Improve debug output for work products.

7 years agoSplit DepNode::ItemSignature into non-overlapping variants.
Michael Woerister [Thu, 22 Jun 2017 08:54:26 +0000 (10:54 +0200)]
Split DepNode::ItemSignature into non-overlapping variants.

7 years agoAuto merge of #43115 - petrochenkov:methlife2, r=eddyb
bors [Sun, 9 Jul 2017 21:40:16 +0000 (21:40 +0000)]
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.

7 years agoUpdate rls to pull rustfmt with libsyntax changes
Vadim Petrochenkov [Sat, 8 Jul 2017 00:32:19 +0000 (03:32 +0300)]
Update rls to pull rustfmt with libsyntax changes

7 years agoStore all generic arguments for method calls in HIR
Vadim Petrochenkov [Fri, 7 Jul 2017 12:57:51 +0000 (15:57 +0300)]
Store all generic arguments for method calls in HIR

7 years agoStore all generic arguments for method calls in AST
Vadim Petrochenkov [Thu, 6 Jul 2017 23:39:55 +0000 (02:39 +0300)]
Store all generic arguments for method calls in AST

7 years agoAuto merge of #43130 - GuillaumeGomez:rustdoc-fn-spacing, r=QuietMisdreavus
bors [Sun, 9 Jul 2017 17:58:10 +0000 (17:58 +0000)]
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">

7 years agoAuto merge of #43117 - MJDSys:fix_rustbuild_libdir_2, r=alexcrichton
bors [Sun, 9 Jul 2017 15:42:47 +0000 (15:42 +0000)]
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.

7 years agoAdd spacing between trait functions
Guillaume Gomez [Sat, 8 Jul 2017 22:40:29 +0000 (00:40 +0200)]
Add spacing between trait functions

7 years agoAuto merge of #43082 - ids1024:condvar2, r=alexcrichton
bors [Sun, 9 Jul 2017 04:23:29 +0000 (04:23 +0000)]
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.

7 years agoAuto merge of #43128 - ibabushkin:master, r=eddyb
bors [Sun, 9 Jul 2017 01:48:11 +0000 (01:48 +0000)]
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.

7 years agoAuto merge of #43097 - PlasmaPower:large-align, r=eddyb
bors [Sat, 8 Jul 2017 22:09:04 +0000 (22:09 +0000)]
Auto merge of #43097 - PlasmaPower:large-align, r=eddyb

Raise alignment limit from 2^15 to 2^31 - 1

Fixes #42960

7 years agoImplemented `TypeFoldable` for `TypeError`s.
Inokentiy Babushkin [Sat, 8 Jul 2017 21:24:00 +0000 (23:24 +0200)]
Implemented `TypeFoldable` for `TypeError`s.

7 years agoAuto merge of #43075 - durka:error-long-link, r=nikomatsakis
bors [Sat, 8 Jul 2017 19:50:13 +0000 (19:50 +0000)]
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.

7 years agoInternally limit alignment to 2^30
Lee Bousfield [Sat, 8 Jul 2017 17:43:52 +0000 (13:43 -0400)]
Internally limit alignment to 2^30

7 years agoAuto merge of #43019 - kevinmehall:cleanup-errors, r=nikomatsakis
bors [Sat, 8 Jul 2017 17:30:37 +0000 (17:30 +0000)]
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.

7 years agoBox large array to avoid blowing the stack
Lee Bousfield [Sat, 8 Jul 2017 17:02:52 +0000 (13:02 -0400)]
Box large array to avoid blowing the stack

7 years agoAuto merge of #42996 - Boreeas:merge-e0609-e0612, r=GuillaumeGomez
bors [Sat, 8 Jul 2017 15:18:46 +0000 (15:18 +0000)]
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

7 years agoLower alignment limit down to 2^31 - 1 (from LLVM)
Lee Bousfield [Sat, 8 Jul 2017 14:28:20 +0000 (10:28 -0400)]
Lower alignment limit down to 2^31 - 1 (from LLVM)

7 years agoRaised alignment limit from 2^15 to 2^31
Lee Bousfield [Thu, 6 Jul 2017 22:00:46 +0000 (18:00 -0400)]
Raised alignment limit from 2^15 to 2^31

7 years agoAuto merge of #43104 - nbaksalyar:rustbuild-illumos-fix, r=sanxiyn
bors [Sat, 8 Jul 2017 13:08:11 +0000 (13:08 +0000)]
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.

7 years agoAuto merge of #43077 - SimonSapin:ranges, r=alexcrichton
bors [Sat, 8 Jul 2017 07:30:21 +0000 (07:30 +0000)]
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.

7 years agoAdd tests for reaching the end of RangeInclusive as an iterator
Simon Sapin [Thu, 6 Jul 2017 16:13:44 +0000 (18:13 +0200)]
Add tests for reaching the end of RangeInclusive as an iterator

7 years agoAdd tests for Range*::nth
Simon Sapin [Thu, 6 Jul 2017 15:13:29 +0000 (17:13 +0200)]
Add tests for Range*::nth

7 years agoImplement O(1)-time Iterator::nth for Range*
Simon Sapin [Wed, 5 Jul 2017 23:14:20 +0000 (01:14 +0200)]
Implement O(1)-time Iterator::nth for Range*

7 years agoFactorize some macros in iter/range.rs
Simon Sapin [Wed, 5 Jul 2017 22:32:54 +0000 (00:32 +0200)]
Factorize some macros in iter/range.rs

7 years agoRemove Step::steps_between, rename steps_between_by_one to steps_between
Simon Sapin [Wed, 5 Jul 2017 22:10:40 +0000 (00:10 +0200)]
Remove Step::steps_between, rename steps_between_by_one to steps_between

7 years agoRemove unused Step methods
Simon Sapin [Wed, 5 Jul 2017 21:54:08 +0000 (23:54 +0200)]
Remove unused Step methods

7 years agoRemove unused Add bounds in iterator for ranges impls.
Simon Sapin [Wed, 5 Jul 2017 21:49:33 +0000 (23:49 +0200)]
Remove unused Add bounds in iterator for ranges impls.

7 years agoAuto merge of #43072 - cuviper:linux-stack-guard, r=alexcrichton
bors [Sat, 8 Jul 2017 04:22:49 +0000 (04:22 +0000)]
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

7 years agoUpdate compiler_builtins submodule for probestack fix
Alex Crichton [Sat, 8 Jul 2017 04:11:35 +0000 (21:11 -0700)]
Update compiler_builtins submodule for probestack fix

Closes #43102

7 years agoFix stage 2 builds with a custom libdir.
Matthew Dawson [Sat, 8 Jul 2017 03:00:38 +0000 (23:00 -0400)]
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.

7 years agoAuto merge of #42894 - petrochenkov:deny, r=nikomatsakis
bors [Sat, 8 Jul 2017 02:03:38 +0000 (02:03 +0000)]
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

7 years agoMake `patterns_in_fns_without_body` warn-by-default again
Vadim Petrochenkov [Sat, 8 Jul 2017 00:01:11 +0000 (03:01 +0300)]
Make `patterns_in_fns_without_body` warn-by-default again

Fix some tests on Linux

7 years agoMove public reexports of private extern crates into a separate lint
Vadim Petrochenkov [Sun, 25 Jun 2017 02:50:51 +0000 (05:50 +0300)]
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.

7 years agoMake sufficiently old or low-impact compatibility lints deny-by-default
Vadim Petrochenkov [Sun, 25 Jun 2017 02:30:20 +0000 (05:30 +0300)]
Make sufficiently old or low-impact compatibility lints deny-by-default

7 years agoRemove more anonymous trait method parameters
Vadim Petrochenkov [Sun, 25 Jun 2017 02:29:10 +0000 (05:29 +0300)]
Remove more anonymous trait method parameters

7 years agoAuto merge of #42840 - arielb1:poison-smoke-and-mirrors, r=nikomatsakis
bors [Fri, 7 Jul 2017 21:15:30 +0000 (21:15 +0000)]
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

7 years agoFold E0613 into E0609
boreeas [Fri, 30 Jun 2017 18:36:51 +0000 (20:36 +0200)]
Fold E0613 into E0609

Resolves #42945

7 years agoAuto merge of #42809 - seanmonstar:stable-associated-consts, r=nikomatsakis
bors [Fri, 7 Jul 2017 18:42:14 +0000 (18:42 +0000)]
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

7 years agoreturn EvaluatedToRecur when evaluating a recursive obligation tree
Ariel Ben-Yehuda [Fri, 30 Jun 2017 11:18:04 +0000 (14:18 +0300)]
return EvaluatedToRecur when evaluating a recursive obligation tree

This helps avoid cache pollution. Also add more comments explaining
that.

7 years agouse the evaluation cache instead of the global fulfillment cache
Ariel Ben-Yehuda [Thu, 22 Jun 2017 21:27:47 +0000 (00:27 +0300)]
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.

7 years agouse dep-graph reads for the evaluation cache
Ariel Ben-Yehuda [Mon, 26 Jun 2017 15:39:52 +0000 (18:39 +0300)]
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.

7 years agoprevent illegal coinductive matching in trait evaluation
Ariel Ben-Yehuda [Mon, 26 Jun 2017 14:23:15 +0000 (17:23 +0300)]
prevent illegal coinductive matching in trait evaluation

Previously, coinductive matching was only blocked on the fulfillment
path, and ignored on the evaluation path.

7 years agoSkip the main thread's manual stack guard on Linux
Josh Stone [Wed, 5 Jul 2017 19:03:17 +0000 (12:03 -0700)]
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.

7 years agoRedox: Fix Condvar.wait(); do not lock mutex twice
Ian Douglas Scott [Wed, 5 Jul 2017 19:00:46 +0000 (12:00 -0700)]
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.

7 years agoAuto merge of #43099 - japaric:msp430, r=alexcrichton
bors [Fri, 7 Jul 2017 15:27:49 +0000 (15:27 +0000)]
Auto merge of #43099 - japaric:msp430, r=alexcrichton

add a built-in MSP430 target

the MSP430 backend has been enabled for a while but no target was added to rustc
to encourage out of tree experimentation.

We believe the out of tree (custom) target has been iterated long enough and is
stable enough for inclusion in the compiler. Kudos to @pftbest and @awygle for
fixing several LLVM / codegen bugs this target had!

The target name chosen is a slight variation of the triple gcc uses, which is
simply `msp430-elf`. We picked `msp430-none-elf` to leave room for custom
targets that target some embedded OS running on MSP430 devices. (cf. the
custom `thumbv7m-tockos-eabi` target TockOS uses vs the built-in
`thumbv7m-none-eabi`).

There's one expected change in the specification of the proposed target: the
`asm_args` and `no_integrated_as` fields will change to their default values.
Once the LLVM backend gains the ability to directly produce MSP430 object files
we can stop depending on `msp430-elf-gcc` for producing object files; when that
occurs the `asm` related fields will change. This change won't break existing
user code.

r? @alexcrichton
cc @brson

7 years agoAuto merge of #43093 - rthomas:39791-hashmap, r=alexcrichton
bors [Fri, 7 Jul 2017 12:54:46 +0000 (12:54 +0000)]
Auto merge of #43093 - rthomas:39791-hashmap, r=alexcrichton

Add annotations to the resize fn #39791

This adds the `inline(never)` and `cold` annotations to the
HashMap::resize function.

7 years agoincr.comp.: Don't include span information in the ICH of type definitions.
Michael Woerister [Fri, 7 Jul 2017 12:23:38 +0000 (14:23 +0200)]
incr.comp.: Don't include span information in the ICH of type definitions.

7 years agoAuto merge of #43060 - petrochenkov:asless, r=estebank
bors [Fri, 7 Jul 2017 10:37:38 +0000 (10:37 +0000)]
Auto merge of #43060 - petrochenkov:asless, r=estebank

syntax: Apply `x as usize < y` recovery to type ascription as well

Also correct spans, add some comments.

r? @estebank

7 years agosyntax: Apply recovery for casts to type ascription
Vadim Petrochenkov [Mon, 3 Jul 2017 23:17:01 +0000 (02:17 +0300)]
syntax: Apply recovery for casts to type ascription

Fix spans, add some comments

7 years agoFix spans for binary operator expression with interpolated identifiers
Vadim Petrochenkov [Tue, 4 Jul 2017 14:04:34 +0000 (17:04 +0300)]
Fix spans for binary operator expression with interpolated identifiers

7 years agoAuto merge of #43091 - aidanhs:aphs-no-docker-priv, r=alexcrichton
bors [Fri, 7 Jul 2017 08:13:20 +0000 (08:13 +0000)]
Auto merge of #43091 - aidanhs:aphs-no-docker-priv, r=alexcrichton

Privileged in docker run isn't necessary

Added relatively recently in https://github.com/rust-lang/rust/pull/40199/files#diff-71609a365528e4649836825d8250c241R57, but I don't see anything in that PR that requires it. If it's not strictly necessary, we shouldn't use it.

(if this lands I'll make a PR against libc which also uses privileged)

r? @alexcrichton

7 years agoOnly match a fragment specifier the if it starts with certain tokens.
kennytm [Mon, 26 Jun 2017 14:23:59 +0000 (22:23 +0800)]
Only match a fragment specifier the if it starts with certain tokens.

Fixes #24189.
Fixes #26444.
Fixes #27832.
Fixes #34030.
Fixes #35650.
Fixes #39964.
Fixes the 4th comment in #40569.
Fixes the issue blocking #40984.

7 years agoAuto merge of #43068 - ollie27:rustdoc_markdown_tests, r=GuillaumeGomez
bors [Fri, 7 Jul 2017 06:01:30 +0000 (06:01 +0000)]
Auto merge of #43068 - ollie27:rustdoc_markdown_tests, r=GuillaumeGomez

rustdoc: Don't run Markdown tests twice

This matches the behaviour for finding tests in Rust files.

This was a regression from 1.17 to 1.18 so it would be a good idea to backport this to beta so at least 1.19 won't also be affected.

Fixes #42726

r? @GuillaumeGomez

7 years agoFix Rustbuild linking on Illumos
Nikita Baksalyar [Fri, 7 Jul 2017 05:32:18 +0000 (08:32 +0300)]
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.

7 years agoAuto merge of #43062 - sfackler:connect-timeout, r=alexcrichton
bors [Fri, 7 Jul 2017 03:43:14 +0000 (03:43 +0000)]
Auto merge of #43062 - sfackler:connect-timeout, r=alexcrichton

Implement TcpStream::connect_timeout

This breaks the "single syscall rule", but it's really annoying to hand
write and is pretty foundational.

r? @alexcrichton

cc @rust-lang/libs

7 years agoImplement TcpStream::connect_timeout
Steven Fackler [Wed, 5 Jul 2017 06:46:24 +0000 (23:46 -0700)]
Implement TcpStream::connect_timeout

This breaks the "single syscall rule", but it's really annoying to hand
write and is pretty foundational.

7 years agoRemove unused code from librustc_errors
Kevin Mehall [Sun, 2 Jul 2017 20:46:38 +0000 (13:46 -0700)]
Remove unused code from librustc_errors

7 years agoAuto merge of #42125 - petrochenkov:privty, r=nikomatsakis
bors [Fri, 7 Jul 2017 01:32:13 +0000 (01:32 +0000)]
Auto merge of #42125 - petrochenkov:privty, r=nikomatsakis

Check types for privacy

This PR implements late post factum checking of type privacy, as opposed to early preventive "private-in-public" checking.
This will allow to turn private-in-public checks into a lint and make them more heuristic-based, and more aligned with what people may expect (e.g. reachability-based behavior).

Types are privacy-checked if they are written explicitly, and also if they are inferred as expression or pattern types.
This PR checks "semantic" types and does it unhygienically, this significantly restricts what macros 2.0 (as implemented in https://github.com/rust-lang/rust/pull/40847) can do (sorry @jseyfried) - they still can use private *names*, but can't use private *types*.
This is the most conservative solution, but hopefully it's temporary and can be relaxed in the future, probably using macro contexts of expression/pattern spans.

Traits are also checked in preparation for [trait aliases](https://github.com/rust-lang/rust/issues/41517), which will be able to leak private traits, and macros 2.0 which will be able to leak pretty much anything.

This is a [breaking-change], but the code that is not contrived and can be broken by this patch should be guarded by `private_in_public` lint. [Previous crater run](https://github.com/rust-lang/rust/issues/34537#issuecomment-262865768) discovered a few abandoned crates that weren't updated since `private_in_public` has been introduced in 2015.

cc https://github.com/rust-lang/rust/issues/34537 https://internals.rust-lang.org/t/lang-team-minutes-private-in-public-rules/4504
Fixes https://github.com/rust-lang/rust/issues/30476
Fixes https://github.com/rust-lang/rust/issues/33479

cc @nikomatsakis
r? @eddyb

7 years agoAddress review comments
petrochenkov [Thu, 29 Jun 2017 13:06:24 +0000 (16:06 +0300)]
Address review comments

Fix regressions after rebase

7 years agoAuto merge of #42904 - estebank:number-suggestions, r=nikomatsakis
bors [Thu, 6 Jul 2017 22:22:21 +0000 (22:22 +0000)]
Auto merge of #42904 - estebank:number-suggestions, r=nikomatsakis

Make suggestion include the line number

When there're more than one suggestions in the same diagnostic, they are
displayed in their own block, instead of inline. In order to reduce
confusion, those blocks now display the line number.

New output:

```
error[E0308]: mismatched types
  --> ../../src/test/ui/block-result/unexpected-return-on-unit.rs:19:5
   |
19 |     foo()
   |     ^^^^^ expected (), found usize
   |
   = note: expected type `()`
              found type `usize`
help: did you mean to add a semicolon here?
   |
19 |     foo();
   |          ^
help: possibly return type missing here?
   |
18 | fn bar() -> usize {
   |          ^^^^^^^^

error: aborting due to previous error(s)
```

Fix #39152.

7 years agoPrivileged in docker run isn't necessary
Aidan Hobson Sayers [Thu, 6 Jul 2017 17:42:49 +0000 (18:42 +0100)]
Privileged in docker run isn't necessary

7 years agoadd a built-in MSP430 target
Jorge Aparicio [Thu, 6 Jul 2017 20:15:44 +0000 (15:15 -0500)]
add a built-in MSP430 target