Commit Graph

63794 Commits

Author SHA1 Message Date
Tommy Ip
05329e5780 Remove use of Self: Sized from libsyntax
The bound is not required for compiling but it prevents using `next_token()` from a trait object.

Fixes #33506.
2017-05-04 13:19:36 +01:00
bors
b16c7a235f Auto merge of #41735 - frewsxcv:rollup, r=frewsxcv
Rollup of 6 pull requests

- Successful merges: #41543, #41600, #41715, #41720, #41721, #41730
- Failed merges:
2017-05-03 23:05:07 +00:00
Corey Farwell
e20b282330 Rollup merge of #41730 - bholley:arc_comment, r=aturon
Document the reasoning for the Acquire/Release handshake when dropping Arcs.

Split out from #41714. r? @aturon
2017-05-03 18:34:04 -04:00
Corey Farwell
a7c8bd149a Rollup merge of #41721 - mgattozzi:stdin-stdout-update, r=steveklabnik
Update ChildStdin/ChildStdout docs to be clearer

This is part of https://github.com/rust-lang/rust/issues/29370 and continues the work from https://github.com/rust-lang/rust/pull/40829
2017-05-03 18:34:03 -04:00
Corey Farwell
3bfc72fba6 Rollup merge of #41720 - frewsxcv:duration-doc-examples, r=steveklabnik
Improvements to `std::time::Duration` doc examples.

Opened primarily for the last commit, in response to comments in https://github.com/rust-lang/rust/issues/39949.
2017-05-03 18:34:02 -04:00
Corey Farwell
e2cedb249f Rollup merge of #41715 - martinhath:master, r=aturon
Fix @martinhath's mailmap entry

I stumbled upon a name duplication issue in [rust-lang-nursery/thanks](https://github.com/rust-lang-nursery/thanks/), and realized that this problem is easily fixable. I've (hopefully) done the right thing here. It works locally (`git shortlog | grep "Thoresen"` only returns one entry instead of two).

I didn't bother creating an issue in the `thanks` repository, since I did the `.mailmap` editing myself.
2017-05-03 18:34:01 -04:00
Corey Farwell
10fde3393b Rollup merge of #41600 - ranma42:xz-dist, r=alexcrichton
Generate XZ-compressed tarballs

Integrate the new `rust-installer` and extend manifests with keys for xz-compressed tarballs.

One of the steps required for https://github.com/rust-lang/rust/issues/21724
2017-05-03 18:34:00 -04:00
Corey Farwell
9f06dfb451 Rollup merge of #41543 - z1mvader:master, r=steveklabnik
Rewrote the thread struct docs

https://github.com/rust-lang/rust/issues/29378
2017-05-03 18:33:59 -04:00
Andrea Canciani
98dd82c013 Retry brew commands upon failure
Wrap the installation on macOS with `travis_retry`.
2017-05-03 22:38:41 +02:00
bors
2d4ed8e0cb Auto merge of #41728 - sirideain:inference-failure-for-loops-test, r=alexcrichton
Add test for an inference failure.

Fixes #22066
2017-05-03 19:58:35 +00:00
Bobby Holley
7b05b88ce7 Document the reasoning for the Acquire/Release handshake when dropping Arcs. 2017-05-03 11:02:23 -07:00
Charlie Sheridan
3e03b1abb7 Add test for an inference failure. 2017-05-03 13:07:30 -04:00
bors
8305394b4c Auto merge of #41711 - sirideain:add-static-methods-test, r=aturon
Add test for Inherent static methods

Fixes #28848
2017-05-03 08:26:49 +00:00
Andrea Canciani
5e522d73a3 Fix MacOSX build
MacOSX does not ship `7z` nor `xz`. Let's use `xz`, just like on the
other *nix systems.
2017-05-03 08:09:37 +02:00
Andrea Canciani
5dfa08ee1b Emit information about XZ packages in manifest 2017-05-03 08:09:37 +02:00
bors
5d0865315b Auto merge of #41713 - cuviper:cmake-sanitizers, r=alexcrichton
rustbuild: Sanity-check cmake for sanitizers too

It's possible to build the sanitizers when using an external LLVM, but
we still need cmake for this.  Extend the sanity check to look for cmake
whenever sanitizers are enabled too.
2017-05-03 06:04:12 +00:00
Michael Gattozzi
28a4f57dd0
Update ChildStdin/ChildStdout docs to be clearer 2017-05-03 01:13:18 -04:00
Corey Farwell
a3e8f3622f Add doc example for how to determine total number of secs in Duration. 2017-05-03 00:04:59 -04:00
Corey Farwell
bdd8e7ffe6 Update Duration::as_secs doc example to demonstrate truncation. 2017-05-02 23:58:39 -04:00
Corey Farwell
ee8ad8eb2e Update Duration::from_millis doc example to show underlying values. 2017-05-02 23:56:29 -04:00
Corey Farwell
aa10fce346 Update Duration::from_secs doc example to show underlying values. 2017-05-02 23:55:40 -04:00
bors
146dc670cf Auto merge of #41717 - frewsxcv:rollup, r=frewsxcv
Rollup of 7 pull requests

- Successful merges: #41217, #41625, #41640, #41653, #41656, #41657, #41705
- Failed merges:
2017-05-03 03:24:35 +00:00
Corey Farwell
2b51384a2d Rollup merge of #41705 - Mark-Simulacrum:remove-grammar, r=nikomatsakis
Remove ANTLR grammar

I *think* that nothing in-tree references this, but I may be wrong. If anyone thinks of anything, please let me know and I'll work on removing.

Fixes #15677.
2017-05-02 21:21:22 -04:00
Corey Farwell
a4761639e8 Rollup merge of #41657 - malbarbo:android-armv7-linker, r=alexcrichton
Add -march=armv7-a parameter to armv7 android linker

Without this option, the linker fails to link any library that uses `std::future`. The error points some undefined references, like `std::__future_base::_Result_base`.

For example, it fails to link rustc because llvm 4.0 uses `std::future`.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64735
2017-05-02 21:21:22 -04:00
Corey Farwell
c3868322ba Rollup merge of #41656 - malbarbo:android-armeabi, r=alexcrichton
Change arm-linux-androideabi to correspond to the armeabi official ABI

Fixes #40941.
2017-05-02 21:21:21 -04:00
Corey Farwell
02274a8430 Rollup merge of #41653 - achernyak:master, r=nikomatsakis
Queries for Crate Metadata

This resolves following parts of #41417:
* `fn stability(&self, def: DefId) -> Option<attr::Stability>;`
* `fn deprecation(&self, def: DefId) -> Option<attr::Deprecation>;`

r? @nikomatsakis
2017-05-02 21:21:20 -04:00
Corey Farwell
9e621c2da8 Rollup merge of #41640 - gaurikholkar:master, r=nikomatsakis
Consider changing to & for let bindings #40402

This is a fix for #40402

For the example
```
fn main() {
    let v = vec![String::from("oh no")];

    let e = v[0];
}
```

It gives
```
error[E0507]: cannot move out of indexed content
 --> ex1.rs:4:13
  |
4 |     let e = v[0];
  |             ^^^^ cannot move out of indexed content
  |
  = help: consider changing to `&v[0]`

error: aborting due to previous error
```

Another alternative is
```
error[E0507]: cannot move out of indexed content
 --> ex1.rs:4:13
  |
4 |     let e = v[0];
  |             ^^^^ consider changing to `&v[0]`

error: aborting due to previous error
```
Also refer to #41564 for more details.

r? @nikomatsakis
2017-05-02 21:21:19 -04:00
Corey Farwell
cfff3699aa Rollup merge of #41625 - nikomatsakis:incr-comp-dep-tracking-cell-mir, r=eddyb
rework the queries for the MIR pipeline

This PR refashions the MIR pipeline. There are a number of changes:

* We no longer have "MIR passes" and the pass manager is completely reworked. Unless we are doing the interprocedural optimization (meaning, right now, the inline pass), we will process a single MIR from beginning to finish in a completely on-demand fashion; i.e., when you request `optimized_mir(D)`, that will trigger the MIR for `D` to actually be built and optimized, but no other functions are built or touched.
* We no longer use `&'tcx RefCell<Mir<'tcx>>` as the result of queries, since that spoils the view of queries as "pure functions". To avoid however copying the MIR, we use a `&'tcx Steal<Mir<'tcx>>` -- this is something like a ref-cell, in that you can use `borrow()` to read it, but it has no `borrow_mut()`. Instead, it has `steal()`, which will take the contents and then panic if any further read attempt occurs.
* We now support `[multi]` queries, which can optionally yield not just one result but a sequence of (K, V) pairs. This is used for the inlining pass. If inlining is enabled, then when it is invoked on **any** def-id D, it will go and read the results for **all** def-ids and transform them, and then return the results for all of them at once. This isn't ideal, and we'll probably want to rework this further, but it seems ok for now (note that MIR inlining is not enabled by default).

**Tips for the reviewer:** The commits here are meant to build individually, but the path is a *bit* meandering. In some cases, for example, I introduce a trait in one commit, and then tweak it in a later commit as I actually try to put it to use. You may want to read the README in the final commit to get a sense of where the overall design is headed.

@eddyb I did not wind up adding support for queries that produce more than one *kind* of result. Instead, I decided to just insert judicious use of the `force()` command. In other words, we had talked about e.g. having a query that produced not only the MIR but also the `const_qualif` result for the MIR in one sweep. I realized you can also have the same effect by having a kind of meta-query that forces the const-qualif pass and then reads the result. See the README for a description. (We can still do these "multi-query results" later if we want, I'm not sure though if it is necessary.)

r? @eddyb

cc @michaelwoerister @matthewhammer @arielb1, who participated in the IRC discussion.
2017-05-02 21:21:18 -04:00
Corey Farwell
1a5284c32b Rollup merge of #41217 - topecongiro:docs/atomic-fence, r=steveklabnik
Update docs of 'fence'

This PR updates the docs for `std::sync::atomic::fence` with an example and a diagram.
Part of #29377.
r? @steveklabnik
2017-05-02 21:21:17 -04:00
bors
0634f0a30f Auto merge of #41624 - RalfJung:mutexguard-sync, r=alexcrichton
MutexGuard<T> may be Sync only if T is Sync

Fixes #41622

This is a breaking change. Does that imply any further process?

I am not sure whether I wrote that "compilation must fail"-test correctly, but at least it is passing here with the patch applied. Same for the `since = "1.18.0"`, I just picked it because I had to pick something.
2017-05-03 00:18:26 +00:00
bors
4d81b14b80 Auto merge of #41605 - tschottdorf:param-env, r=nikomatsakis
Store interned predicates in ParameterEnvironment

See #41444. As a first step towards untangling `ParameterEnvironment`, change
its `caller_bounds` field from a `Vec` into an interned slice of
`ty::Predicate`s.

This change is intentionally well-contained and doesn't pull on any of the
loose ends. In particular, you'll note that `normalize_param_env_or_error`
now interns twice.
2017-05-02 20:44:03 +00:00
Niko Matsakis
488b2a3e7b add FIXME to Steal 2017-05-02 16:21:58 -04:00
Niko Matsakis
25be7983e8 remove mir_passes from Session and add a FIXME 2017-05-02 16:21:58 -04:00
Niko Matsakis
afc5acd84b fix librustc_driver 2017-05-02 16:21:58 -04:00
Niko Matsakis
e6793ac452 have borrowck fetch MIR, which will perform some errors 2017-05-02 16:21:58 -04:00
Niko Matsakis
15bc2f4ca0 remove temporary variable 2017-05-02 16:21:57 -04:00
Niko Matsakis
0afcfce8d8 update comment about heuristics 2017-05-02 16:21:57 -04:00
Niko Matsakis
b0092e89e0 move queries code into transform 2017-05-02 16:21:57 -04:00
Niko Matsakis
393fa4f1b7 rename from item_mir to optimized_mir 2017-05-02 16:21:57 -04:00
Niko Matsakis
c7023d1c2f run MIR borrowck on the validated, not optimized, MIR 2017-05-02 16:21:57 -04:00
Niko Matsakis
74b2783877 delete dead code 2017-05-02 16:21:56 -04:00
Niko Matsakis
2fa1ba3e7e pacify the mercilous tidy 2017-05-02 16:21:56 -04:00
Niko Matsakis
851a880f52 remove irrelevant comments 2017-05-02 16:21:56 -04:00
Niko Matsakis
1dd9c3e52a support inlining by asking for optimizer mir for callees
I tested this with it enabled 100% of the time, and we were able to run
mir-opt tests successfully.
2017-05-02 16:21:56 -04:00
Niko Matsakis
669d31683f simplify down to one query per pass suite 2017-05-02 16:21:55 -04:00
Niko Matsakis
9c154a67bf rip out everything but MirPass, move the logic into suites 2017-05-02 16:21:55 -04:00
Niko Matsakis
c253df5249 remove Pass and (temporarily) drop Inline 2017-05-02 16:21:55 -04:00
Niko Matsakis
69c8f9dd25 move build_mir into build directory 2017-05-02 16:21:55 -04:00
Martin Hafskjold Thoresen
b1ab145ec2
Fix up @martinhath's mailmap entry 2017-05-02 21:12:27 +02:00
Tobias Schottdorf
a6658d5ff1 Store interned predicates in ParameterEnvironment
See #41444. As a first step towards untangling `ParameterEnvironment`, change
its `caller_bounds` field from a `Vec` into an interned slice of
`ty::Predicate`s.

This change is intentionally well-contained and doesn't pull on any of the
loose ends. In particular, you'll note that `normalize_param_env_or_error`
now interns twice.
2017-05-02 14:37:00 -04:00