]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoincr.comp.: Make the StableHashingContext mostly independent of the tcx.
Michael Woerister [Thu, 14 Sep 2017 12:01:40 +0000 (14:01 +0200)]
incr.comp.: Make the StableHashingContext mostly independent of the tcx.

6 years agoincr.comp.: Initialize IGNORED_ATTRS in StableHashingContext lazily.
Michael Woerister [Thu, 14 Sep 2017 10:29:16 +0000 (12:29 +0200)]
incr.comp.: Initialize IGNORED_ATTRS in StableHashingContext lazily.

6 years agoincr.comp.: Initialize the CachingCodemapView in StableHashingContext lazily.
Michael Woerister [Thu, 14 Sep 2017 10:08:03 +0000 (12:08 +0200)]
incr.comp.: Initialize the CachingCodemapView in StableHashingContext lazily.

6 years agoincr.comp.: Use StableHash impls instead of functions for hashing most maps.
Michael Woerister [Wed, 13 Sep 2017 16:20:27 +0000 (18:20 +0200)]
incr.comp.: Use StableHash impls instead of functions for hashing most maps.

6 years agoincr.comp.: Already hash HIR bodies during metadata export so they don't have to...
Michael Woerister [Wed, 13 Sep 2017 12:59:10 +0000 (14:59 +0200)]
incr.comp.: Already hash HIR bodies during metadata export so they don't have to be hashed in downstream crates.

6 years agoFix issues uncovered by rebasing:
Michael Woerister [Tue, 12 Sep 2017 15:07:09 +0000 (17:07 +0200)]
Fix issues uncovered by rebasing:

- Don't hash traits in scope as part of HIR hashing any more.
- Some queries returned DefIndexes from other crates.
- Provide a generic way of stably hashing maps (not used everywhere yet).

6 years agoincr.comp.: Move result fingerprinting to DepGraph::with_task().
Michael Woerister [Thu, 7 Sep 2017 14:11:58 +0000 (16:11 +0200)]
incr.comp.: Move result fingerprinting to DepGraph::with_task().

This makes sure that we don't introduce strange cases where we have
nodes outside the query system that could break red/green tracking
and it will allow to keep red/green neatly encapsulated within the
DepGraph implementation.

6 years agoincr.comp.: Compute hashes of all query results.
Michael Woerister [Mon, 14 Aug 2017 16:19:42 +0000 (18:19 +0200)]
incr.comp.: Compute hashes of all query results.

6 years agoUse DefId instead of NodeId as identifier in resolve_lifetime::Region.
Michael Woerister [Tue, 15 Aug 2017 15:05:25 +0000 (17:05 +0200)]
Use DefId instead of NodeId as identifier in resolve_lifetime::Region.

These Region values end up in crate metadata so they should not use NodeId.

6 years agoAuto merge of #43628 - oli-obk:orbital_standard_library, r=alexcrichton
bors [Mon, 18 Sep 2017 01:50:29 +0000 (01:50 +0000)]
Auto merge of #43628 - oli-obk:orbital_standard_library, r=alexcrichton

Run the miri test suite on the aux builder and travis

Reopen of #38350

see https://github.com/rust-lang/rust/pull/43340#issuecomment-316940762 for earlier discussion

Rationale for running miri's test suite in rustc's CI is that miri currently contains many features that we want in const eval in the future, and these features would break if the test suite is not run.

fixes #44077

r? @nikomatsakis

cc @eddyb

6 years agoAuto merge of #44529 - alexcrichton:trans-query, r=michaelwoerister
bors [Sun, 17 Sep 2017 22:05:31 +0000 (22:05 +0000)]
Auto merge of #44529 - alexcrichton:trans-query, r=michaelwoerister

Refactor translation unit partitioning/collection as a query

This commit is targeted at #44486 with the ultimate goal of making the `collect_and_partition_translation_items` function a query. This mostly just involved query-ifying a few other systems along with plumbing the tcx instead of `SharedCrateContext` in a few locations.

Currently this only tackles the first bullet of #44486 and doesn't add a dedicated query for a particular codegen unit. I wasn't quite sure how to do that yet but figured this was good to put up.

Closes #44486

6 years agoRebase fallout
Oliver Schneider [Sun, 17 Sep 2017 19:45:54 +0000 (21:45 +0200)]
Rebase fallout

6 years agoUpdate miri submodule
Oliver Schneider [Sun, 17 Sep 2017 19:42:35 +0000 (21:42 +0200)]
Update miri submodule

6 years agoPrevent distribution if miri is enabled
Oliver Schneider [Sun, 10 Sep 2017 09:48:56 +0000 (11:48 +0200)]
Prevent distribution if miri is enabled

6 years ago-Zmir-emit-validate is in stage 0
Oliver Schneider [Tue, 5 Sep 2017 15:22:52 +0000 (17:22 +0200)]
-Zmir-emit-validate is in stage 0

6 years agoAdd a file to trivially disable tool building or testing
Oliver Schneider [Wed, 30 Aug 2017 16:59:26 +0000 (18:59 +0200)]
Add a file to trivially disable tool building or testing

6 years agoImprove documentation
Oliver Schneider [Mon, 11 Sep 2017 09:00:51 +0000 (11:00 +0200)]
Improve documentation

6 years agoGet the miri test suite to run inside the rustc dev environment
Oliver Schneider [Mon, 28 Aug 2017 14:54:50 +0000 (16:54 +0200)]
Get the miri test suite to run inside the rustc dev environment

6 years agorustc: Move codegen to a query
Alex Crichton [Thu, 14 Sep 2017 03:26:39 +0000 (20:26 -0700)]
rustc: Move codegen to a query

This commit moves the actual code generation in the compiler behind a query
keyed by a codegen unit's name. This ended up entailing quite a few internal
refactorings to enable this, along with a few cut corners:

* The `OutputFilenames` structure is now tracked in the `TyCtxt` as it affects a
  whole bunch of trans and such. This is now behind a query and threaded into
  the construction of the `TyCtxt`.

* The `TyCtxt` now has a channel "out the back" intended to send data to worker
  threads in rustc_trans. This is used as a sort of side effect of the codegen
  query but morally what's happening here is the return value of the query
  (currently unit but morally a path) is only valid once the background threads
  have all finished.

* Dispatching work items to the codegen threads was refactored to only rely on
  data in `TyCtxt`, which mostly just involved refactoring where data was
  stored, moving it from the translation thread to the controller thread's
  `CodegenContext` or the like.

* A new thread locals was introduced in trans to work around the query
  system. This is used in the implementation of `assert_module_sources` which
  looks like an artifact of the old query system and will presumably go away
  once red/green is up and running.

6 years agoAuto merge of #44607 - alexcrichton:rustbuild-no-j, r=Mark-Simulacrum
bors [Sun, 17 Sep 2017 17:15:01 +0000 (17:15 +0000)]
Auto merge of #44607 - alexcrichton:rustbuild-no-j, r=Mark-Simulacrum

rustbuild: Don't pass `-j` if called by `make`

In these situations Cargo just prints out a warning about ignoring the flag
anyway, so let `make` take care of jobs and whatnot instead of getting warnings
printed.

6 years agorustc: Attach an mpsc channel to TyCtxt
Alex Crichton [Wed, 13 Sep 2017 23:03:24 +0000 (16:03 -0700)]
rustc: Attach an mpsc channel to TyCtxt

This commit attaches a channel to the LLVM workers to the `TyCtxt` which will
later be used during the codegen query to actually send work to LLVM workers.
Otherwise this commit is just plumbing this channel throughout the compiler to
ensure it reaches the right consumers.

6 years agorustc: Remove another global map from trans
Alex Crichton [Wed, 13 Sep 2017 22:24:13 +0000 (15:24 -0700)]
rustc: Remove another global map from trans

This commit removes the `crate_trans_items` field from the `CrateContext` of
trans. This field, a big map, was calculated during partioning and was a set of
all translation items. This isn't quite incremental-friendly because the map may
change a lot but not have much effect on downstream consumers.

Instead a new query was added for the one location this map was needed, along
with a new comment explaining what the location is doing!

6 years agorustc: Move a comment to the right spot in trans
Alex Crichton [Wed, 13 Sep 2017 22:04:51 +0000 (15:04 -0700)]
rustc: Move a comment to the right spot in trans

I believe this comment here is mostly talking about the `ptrcast` function call
below, so move the comment down to that block.

6 years agorustc: Mostly remove `ExportedSymbols`
Alex Crichton [Wed, 13 Sep 2017 20:22:20 +0000 (13:22 -0700)]
rustc: Mostly remove `ExportedSymbols`

This is a big map that ends up inside of a `CrateContext` during translation for
all codegen units. This means that any change to the map may end up causing an
incremental recompilation of a codegen unit! In order to reduce the amount of
dependencies here between codegen units and the actual input crate this commit
refactors dealing with exported symbols and such into various queries.

The new queries are largely based on existing queries with filled out
implementations for the local crate in addition to external crates, but the main
idea is that while translating codegen untis no unit needs the entire set of
exported symbols, instead they only need queries about particulare `DefId`
instances every now and then.

The linking stage, however, still generates a full list of all exported symbols
from all crates, but that's going to always happen unconditionally anyway, so no
news there!

6 years agorustc: Move some attr methods to queries
Alex Crichton [Tue, 12 Sep 2017 19:18:11 +0000 (12:18 -0700)]
rustc: Move some attr methods to queries

Otherwise we may emit double errors related to the `#[export_name]` attribute,
for example, and using a query should ensure that it's only emitted at most
once.

6 years agorustc: Make trans collect/partition a query
Alex Crichton [Tue, 12 Sep 2017 18:04:46 +0000 (11:04 -0700)]
rustc: Make trans collect/partition a query

This commit moves the `collect_and_partition_translation_items` function into a
query on `TyCtxt` instead of a free function in trans, allowing us to track
dependencies and such of the function.

6 years agorustc: Calculate `ExportedSymbols` in a query
Alex Crichton [Tue, 12 Sep 2017 16:32:37 +0000 (09:32 -0700)]
rustc: Calculate `ExportedSymbols` in a query

This commit moves the definition of the `ExportedSymbols` structure to the
`rustc` crate and then creates a query that'll be used to construct the
`ExportedSymbols` set. This in turn uses the reachablity query exposed in the
previous commit.

6 years agorustc: Use reachablility through a query
Alex Crichton [Tue, 12 Sep 2017 16:04:24 +0000 (09:04 -0700)]
rustc: Use reachablility through a query

Turns out this was already set up as a query, just wasn't using it yet!

6 years agorustc: Refactor trans paritioning to use tcx
Alex Crichton [Tue, 12 Sep 2017 15:32:50 +0000 (08:32 -0700)]
rustc: Refactor trans paritioning to use tcx

This commit refactors the the `partitioning::partition` function to operate with
a `TyCtxt` instead of a `SharedCrateContext` in preparation for making it a
query.

6 years agorustc_trans: Refactor collection to use tcx
Alex Crichton [Tue, 12 Sep 2017 15:28:17 +0000 (08:28 -0700)]
rustc_trans: Refactor collection to use tcx

This commit refactors the `collect_crate_translation_items` function to only
require the `TyCtxt` instead of a `SharedCrateContext` in preparation for
query-ifying this portion of trans.

6 years agorustbuild: Don't pass `-j` if called by `make`
Alex Crichton [Fri, 15 Sep 2017 16:40:35 +0000 (09:40 -0700)]
rustbuild: Don't pass `-j` if called by `make`

In these situations Cargo just prints out a warning about ignoring the flag
anyway, so let `make` take care of jobs and whatnot instead of getting warnings
printed.

6 years agoAuto merge of #44654 - TimNN:rollup, r=TimNN
bors [Sun, 17 Sep 2017 11:19:56 +0000 (11:19 +0000)]
Auto merge of #44654 - TimNN:rollup, r=TimNN

Rollup of 17 pull requests

- Successful merges: #44073, #44088, #44381, #44397, #44509, #44533, #44549, #44553, #44562, #44567, #44595, #44604, #44617, #44622, #44630, #44639, #44647
- Failed merges:

6 years agoRollup merge of #44647 - tmerr:fix-44645, r=dtolnay
Tim Neumann [Sun, 17 Sep 2017 11:19:15 +0000 (13:19 +0200)]
Rollup merge of #44647 - tmerr:fix-44645, r=dtolnay

Ensure tcp test case passes when disconnected from network

net::tcp::tests::connect_timeout_unroutable fails when the network
is unreachable, like on a laptop disconnected from wifi. Check for
this error and allow the test to pass.

Closes #44645

6 years agoRollup merge of #44639 - budziq:stabilize_needs_drop, r=dtolnay
Tim Neumann [Sun, 17 Sep 2017 11:19:14 +0000 (13:19 +0200)]
Rollup merge of #44639 - budziq:stabilize_needs_drop, r=dtolnay

stabilized needs_drop (fixes #41890)

fixes #41890

6 years agoRollup merge of #44630 - RalfJung:compiletest, r=Mark-Simulacrum
Tim Neumann [Sun, 17 Sep 2017 11:19:13 +0000 (13:19 +0200)]
Rollup merge of #44630 - RalfJung:compiletest, r=Mark-Simulacrum

compiletest: print the correct basename of the src dir

See <https://github.com/laumann/compiletest-rs/issues/76>.

Fixes #40712

6 years agoRollup merge of #44622 - frewsxcv:frewsxcv-invalid-link, r=QuietMisdreavus
Tim Neumann [Sun, 17 Sep 2017 11:19:12 +0000 (13:19 +0200)]
Rollup merge of #44622 - frewsxcv:frewsxcv-invalid-link, r=QuietMisdreavus

Fix incorrect `into_inner` link in docs.

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

6 years agoRollup merge of #44617 - alexcrichton:download-from-us-west-1, r=aidanhs
Tim Neumann [Sun, 17 Sep 2017 11:19:11 +0000 (13:19 +0200)]
Rollup merge of #44617 - alexcrichton:download-from-us-west-1, r=aidanhs

ci: Upload/download from a new S3 bucket

Moving buckets from us-east-1 to us-west-1 because us-west-1 is where
rust-central-station itself runs and in general is where we have all our other
buckets.

6 years agoRollup merge of #44604 - alexcrichton:update-cargo, r=Mark-Simulacrum
Tim Neumann [Sun, 17 Sep 2017 11:19:10 +0000 (13:19 +0200)]
Rollup merge of #44604 - alexcrichton:update-cargo, r=Mark-Simulacrum

Update cargo submodule

Just a routine update

6 years agoRollup merge of #44595 - budziq:stabilize_compiler_fences, r=alexcrichton
Tim Neumann [Sun, 17 Sep 2017 11:19:09 +0000 (13:19 +0200)]
Rollup merge of #44595 - budziq:stabilize_compiler_fences, r=alexcrichton

stabilized compiler_fences (fixes #41091)

I did not know what to proceed with "unstable-book" entry. The feature would no longer be unstable so I have deleted it. If it was the wrong call I'll revert it (unfortunately his case is not described in the CONTRIBUTING.md).

6 years agoRollup merge of #44567 - budziq:stabilize_iterator_for_each, r=alexcrichton
Tim Neumann [Sun, 17 Sep 2017 11:19:08 +0000 (13:19 +0200)]
Rollup merge of #44567 - budziq:stabilize_iterator_for_each, r=alexcrichton

stabilized iterator_for_each (closes #42986)

Also updated clippy and rls as these use the iterator_for_each

I've made my first PR's today so most likely I've done something wrong. Sorry about that!

6 years agoRollup merge of #44562 - eddyb:ugh-rustdoc, r=nikomatsakis
Tim Neumann [Sun, 17 Sep 2017 11:19:07 +0000 (13:19 +0200)]
Rollup merge of #44562 - eddyb:ugh-rustdoc, r=nikomatsakis

rustdoc: pretty-print Unevaluated expressions in types.

Fixes #44555.

r? @nikomatsakis

6 years agoRollup merge of #44553 - qmx:refactor-remove-overzealous-box-szero-optimization,...
Tim Neumann [Sun, 17 Sep 2017 11:19:06 +0000 (13:19 +0200)]
Rollup merge of #44553 - qmx:refactor-remove-overzealous-box-szero-optimization, r=arielb1

remove overzealous Box<ZeroSizeType> optimization

6 years agoRollup merge of #44549 - gaurikholkar:master, r=arielb1
Tim Neumann [Sun, 17 Sep 2017 11:19:05 +0000 (13:19 +0200)]
Rollup merge of #44549 - gaurikholkar:master, r=arielb1

extend E0623 for earlybound and latebound for structs

This fixes #44508

r? @nikomatsakis

6 years agoRollup merge of #44533 - nrc:rustfmt-submod, r=alexcrichton
Tim Neumann [Sun, 17 Sep 2017 11:19:04 +0000 (13:19 +0200)]
Rollup merge of #44533 - nrc:rustfmt-submod, r=alexcrichton

Add Rustfmt

r? @alexcrichton

6 years agoRollup merge of #44509 - tamird:remove-rustbuild-feature, r=nikomatsakis
Tim Neumann [Sun, 17 Sep 2017 11:19:03 +0000 (13:19 +0200)]
Rollup merge of #44509 - tamird:remove-rustbuild-feature, r=nikomatsakis

Update compiler-builtins

~~I can't tell if this was ever used, but it's not used today.~~

See commits.

6 years agoRollup merge of #44397 - GuillaumeGomez:codeblock-color, r=QuietMisdreavus
Tim Neumann [Sun, 17 Sep 2017 11:19:02 +0000 (13:19 +0200)]
Rollup merge of #44397 - GuillaumeGomez:codeblock-color, r=QuietMisdreavus

Codeblock color

<img width="1440" alt="screen shot 2017-09-07 at 21 53 58" src="https://user-images.githubusercontent.com/3050060/30183045-4319108e-9419-11e7-98da-da54952cab37.png">

This screenshot has been generated from:

```rust
/// foo
///
/// ```compile_fail
/// foo();
/// ```
///
/// ```ignore
/// goo();
/// ```
///
/// ```
/// let x = 0;
/// ```
pub fn bar() -> usize { 2 }
```

r? @QuietMisdreavus
cc @rust-lang/docs

6 years agoRollup merge of #44381 - jessicah:haiku-ci, r=alexcrichton
Tim Neumann [Sun, 17 Sep 2017 11:19:01 +0000 (13:19 +0200)]
Rollup merge of #44381 - jessicah:haiku-ci, r=alexcrichton

ci: introduce haiku x86_64 builder

6 years agoRollup merge of #44088 - bjorn3:better_trace_macros, r=jseyfried
Tim Neumann [Sun, 17 Sep 2017 11:19:00 +0000 (13:19 +0200)]
Rollup merge of #44088 - bjorn3:better_trace_macros, r=jseyfried

Fix "new trace_macros doesn't work if there's an error during expansion"

Fixes #43493

6 years agoRollup merge of #44073 - murarth:rc-into-raw-unsized, r=alexcrichton
Tim Neumann [Sun, 17 Sep 2017 11:18:59 +0000 (13:18 +0200)]
Rollup merge of #44073 - murarth:rc-into-raw-unsized, r=alexcrichton

Implement `Arc`/`Rc` raw pointer conversions for `?Sized`

* Add `T: ?Sized` bound to {`Arc`,`Rc`}::{`from_raw`,`into_raw`}

6 years agoAuto merge of #44641 - alexcrichton:disable-more-osx-assertions, r=Mark-Simulacrum
bors [Sun, 17 Sep 2017 05:19:00 +0000 (05:19 +0000)]
Auto merge of #44641 - alexcrichton:disable-more-osx-assertions, r=Mark-Simulacrum

ci: Disable rustc debug assertions on OSX

This commit disables debug assertions for OSX in an effort to improve cycle time
on OSX. It looks like #44610 didn't shave off quite as much time as desired so
let's see how much this helps.

6 years agoEnsure tcp test case passes when disconnected from network
Trevor Merrifield [Sun, 17 Sep 2017 03:36:11 +0000 (23:36 -0400)]
Ensure tcp test case passes when disconnected from network

net::tcp::tests::connect_timeout_unroutable fails when the network
is unreachable, like on a laptop disconnected from wifi. Check for
this error and allow the test to pass.

Closes #44645

6 years agoAuto merge of #44634 - alexcrichton:rollup, r=alexcrichton
bors [Sun, 17 Sep 2017 01:51:55 +0000 (01:51 +0000)]
Auto merge of #44634 - alexcrichton:rollup, r=alexcrichton

Rollup of 19 pull requests

- Successful merges: #44273, #44356, #44395, #44531, #44537, #44542, #44560, #44567, #44574, #44577, #44586, #44589, #44590, #44593, #44598, #44606, #44609, #44616, #44631
- Failed merges:

6 years agoci: Disable rustc debug assertions on OSX
Alex Crichton [Sun, 17 Sep 2017 00:25:12 +0000 (17:25 -0700)]
ci: Disable rustc debug assertions on OSX

This commit disables debug assertions for OSX in an effort to improve cycle time
on OSX. It looks like #44610 didn't shave off quite as much time as desired so
let's see how much this helps.

6 years agoRollup merge of #44631 - kennytm:travis-conditional-jobs, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:17:04 +0000 (09:17 -0500)]
Rollup merge of #44631 - kennytm:travis-conditional-jobs, r=alexcrichton

Make use of Travis's conditional jobs.

Conditional jobs: https://docs.travis-ci.com/user/conditional-builds-stages-jobs/#Conditional-Jobs.

Jobs not matching the condition will not be scheduled at all. This allows us to get rid of `$ALLOW_PR`/`$ALLOW_TRY`/`$SKIP_BUILD` in `.travis.yml`, and perfectly prevent spurious PR failures due to flaky macOS machines.

6 years agoRollup merge of #44616 - alexcrichton:rustdoc-fix-again-whee, r=Mark-Simulacrum
Alex Crichton [Sat, 16 Sep 2017 14:17:03 +0000 (09:17 -0500)]
Rollup merge of #44616 - alexcrichton:rustdoc-fix-again-whee, r=Mark-Simulacrum

rustbuild: Fix test "test rustdoc" invocation

Previously it would use the librustc output directory which would cause rustdoc
to get entirely recompiled, whereas the intention is that it uses the
already-compiled artifacts from building rustdoc itself, using the tool output
directory

6 years agoRollup merge of #44609 - jonhoo:hash-alloc, r=steveklabnik
Alex Crichton [Sat, 16 Sep 2017 14:17:02 +0000 (09:17 -0500)]
Rollup merge of #44609 - jonhoo:hash-alloc, r=steveklabnik

Mention that HashMap::new and HashSet::new do not allocate

The docs for `HashMap::with_capacity` and `HashSet::with_capacity` already say that
> If `capacity` is 0, the hash map/set will not allocate.
However, the docs for `::new` do not say that the initial capacity is 0, and thus promise that a call to `::new` alone does not allocate. This PR fixes that.

6 years agoRollup merge of #44606 - alexcrichton:update-cmake, r=Mark-Simulacrum
Alex Crichton [Sat, 16 Sep 2017 14:17:01 +0000 (09:17 -0500)]
Rollup merge of #44606 - alexcrichton:update-cmake, r=Mark-Simulacrum

rustbuild: Update `cmake` dependency

Should help suppress some warnings from various repos as `cmake` in the newest
version disables warnings by default.

6 years agoRollup merge of #44598 - RalfJung:installer, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:17:00 +0000 (09:17 -0500)]
Rollup merge of #44598 - RalfJung:installer, r=alexcrichton

update rust-installer

Fixes <https://github.com/rust-lang/rust/issues/44594>

r? @alexcrichton

6 years agoRollup merge of #44593 - budziq:stabilize_ord_max_min, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:59 +0000 (09:16 -0500)]
Rollup merge of #44593 - budziq:stabilize_ord_max_min, r=alexcrichton

stabilized ord_max_min (fixes #25663)

6 years agoRollup merge of #44590 - oli-obk:allow_unused_mut_on_vars, r=eddyb
Alex Crichton [Sat, 16 Sep 2017 14:16:58 +0000 (09:16 -0500)]
Rollup merge of #44590 - oli-obk:allow_unused_mut_on_vars, r=eddyb

Get `allow(unused_mut)` to work on `let` bindings

fixes #40491

6 years agoRollup merge of #44589 - makotokato:thumb2, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:57 +0000 (09:16 -0500)]
Rollup merge of #44589 - makotokato:thumb2, r=alexcrichton

Require +thumb-mode to generate thumb2 code for Android/armv7-a

I am investigating rust's code generation into Gecko by https://bugzilla.mozilla.org/show_bug.cgi?id=1399337.

armv7-linux-androideabi target uses `+v7,+thumb2,+vfp3,+d16,-neon` as target-feature.  But `+thumb2` only doesn't generate thumb2 code.  To generate thumb2 code, it requires `+thumb-mode`.  So we should add it for armv7-linux-androideabi.

r? @alexcrichton

6 years agoRollup merge of #44586 - alexcrichton:smaller-query, r=michaelwoerister
Alex Crichton [Sat, 16 Sep 2017 14:16:56 +0000 (09:16 -0500)]
Rollup merge of #44586 - alexcrichton:smaller-query, r=michaelwoerister

rustc: Preallocate when building the dep graph

This commit alters the `query` function in the dep graph module to preallocate
memory using `with_capacity` instead of relying on automatic growth. Discovered
in #44576 it was found that for the syntex_syntax clean incremental benchmark
the peak memory usage was found when the dep graph was being saved, particularly
the `DepGraphQuery` data structure itself. PRs like #44142 which add more
queries end up just making this much larger!

I didn't see an immediately obvious way to reduce the size of the
`DepGraphQuery` object, but it turns out that `with_capacity` helps quite a bit!
Locally 831 MB was used [before] this commit, and 770 MB is in use at the peak
of the compiler [after] this commit. That's a nice 7.5% improvement! This won't
quite make up for the losses in #44142 but I figured it's a good start.

[before]: https://gist.github.com/alexcrichton/2d2b9c7a65503761925c5a0bcfeb0d1e
[before]: https://gist.github.com/alexcrichton/6da51f2a6184bfb81694cc44f06deb5b

6 years agoRollup merge of #44577 - cuviper:flat_map-fold, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:55 +0000 (09:16 -0500)]
Rollup merge of #44577 - cuviper:flat_map-fold, r=alexcrichton

Customize `<FlatMap as Iterator>::fold`

`FlatMap` can use internal iteration for its `fold`, which shows a
performance advantage in the new benchmarks:

    test iter::bench_flat_map_chain_ref_sum ... bench:   4,354,111 ns/iter (+/- 108,871)
    test iter::bench_flat_map_chain_sum     ... bench:     468,167 ns/iter (+/- 2,274)
    test iter::bench_flat_map_ref_sum       ... bench:     449,616 ns/iter (+/- 6,257)
    test iter::bench_flat_map_sum           ... bench:     348,010 ns/iter (+/- 1,227)

... where the "ref" benches are using `by_ref()` that isn't optimized.
So this change shows a decent advantage on its own, but much more when
combined with a `chain` iterator that also optimizes `fold`.

6 years agoRollup merge of #44574 - alexcrichton:new-sccache-region, r=aidanhs
Alex Crichton [Sat, 16 Sep 2017 14:16:54 +0000 (09:16 -0500)]
Rollup merge of #44574 - alexcrichton:new-sccache-region, r=aidanhs

travis: Move sccache to the us-west-1 region

Most of the other rust-lang buckets are in us-west-1 and I think the original
bucket was just accidentally created in the us-east-1 region. Let's consolidate
by moving it to the same location as the rest of our buckets.

6 years agoRollup merge of #44560 - qmx:import-TyCtxt, r=eddyb
Alex Crichton [Sat, 16 Sep 2017 14:16:52 +0000 (09:16 -0500)]
Rollup merge of #44560 - qmx:import-TyCtxt, r=eddyb

bring TyCtxt into scope

got comments both from @eddyb and @nikomatsakis (via https://github.com/rust-lang/rust/pull/44505) that we should always put `TyCtxt` in scope

should I just go and import it at other places in the codebase or we just keep doing small improvements?

6 years agoRollup merge of #44542 - alexcrichton:fix-windows-emscripten, r=nikomatsakis
Alex Crichton [Sat, 16 Sep 2017 14:16:51 +0000 (09:16 -0500)]
Rollup merge of #44542 - alexcrichton:fix-windows-emscripten, r=nikomatsakis

rustc: Spawn `cmd /c emcc.bat` explicitly

In #42436 the behavior for spawning processes on Windows was tweaked slightly to
fix various bugs, but this caused #42791 as a regression, namely that to spawn
batch scripts they need to be manually spawned with `cmd /c` instead now. This
updates the compiler to handle this case explicitly for Emscripten.

Closes #42791

6 years agoRollup merge of #44531 - QuietMisdreavus:bump-gcc, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:49 +0000 (09:16 -0500)]
Rollup merge of #44531 - QuietMisdreavus:bump-gcc, r=alexcrichton

bump gcc for bootstrap

On Windows, the gcc crate would send /Wall to msvc, which would cause
builds to get flooded with warnings, exploding compile times from one
hour to more than 72! The gcc crate version 0.3.54 changes this behavior
to send /W4 instead, which greatly cuts down on cl.exe flooding the
command prompt window with warnings.

6 years agoRollup merge of #44395 - jcdyer:ip-constructors, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:48 +0000 (09:16 -0500)]
Rollup merge of #44395 - jcdyer:ip-constructors, r=alexcrichton

Ipv4Addr and Ipv6Addr convenience constructors.

Introduce convenience constructors for common types.

This introduces the following constructors:

* Ipv6Addr::localhost()
* Ipv6Addr::unspecified()
* Ipv4Addr::localhost()
* Ipv4Addr::unspecified()

The recently added `From` implementations were nice for avoiding the fallibility of conversions from strings like `"127.0.0.1".parse().unwrap()`, and `"::1".parse().unwrap()`, but while the Ipv4 version is roughly comparable in verbosity, the Ipv6 version lacks zero-segment elision, which makes it significantly more awkward: `[0, 0, 0, 0, 0, 0, 0, 0].into()`.  While there isn't a clear way to introduce zero elision to type that can infallibly be converted into Ipv6 addresses, this PR resolves the problem for the two most commonly used addresses, which, incidentally, are the ones that suffer the most from the lack of zero-segment elision.

This change is dead simple, and introduces no backwards incompatibility.

See also, [this topic on the inernals board](https://internals.rust-lang.org/t/pre-rfc-convenience-ip-address-constructors/5878)

6 years agoRollup merge of #44356 - nrc:rls-component-manifest, r=@alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:47 +0000 (09:16 -0500)]
Rollup merge of #44356 - nrc:rls-component-manifest, r=@alexcrichton

Attempt to fix the component manifest problem for rls-preview

cc #44270

See #44270

6 years agoRollup merge of #44273 - bluss:rc-downcast, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:46 +0000 (09:16 -0500)]
Rollup merge of #44273 - bluss:rc-downcast, r=alexcrichton

Implement <Rc<Any>>::downcast

* Implement `<Rc<Any>>::downcast::<T>`
  * New unstable method. Works just like Box\<Any\>, but for Rc.
  * Any has two cases for its methods: Any and Any + Send; Rc is never Send, so that case is skipped for Rc.
  * Motivation for being a method with self is to match Box and there is no user-supplied type; the inner type is Any and downcast does not conflict with any method of Any.
* Arc was skipped because Any itself has no downcast for the case that makes most sense: Any + Send + Sync

6 years agoImplement `Arc`/`Rc` raw pointer conversions for `?Sized`
Murarth [Thu, 24 Aug 2017 05:50:00 +0000 (22:50 -0700)]
Implement `Arc`/`Rc` raw pointer conversions for `?Sized`

* Add `T: ?Sized` bound to {`Arc`,`Rc`}::{`from_raw`,`into_raw`}

6 years agoAuto merge of #43989 - circuitfox:sliceext-binary-search-sig, r=alexcrichton
bors [Sat, 16 Sep 2017 22:20:55 +0000 (22:20 +0000)]
Auto merge of #43989 - circuitfox:sliceext-binary-search-sig, r=alexcrichton

Remove Borrow bound from SliceExt::binary_search

#37761 added a Borrow bound to `binary_search` and `binary_search_by_key` in `core::SliceExt`, but did not add it to the methods in `std::slice`. #41590 attempted to add this bound to `std::slice` but was not merged due to breakage. This PR removes the bound in `core::SliceExt`, so that these methods will have the same signature in `core` and `std`.

Fixes #41561

6 years agostabilized needs_drop (fixes #41890)
Michal Budzynski [Sat, 16 Sep 2017 21:41:04 +0000 (23:41 +0200)]
stabilized needs_drop (fixes #41890)

6 years agostabilized iterator_for_each (closes #42986)
Michal Budzynski [Fri, 15 Sep 2017 15:06:49 +0000 (17:06 +0200)]
stabilized iterator_for_each (closes #42986)

updated clippy and rls as it uses the iterator_for_each

6 years agoAdded more text from unstable-book to `compiler_fence` docs
Michal Budzynski [Sat, 16 Sep 2017 20:16:49 +0000 (22:16 +0200)]
Added more text from unstable-book to `compiler_fence` docs

6 years agoAdded example to `compiler_fence` docs taken from unstable-book
Michal Budzynski [Fri, 15 Sep 2017 15:03:09 +0000 (17:03 +0200)]
Added example to `compiler_fence` docs taken from unstable-book

6 years agostabilized compiler_fences (fixes #41091)
Michal Budzynski [Fri, 15 Sep 2017 12:51:44 +0000 (14:51 +0200)]
stabilized compiler_fences (fixes #41091)

6 years agoAuto merge of #43964 - Gankro:unsafe-reform, r=sfackler
bors [Sat, 16 Sep 2017 19:54:58 +0000 (19:54 +0000)]
Auto merge of #43964 - Gankro:unsafe-reform, r=sfackler

implement unsafe pointer methods

I also cleaned up some existing documentation a bit here or there since I was doing so much auditing of it. Most notably I significantly rewrote the `offset` docs to clarify safety (`*const` and `*mut`'s offset docs had actually diverged).

6 years agoAuto merge of #43017 - durka:stabilize-const-invocation, r=eddyb
bors [Sat, 16 Sep 2017 17:02:17 +0000 (17:02 +0000)]
Auto merge of #43017 - durka:stabilize-const-invocation, r=eddyb

Individualize feature gates for const fn invocation

This PR changes the meaning of `#![feature(const_fn)]` so it is only required to declare a const fn but not to call one. Based on discussion at #24111. I was hoping we could have an FCP here in order to move that conversation forward.

This sets the stage for future stabilization of the constness of several functions in the standard library (listed below), so could someone please tag the lang team for review.

- `std::cell`
    - `Cell::new`
    - `RefCell::new`
    - `UnsafeCell::new`
- `std::mem`
    - `size_of`
    - `align_of`
- `std::ptr`
    - `null`
    - `null_mut`
- `std::sync`
    - `atomic`
        - `Atomic{Bool,Ptr,Isize,Usize}::new`
    - `once`
        - `Once::new`
- primitives
    - `{integer}::min_value`
    - `{integer}::max_value`

Some other functions are const but they are also unstable or hidden, e.g. `Unique::new` so they don't have to be considered at this time.

After this stabilization, the following `*_INIT` constants in the standard library can be deprecated. I wasn't sure whether to include those deprecations in the current PR.

- `std::sync`
    - `atomic`
        - `ATOMIC_{BOOL,ISIZE,USIZE}_INIT`
    - `once`
        - `ONCE_INIT`

6 years agobump rls
Alex Burka [Wed, 13 Sep 2017 04:18:51 +0000 (04:18 +0000)]
bump rls

6 years agochange #![feature(const_fn)] to specific gates
Alex Burka [Fri, 8 Sep 2017 18:26:54 +0000 (18:26 +0000)]
change #![feature(const_fn)] to specific gates

6 years agoci: Upload/download from a new S3 bucket
Alex Crichton [Fri, 15 Sep 2017 23:04:13 +0000 (16:04 -0700)]
ci: Upload/download from a new S3 bucket

Moving buckets from us-east-1 to us-west-1 because us-west-1 is where
rust-central-station itself runs and in general is where we have all our other
buckets.

6 years agoMake use of Travis's conditional jobs.
kennytm [Sat, 16 Sep 2017 11:28:08 +0000 (19:28 +0800)]
Make use of Travis's conditional jobs.

6 years agofix test name being printed twice for ui tests
Ralf Jung [Sat, 16 Sep 2017 11:06:50 +0000 (13:06 +0200)]
fix test name being printed twice for ui tests

6 years agocompiletest: print the correct basename of the src dir
Ralf Jung [Sat, 16 Sep 2017 11:02:31 +0000 (13:02 +0200)]
compiletest: print the correct basename of the src dir

6 years agoAuto merge of #44605 - alexcrichton:less-rustdoc, r=Mark-Simulacrum
bors [Sat, 16 Sep 2017 09:26:45 +0000 (09:26 +0000)]
Auto merge of #44605 - alexcrichton:less-rustdoc, r=Mark-Simulacrum

rustbuild: Compile the error-index in stage 2

Right now we comiple rustdoc in stage 2 and the error index in stage 0, which
ends up compiling rustdoc twice! To avoid compiling rustdoc twice (which takes
awhile) let's just compile it once in stage 2.

6 years agoci: haiku: wrap lines as necessary for tidy.
Jessica Hamilton [Sat, 16 Sep 2017 06:00:40 +0000 (01:00 -0500)]
ci: haiku: wrap lines as necessary for tidy.

6 years agoAuto merge of #44610 - alexcrichton:osx-no-assertions, r=Mark-Simulacrum
bors [Sat, 16 Sep 2017 04:04:24 +0000 (04:04 +0000)]
Auto merge of #44610 - alexcrichton:osx-no-assertions, r=Mark-Simulacrum

travis: Disable LLVM assertions on OSX

Our OSX builders are routinely and significantly over hour 2 hour "soft limit"
for testing PRs. I *think* that a big portion of this time comes from the fact
that LLVM and debug assertions are enabled. In an effort to speed up these
builders and reduce cycle time this commit disables LLVM assertions on OSX for
all builders.

My thinking is that we'll let this bake for a bit after merged to see what the
effect is on timing on Travis. If it doesn't actually help much we can turn them
back on, and if it doesn't help enough we can disable Rust debug assertions as
well.

6 years agoci: haiku: rename llvm-config to address tidy issues.
Jessica Hamilton [Sat, 16 Sep 2017 02:51:50 +0000 (21:51 -0500)]
ci: haiku: rename llvm-config to address tidy issues.

6 years agoFix incorrect `into_inner` link in docs.
Corey Farwell [Sat, 16 Sep 2017 01:52:40 +0000 (21:52 -0400)]
Fix incorrect `into_inner` link in docs.

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

6 years agoci: move dist-x86_64-haiku into disabled.
Jessica Hamilton [Sat, 16 Sep 2017 00:04:24 +0000 (19:04 -0500)]
ci: move dist-x86_64-haiku into disabled.

6 years agorustbuild: Fix test "test rustdoc" invocation
Alex Crichton [Fri, 15 Sep 2017 22:28:59 +0000 (15:28 -0700)]
rustbuild: Fix test "test rustdoc" invocation

Previously it would use the librustc output directory which would cause rustdoc
to get entirely recompiled, whereas the intention is that it uses the
already-compiled artifacts from building rustdoc itself, using the tool output
directory

6 years agotravis: Disable LLVM assertions on OSX
Alex Crichton [Fri, 15 Sep 2017 17:34:05 +0000 (10:34 -0700)]
travis: Disable LLVM assertions on OSX

Our OSX builders are routinely and significantly over hour 2 hour "soft limit"
for testing PRs. I *think* that a big portion of this time comes from the fact
that LLVM and debug assertions are enabled. In an effort to speed up these
builders and reduce cycle time this commit disables LLVM assertions on OSX for
all builders.

My thinking is that we'll let this bake for a bit after merged to see what the
effect is on timing on Travis. If it doesn't actually help much we can turn them
back on, and if it doesn't help enough we can disable Rust debug assertions as
well.

6 years agoHashMap::new and HashSet::new do not allocate
Jon Gjengset [Fri, 15 Sep 2017 17:32:45 +0000 (13:32 -0400)]
HashMap::new and HashSet::new do not allocate

6 years agoAdd a specific test for `FlatMap::fold`
Josh Stone [Fri, 15 Sep 2017 17:30:56 +0000 (10:30 -0700)]
Add a specific test for `FlatMap::fold`

6 years agoalloc: Add tracking issue for rc_downcast
Ulrik Sverdrup [Fri, 15 Sep 2017 17:16:22 +0000 (19:16 +0200)]
alloc: Add tracking issue for rc_downcast

6 years agorustbuild: Update `cmake` dependency
Alex Crichton [Fri, 15 Sep 2017 16:37:52 +0000 (09:37 -0700)]
rustbuild: Update `cmake` dependency

Should help suppress some warnings from various repos as `cmake` in the newest
version disables warnings by default.

6 years agorustbuild: Compile the error-index in stage 2
Alex Crichton [Fri, 15 Sep 2017 16:34:17 +0000 (09:34 -0700)]
rustbuild: Compile the error-index in stage 2

Right now we comiple rustdoc in stage 2 and the error index in stage 0, which
ends up compiling rustdoc twice! To avoid compiling rustdoc twice (which takes
awhile) let's just compile it once in stage 2.

6 years agoupdate rust-installer
Ralf Jung [Fri, 15 Sep 2017 14:29:21 +0000 (16:29 +0200)]
update rust-installer

6 years agoUpdate cargo submodule
Alex Crichton [Fri, 15 Sep 2017 14:18:21 +0000 (07:18 -0700)]
Update cargo submodule

Just a routine update