Commit Graph

55629 Commits

Author SHA1 Message Date
Matthew Piziak
bfca761c8c fix small typos in std::convert documentation
Fix subject-verb agreement in copypasta: "`AsRef` dereference" to
"`AsRef` dereferences".

Formalize "eg" to "e.g." Italicization of common Latin abbreviations
seems to be going out of style in written English, so I left it plain.
2016-08-12 12:20:56 -04:00
bors
11f8805887 Auto merge of #34193 - petrochenkov:privalias, r=nikomatsakis
privacy: Substitute type aliases in private-in-public checker

Closes https://github.com/rust-lang/rust/issues/30503
Closes https://github.com/rust-lang/rust/issues/34293

Everyone in the issue discussion seemed to be in favor, @huonw also spoke about this [here](https://www.reddit.com/r/rust/comments/3xldr9/surfaces_and_signatures_component_privacy_versus/cy615wq), but the issue haven't got any movement.
I think it's reasonable to do this before turning `private_in_public` warnings into errors.

r? @nikomatsakis
2016-08-11 10:09:10 -07:00
bors
42001edc99 Auto merge of #35403 - scottcarr:lvalue_refactor, r=nikomatsakis
refactor lvalue_ty to be method of lvalue

Currently `Mir` (and `MirContext`) implement a method `lvalue_ty` (and actually many more `foo_ty`).  But this should be a method of `Lvalue`.

If you have an `lvalue` and you want to get its type, the natural thing to write is:

```
lvalue.ty()
```

Of course it needs context, but still:

```
lvalue.ty(mir, tcx)
```

Makes more sense than

```
mir.lvalue_ty(lvalue, tcx)
```

I actually think we should go a step farther and have traits so we could get the type of some value generically, but that's up for debate.  The thing I'm running into a lot in the compiler is I have a value of type `Foo` and I know that there is some related type `Bar` which I can get through some combination of method calls, but it's often not as direct as I would imagine.  Unless you already know the code, its not clear why you would look in `Mir` for a method to get the type of an `Lvalue`.
2016-08-11 05:04:41 -07:00
bors
695b3d8279 Auto merge of #34866 - cynicaldevil:panic-counter, r=alexcrichton
Refactored code to access TLS only in case of panic (II)

Fixes #34787
r? @alexcrichton
Do it **very** carefully this time!
2016-08-11 01:58:48 -07:00
bors
1222f5d52b Auto merge of #34845 - bitshifter:issue-30961, r=alexcrichton
Add help for target CPUs, features, relocation and code models.

Fix for https://github.com/rust-lang/rust/issues/30961. Requires PR https://github.com/rust-lang/llvm/pull/45 to be accepted first, and the .gitmodules for llvm to be updated before this can be merged.
2016-08-10 21:42:48 -07:00
Vadim Petrochenkov
5d4ae4ba5a Add test for recursive private alias substitution in rustdoc 2016-08-11 00:41:58 +03:00
petrochenkov
d43b9cb487 privacy: Move private-in-public diagnostics for type aliases to the public interface location 2016-08-11 00:32:07 +03:00
petrochenkov
08f0f7c54a Substitute private type aliases in rustdoc 2016-08-11 00:32:07 +03:00
Vadim Petrochenkov
b7db9e88bf privacy: Substitute type aliases in private-in-public checker 2016-08-11 00:32:07 +03:00
bors
0ef24eed2f Auto merge of #35489 - sanxiyn:target-list, r=alexcrichton
Print Rust target name, not LLVM target name, for `--print target-list`

Rust target name and LLVM target name are usually the same, but not always. For example, `arm-unknown-linux-musleabi` Rust target uses `arm-unknown-linux-gnueabi` LLVM target.

Fix #35481.
2016-08-10 13:13:50 -07:00
bors
1f2ae3849c Auto merge of #35525 - jonathandturner:rollup, r=jonathandturner
Rollup of 15 pull requests

- Successful merges: #35371, #35396, #35446, #35449, #35452, #35458, #35465, #35466, #35470, #35475, #35477, #35484, #35504, #35507, #35524
- Failed merges: #35395, #35415
2016-08-10 10:03:08 -07:00
Scott A Carr
f37bf6d367 no op commit for travis 2016-08-10 09:42:33 -07:00
Nikhil Shagrithaya
ea2216cba8 Added an update_panic_count function to handle access to PANIC_COUNT 2016-08-10 22:04:41 +05:30
Nikhil Shagrithaya
00b1e88680 Added a shim around rust_panic to update panic counter 2016-08-10 22:04:41 +05:30
Nikhil Shagrithaya
221000abbe Refactored code to access TLS only in case of panic 2016-08-10 22:04:41 +05:30
Cameron Hart
05045da9fd Improved checking of target's llvm_config
Point llvm @bitshifter branch until PR accepted

Use today's date for LLVM auto clean trigger

Update LLVM submodule to point at rust-lang fork.

Handle case when target is set
2016-08-10 22:24:51 +10:00
bors
ae77410350 Auto merge of #35405 - futile:tests_warn_timeout, r=brson
Add warning timeout for tests that run >1min

This makes it easier to identify hanging tests. As described in #2873,
when a test doesn't finish, we so far had no information on which test
that was. In this PR, we add a duration of 60 seconds for each test,
after which a warning will be printed mentioning that this specific test
has been running for a long time already.

Example output:
https://gist.github.com/futile/6ea3eed85fe632df8633c1b03c08b012

r? @brson
2016-08-10 03:00:56 -07:00
bors
561c4e1dd3 Auto merge of #35079 - nikomatsakis:incr-comp-ich-32753, r=mw
Various improvements to the SVH

This fixes a few points for the SVH:

- incorporate resolve results into the SVH;
- don't include nested items.

r? @michaelwoerister

cc #32753 (not fully fixed I don't think)
2016-08-09 21:00:21 -07:00
Niko Matsakis
83068ebafd pacify the merciless tidy 2016-08-09 20:28:46 -04:00
Niko Matsakis
c7f15aa178 incorporate resolve results into hashing
We now incorporate the `def_map` and `trait_map`
results into the SVH.
2016-08-09 20:28:46 -04:00
Niko Matsakis
953d711cc7 promote svh calculation into its own directory 2016-08-09 20:28:46 -04:00
Niko Matsakis
ae9c049cfc remove field that need not be public 2016-08-09 20:28:46 -04:00
Niko Matsakis
5001c92c3e stop hashing nested items, and add a test 2016-08-09 20:28:45 -04:00
Niko Matsakis
775bd93d72 make it possible to test if HIR is dirty
This requires passing in the dirty-node set explicitly since HIR nodes
wind up added to the graph either way.
2016-08-09 20:28:45 -04:00
bors
576f766594 Auto merge of #35401 - jonathandturner:enable_json_and_new_errors, r=jonathandturner
Turn on new errors and json mode

This PR is a big-switch, but on a well-worn path:

* Turns on new errors by default (and removes old skool)
* Moves json output from behind a flag

The RFC for new errors [landed](https://github.com/rust-lang/rfcs/pull/1644) and as part of that we wanted some bake time.  It's now had a few weeks + all the time leading up to the RFC of people banging on it.  We've also had [editors updating to the new format](https://github.com/saviorisdead/RustyCode/pull/159) and expect more to follow.

We also have an [issue on old skool](https://github.com/rust-lang/rust/issues/35330) that needs to be fixed as more errors are switched to the new style, but it seems silly to fix old skool errors when we fully intend to throw the switch in the near future.

This makes it lean towards "why not just throw the switch now, rather than waiting a couple more weeks?"  I only know of vim that wanted to try to parse the new format but were not sure how, and I think we can reach out to them and work out something in the 8 weeks before this would appear in a stable release.

We've [hashed out](https://github.com/rust-lang/rust/issues/35330) stabilizing JSON output, and it seems like people are relatively happy making what we have v1 and then likely adding to it in the future.  The idea is that we'd maintain backward compatibility and just add new fields as needed.  We'll also work on a separate output format that'd be better suited for interactive tools like IDES (since JSON message can get a little long depending on the error).

This PR stabilizes JSON mode, allowing its use without `-Z unstable-options`

Combined, this gives editors two ways to support errors going forward: parsing the new error format or using the JSON mode.  By moving JSON to stable, we can also add support to Cargo, which plugin authors tell us does help simplify their support story.

r? @nikomatsakis
cc @rust-lang/tools

Closes https://github.com/rust-lang/rust/issues/34826
2016-08-09 14:04:54 -07:00
Jonathan Turner
9b510ba39a Update cargo SHA to latest cargo 2016-08-09 10:14:08 -07:00
bors
e1d2bc2916 Auto merge of #35166 - nikomatsakis:incr-comp-ice-34991-2, r=mw
Address ICEs running w/ incremental compilation and building glium

Fixes for various ICEs I encountered trying to build glium with incremental compilation enabled. Building glium now works. Of the 4 ICEs, I have test cases for 3 of them -- I didn't isolate a test for the last commit and kind of want to go do other things -- most notably, figuring out why incremental isn't saving much *effort*.

But if it seems worthwhile and I can come back and try to narrow down the problem.

r? @michaelwoerister

Fixes #34991
Fixes #32015
2016-08-09 10:00:54 -07:00
Niko Matsakis
e0b82d5c3a fix license 2016-08-09 12:43:59 -04:00
Scott A Carr
969b2b86ad make tidy 2016-08-09 08:17:50 -07:00
Jonathan Turner
fb1c6acc81 Update E0087.rs 2016-08-09 07:53:52 -07:00
Niko Matsakis
76eecc733c pacify the mercilous tidy 2016-08-09 10:25:36 -04:00
bors
f0139140f6 Auto merge of #35426 - frewsxcv:os-sys-env-args-phantoms, r=alexcrichton
Utilize `PhantomData` to enforce `!Sync` and `!Send` field.

None
2016-08-09 05:26:50 -07:00
Niko Matsakis
ecbcf1b1b5 address comments from mw 2016-08-09 08:26:07 -04:00
Niko Matsakis
02a47032dd use preds to serialize just what we need
This massively speeds up serialization. It also
seems to produce deterministic metadata hashes
(before I was seeing inconsistent results).

Fixes #35232.
2016-08-09 08:26:06 -04:00
Niko Matsakis
9978cbc8f4 generalize BitMatrix to be NxM and not just NxN 2016-08-09 08:26:06 -04:00
Niko Matsakis
8150494ac2 add a deterministic_hash method to DefPath
Produces a deterministic hash, at least for a single platform /
compiler-version.
2016-08-09 08:26:06 -04:00
Niko Matsakis
d4bd0544ca add a -Z incremental-info flag 2016-08-09 08:26:06 -04:00
Niko Matsakis
571010bb52 replace Name with InternedString in DefPathData
Fixes #35292.
2016-08-09 08:26:06 -04:00
Niko Matsakis
a92b1a7981 make DepNode PartialOrd 2016-08-09 08:26:06 -04:00
Niko Matsakis
0e97240f98 isolate predecessor computation
The new `Predecessors` type computes a set of interesting targets and
their HIR predecessors, and discards everything in between.
2016-08-09 08:26:05 -04:00
bors
c2b03f8ba9 Auto merge of #35425 - apasel422:refcell, r=alexcrichton
Implement `RefCell::{try_borrow, try_borrow_mut}`

CC #35070

r? @alexcrichton
2016-08-09 02:11:50 -07:00
bors
58c5716e2d Auto merge of #34762 - creativcoder:slice-ext, r=alexcrichton
extend lifetime on binary_search_by_key of SliceExt trait

Fixes #34683.
2016-08-08 21:51:01 -07:00
Andrew Paseltiner
a20a1db54a
Implement RefCell::{try_borrow, try_borrow_mut} 2016-08-08 23:59:56 -04:00
Niko Matsakis
82b6dc20d8 fixup tests for new def'n of InlinedItem
it now carries a def-id; supply a dummy
2016-08-08 21:35:07 -04:00
Niko Matsakis
8fdc72f830 track MIR through the dep-graph
Per the discussion on #34765, we make one `DepNode::Mir` variant and use
it to represent both the MIR tracking map as well as passes that operate
on MIR. We also track loads of cached MIR (which naturally comes from
metadata).

Note that the "HAIR" pass adds a read of TypeckItemBody because it uses
a myriad of tables that are not individually tracked.
2016-08-08 18:44:24 -04:00
Niko Matsakis
88b2e9a66d rename KrateInfo to CrateInfo 2016-08-08 18:41:58 -04:00
bors
080e0e072f Auto merge of #35064 - pthariensflame:feature/cow_str_from_iter, r=alexcrichton
Add `FromIterator` implementations for `Cow<str>`

This seems like an oversight, since the corresponding implementation for `Cow<[T]> where T: Clone` exists.
2016-08-08 14:59:30 -07:00
Scott A Carr
9f8093856d refactor other type methods 2016-08-08 13:35:10 -07:00
Jonathan Turner
f835b38385 Rollup merge of #35524 - garekkream:update-E0162-new-error-format, r=jonathandturner
Update E0162 to the new format

Part of #35233.
Fixes #35268.

r? @jonathandturner
2016-08-08 13:25:59 -07:00
Jonathan Turner
7db3f86966 Rollup merge of #35507 - hank-der-hafenarbeiter:master, r=jonathandturner
Updated Error mesage to new format for E0221

Part of #35386
r? @jonathandturner
2016-08-08 13:25:59 -07:00