bors [Thu, 11 Aug 2016 12:04:41 +0000 (05:04 -0700)]
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`.
bors [Thu, 11 Aug 2016 04:42:48 +0000 (21:42 -0700)]
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.
bors [Wed, 10 Aug 2016 20:13:50 +0000 (13:13 -0700)]
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.
bors [Wed, 10 Aug 2016 10:00:56 +0000 (03:00 -0700)]
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.
bors [Tue, 9 Aug 2016 21:04:54 +0000 (14:04 -0700)]
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.
bors [Tue, 9 Aug 2016 17:00:54 +0000 (10:00 -0700)]
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.
Niko Matsakis [Mon, 8 Aug 2016 22:42:06 +0000 (18:42 -0400)]
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.
Jonathan Turner [Mon, 8 Aug 2016 20:25:57 +0000 (13:25 -0700)]
Rollup merge of #35465 - cardoe:pattern-book-update, r=steveklabnik
book: update example patterns to be more clear
When using Point { x: 0, y: 0 } and showing pattern matching decomposing
x and y individually its hard to understand. By using a different value
for x and a different value for y it is more clear.
Jonathan Turner [Mon, 8 Aug 2016 20:25:55 +0000 (13:25 -0700)]
Rollup merge of #35371 - mgattozzi:master, r=steveklabnik
Update HashMap docs regarding DoS protection
Because of changes to how Rust acquires randomness HashMap is not
guaranteed to be DoS resistant. This commit reflects these changes in
the docs themselves and provides an alternative method to creating
a hash that is resistant if needed.
This fixes #33817 and includes relevant information regarding changes made in #33086
bors [Mon, 8 Aug 2016 18:17:05 +0000 (11:17 -0700)]
Auto merge of #35492 - jonathandturner:fix_nightlies, r=arielb1
Fix for nightlies
Remove the NOTE tests for now so that nightlies will pass. We'll move many of these tests to UI tests later, as this is a better place to check the notes.
Doug Goldstein [Sun, 7 Aug 2016 15:14:01 +0000 (10:14 -0500)]
book: update example patterns to be more clear
When using Point { x: 0, y: 0 } and showing pattern matching decomposing
x and y individually its hard to understand. By using a different value
for x and a different value for y it is more clear.
Jonathan Turner [Sun, 7 Aug 2016 16:59:42 +0000 (09:59 -0700)]
Rollup merge of #35417 - Limeth:master, r=jonathandturner
E0131 updated to new format
Changes
```
error[E0131]: main function is not allowed to have type parameters
--> src/test/compile-fail/E0131.rs:11:1
|
11 | fn main<T>() { //~ ERROR E0131
| ^
```
to
```
error[E0131]: main function is not allowed to have type parameters
--> src/test/compile-fail/E0131.rs:11:1
|
11 | fn main<T>() { //~ ERROR E0131
| ^^^ main cannot have type parameters
```
Fixes #35257. Part of #35233.
r? @jonathandturner
Jonathan Turner [Sun, 7 Aug 2016 16:59:40 +0000 (09:59 -0700)]
Rollup merge of #35355 - shri3k:E0046, r=jonathandturner
Updates compiler error E0046 with new format
Addresses #35209 as part of #35233.
r? @jonathandturner
I've repeated the following in my code. If this is something not desirable then let me know if there's any process to make this any cleaner. Thank you.
```rust
missing_items.iter()
.map(|name| name.to_string())
.collect::<Vec<_>>().join("`, `"))
```