Commit Graph

60802 Commits

Author SHA1 Message Date
Brian Anderson
a2735c0249 rustc: Remove all "consider using an explicit lifetime parameter" suggestions
These give so many incorrect suggestions that having them is
detrimental to the user experience. The compiler should not be
suggesting changes to the code that are wrong - it is infuriating: not
only is the compiler telling you that _you don't understand_ borrowing,
_the compiler itself_ appears to not understand borrowing. It does not
inspire confidence.
2017-01-26 22:11:29 +00:00
bors
8430042a49 Auto merge of #39066 - arielb1:lifetime-extension-test, r=nikomatsakis
End temporary lifetimes being extended by `let X: &_` hints

cc #39283

r? @nikomatsakis
2017-01-26 17:42:52 +00:00
bors
491b978822 Auto merge of #39309 - eddyb:map-shmap, r=nikomatsakis
Rename tcx.map to the far more descriptive tcx.hir.

Also a bit more renaming because `ast_map` and `'ast` were still used with HIR.
Main motivation is to "free up" `tcx.map`, or rather, `tcx.maps`, to consolidate `ty::maps` there.

r? @nikomatsakis
2017-01-26 15:02:23 +00:00
bors
07fe04c1e2 Auto merge of #38819 - GuillaumeGomez:main_func_wrong_type, r=GuillaumeGomez
Add a distinct error code and description for "main function has wron…

…g type"
2017-01-26 12:23:13 +00:00
Eduard-Mihai Burtescu
1ff3641623 rustc: don't call the HIR AST. 2017-01-26 13:41:28 +02:00
Eduard-Mihai Burtescu
45c8c5678a rustc: rename TyCtxt's map field to hir. 2017-01-26 13:41:28 +02:00
Guillaume Gomez
97b9c8b8d3 Update error code number 2017-01-26 11:17:17 +01:00
Guillaume Gomez
e7c3fb90ee Add a distinct error code and description for "main function has wrong type" 2017-01-26 11:12:46 +01:00
bors
5158501367 Auto merge of #39075 - est31:remove_reflect, r=nikomatsakis
Remove Reflect

PR for removing the `Reflect` trait. Opened so that a crater run can be done for testing the impact: https://github.com/rust-lang/rust/issues/27749#issuecomment-272665163

Fixes #27749
2017-01-26 09:54:03 +00:00
bors
2f0463a4a4 Auto merge of #39000 - nikomatsakis:incr_comp_crosscontaminate_impl_item, r=michaelwoerister
process trait/impl items directly from the visitor callback

The current setup processes impl/trait items while visiting
the impl/trait. This means we basically have this setup:

    <Lots> -> TypeckItemBody(Impl) -> Tables(ImplItem{0,1,2,3})

But this was largely an artifact of the older code. By moving the
processing of items into method dedicated for their use, we produce this
setup:

    <Little> -> TypeckItemBody(ImplItem0) -> Tables(ImplItem0)
    ...
    <Little> -> TypeckItemBody(ImplItem3) -> Tables(ImplItem3)

r? @michaelwoerister

Also, we might consider removing the `TypeckItemBody` node altogether and just using `Tables` as the task. `Tables` is its primary output, I imagine? That would reduce size of dep-graph somewhat.

cc @eddyb -- perhaps this pattern applies elsewhere?
2017-01-26 04:25:03 +00:00
bors
6991938d3e Auto merge of #38961 - steveklabnik:fix-sort-wording, r=alexcrichton
Fix wording around sort guarantees

Fixes #38524

/cc @rust-lang/libs @stjepang
2017-01-26 01:51:26 +00:00
bors
df8debf6d9 Auto merge of #38920 - petrochenkov:selfimpl, r=eddyb
Partially implement RFC 1647 (`Self` in impl headers)

The name resolution part is easy, but the typeck part contains an unexpected problem.

It turns out that `Self` type *depends* on bounds and `where` clauses, so we need to convert them first to determine what the `Self` type is! If bounds/`where` clauses can refer to `Self` then we have a cyclic dependency.
This is required to support impls like this:
```
// Found in libcollections
impl<I: IntoIterator> SpecExtend<I> for LinkedList<I::Item> { .... }
                                                      ^^^^^ associated type `Item` is found using information from bounds

```
I'm not yet sure how to resolve this issue.
One possible solution (that feels hacky) is to make two passes over generics - first collect predicates ignoring everything involving `Self`, then determine `Self`, then collect predicates again without ignoring anything. (Some kind of lazy on-demand checking or something looks like a proper solution.)

This patch in its current state doesn't solve the problem with `Self` in bounds, so the only observable things it does is improving error messages and supporting `impl Trait<Self> for Type {}`.

There's also a question about feature gating. It's non-trivial to *detect* "newly resolved" `Self`s to feature gate them, but it's simple to *enable* the new resolution behavior when the feature gate is already specified. Alternatively this can be considered a bug fix and merged without a feature gate.

cc https://github.com/rust-lang/rust/issues/38864
r? @nikomatsakis
cc @eddyb
Whitespace ignoring diff https://github.com/rust-lang/rust/pull/38920/files?w=1
2017-01-25 23:08:56 +00:00
Niko Matsakis
282f7a3c44 rename Tables to TypeckTables 2017-01-25 16:24:00 -05:00
Niko Matsakis
80b5f98d03 remove outdated text 2017-01-25 15:56:30 -05:00
Niko Matsakis
1c0c2af3dc merge TypeckItemBody and Tables depnodes 2017-01-25 15:50:47 -05:00
Niko Matsakis
01195df2ab fix the test case by supplying proper options 2017-01-25 15:50:47 -05:00
Niko Matsakis
a0151e834b pacify the mercilous tidy 2017-01-25 15:50:47 -05:00
Niko Matsakis
c6b65ac748 process trait/impl items directly from the visitor callback
The current setup processes impl/trait items while visiting
the impl/trait. This means we basically have this setup:

    <Lots> -> TypeckItemBody(Impl) -> Tables(ImplItem{0,1,2,3})

But this was largely an artifact of the older code. By moving the
processing of items into method dedicated for their use, we produce this
setup:

    <Little> -> TypeckItemBody(ImplItem0) -> Tables(ImplItem0)
    ...
    <Little> -> TypeckItemBody(ImplItem3) -> Tables(ImplItem3)
2017-01-25 15:50:47 -05:00
bors
94d4589388 Auto merge of #38856 - zackw:process-envs, r=aturon
Add std::process::Command::envs()

`Command::envs()` adds a vector of key-value pairs to the child
process environment all at once.  Suggested in #38526.

This is not fully baked and frankly I'm not sure it even _works_, but I need some help finishing it up, and this is the simplest way to show you what I've got.  The problems I know exist and don't know how to solve, from most to least important, are:

* [ ] I don't know if the type signature of the new function is correct.
* [x] The new test might not be getting run.  I didn't see it go by in the output of `x.py test src/libstd --stage 1`.
* [x] The tidy check says ``process.rs:402: different `since` than before`` which I don't know what it means.

r? @brson
2017-01-25 20:24:02 +00:00
Stjepan Glavina
e02f923e37 Remove trailing whitespace 2017-01-25 13:57:36 -05:00
Stjepan Glavina
11ede684ee Fix: insertion_len -> max_insertion 2017-01-25 13:57:35 -05:00
Stjepan Glavina
c2b153b133 Expand the sort docs 2017-01-25 13:57:35 -05:00
Steve Klabnik
2a3568f14b Fix wording around sort guarantees
Fixes #38524
2017-01-25 13:57:34 -05:00
bors
fc57e40ce7 Auto merge of #39296 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 6 pull requests

- Successful merges: #38930, #39212, #39251, #39267, #39276, #39278
- Failed merges:
2017-01-25 17:23:54 +00:00
Guillaume Gomez
a2fa75b705 Rollup merge of #39278 - das-g:patch-1, r=steveklabnik
fix book: refer to `add_two` as "tested function"

refer to `add_two` as "tested function" rather than "test function", which would be `it_works`
2017-01-25 17:08:20 +01:00
Guillaume Gomez
e305b99821 Rollup merge of #39276 - GuillaumeGomez:array_urls, r=frewsxcv
Add missing urls for array docs

r? @frewsxcv
2017-01-25 17:08:19 +01:00
Guillaume Gomez
ee74420e74 Rollup merge of #39267 - king6cong:master, r=steveklabnik
doc comment rewording
2017-01-25 17:08:18 +01:00
Guillaume Gomez
66497d50f8 Rollup merge of #39251 - wesleywiser:fixme_1, r=BurntSushi
Remove a FIXME in core/hash tests

Removes a FIXME
2017-01-25 17:08:17 +01:00
Guillaume Gomez
fd8988eb0b Rollup merge of #39212 - redox-os:master, r=brson
Use libc errno in Redox submodule

This fixes https://github.com/redox-os/redox/issues/830, and is necessary when using libc in Redox
2017-01-25 17:08:16 +01:00
Guillaume Gomez
6ca35a6e18 Rollup merge of #38930 - insaneinside:place-left-arrow-syntax-docs, r=brson
Updates to src/libcore/ops.rs docs for RFC#1228 (Placement Left Arrow)

Also fixed a minor typo in docs for `core::ops::Place`.
2017-01-25 17:08:14 +01:00
bors
1283c02955 Auto merge of #39286 - nrc:save-path, r=eddyb
save-analysis: polishing paths

a couple of minor changes that get us better coverage of different paths.

r? @eddyb
2017-01-25 11:59:18 +00:00
bors
185d908f61 Auto merge of #39277 - tedsta:fuchsia_std_process, r=alexcrichton
Update Fuchsia support for std::process.

- Adds support for try_wait.
- Miscellaneous updates to keep up with Magenta changes.

I'll begin `sys/fuchsia` soon, just been bogged down with my actual job lately (I'm not on the Fuchsia team).
2017-01-25 06:32:31 +00:00
Nick Cameron
5e33c5f0ff save-analysis: walk paths
Catches generic types in paths
2017-01-25 17:00:19 +13:00
Nick Cameron
659859c537 save-analysis: walk path expressions
This is actually kinda hard to hit, but it fixes missing the `foo` in `for _ in foo {}`.
2017-01-25 16:46:34 +13:00
bors
c0d0e68be4 Auto merge of #35712 - oli-obk:exclusive_range_patterns, r=nikomatsakis
exclusive range patterns

adds `..` patterns to the language under a feature gate (`exclusive_range_pattern`).

This allows turning

``` rust
match i {
    0...9 => {},
    10...19 => {},
    20...29 => {},
    _ => {}
}
```

into

``` rust
match i {
    0..10 => {},
    10..20 => {},
    20..30 => {},
    _ => {}
}
```
2017-01-25 02:17:33 +00:00
Ariel Ben-Yehuda
82a280597d end temporary lifetimes being extended by let X: &_ hints
Fixes #36082.
2017-01-25 02:49:24 +02:00
bors
83c2d95238 Auto merge of #39245 - alexcrichton:enable-platform, r=brson
rustbuild: Start building --enable-extended

This commit adds a new flag to the configure script,
`--enable-extended`, which is intended for specifying a desire to
compile the full suite of Rust tools such as Cargo, the RLS, etc. This
is also an indication that the build system should create combined
installers such as the pkg/exe/msi artifacts.

Currently the `--enable-extended` flag just indicates that combined
installers should be built, and Cargo is itself not compiled just yet
but rather only downloaded from its location. The intention here is to
quickly get to feature parity with the current release process and then
we can start improving it afterwards.

All new files in this PR inside `src/etc/installer` are copied from the
rust-packaging repository.

cc #38531
2017-01-24 23:34:35 +00:00
Alex Crichton
f3dfcae202 rustbuild: Start building --enable-extended
This commit adds a new flag to the configure script,
`--enable-extended`, which is intended for specifying a desire to
compile the full suite of Rust tools such as Cargo, the RLS, etc. This
is also an indication that the build system should create combined
installers such as the pkg/exe/msi artifacts.

Currently the `--enable-extended` flag just indicates that combined
installers should be built, and Cargo is itself not compiled just yet
but rather only downloaded from its location. The intention here is to
quickly get to feature parity with the current release process and then
we can start improving it afterwards.

All new files in this PR inside `src/etc/installer` are copied from the
rust-packaging repository.
2017-01-24 14:48:03 -08:00
est31
af46d69b8a Remove Reflect
* Remove the Reflect trait
* Remove the "reflect" lang feature
2017-01-24 23:22:44 +01:00
Steve Klabnik
249b444efa fix mailmap 2017-01-24 17:22:00 -05:00
Raphael Das Gupta
c4c86dd04c fix book: refer to add_two as "tested function"
rather than "test function", which would be `it_works`
2017-01-24 22:44:41 +01:00
Theodore DeRego
bbe419ff30 Updated Fuchsia support for std::process. Adds support for try_wait. Misc. updates to reflect changes in Magenta 2017-01-24 13:13:42 -08:00
Guillaume Gomez
c8d1f322ca Add missing urls for array docs 2017-01-24 21:16:41 +01:00
bors
fe597dc9a9 Auto merge of #39222 - GuillaumeGomez:rustdoc_where, r=frewsxcv,steveklabnik,alexcrichton,nrc
Force backline on all where in docs

Pictures are better than words in this case:

Before:

<img width="1440" alt="screen shot 2017-01-21 at 15 34 27" src="https://cloud.githubusercontent.com/assets/3050060/22175139/6e7c75d8-dfef-11e6-9904-023d63e609d2.png">

After:

<img width="1440" alt="screen shot 2017-01-21 at 15 34 32" src="https://cloud.githubusercontent.com/assets/3050060/22175140/75cc3846-dfef-11e6-9799-fffb213653e4.png">

r? @steveklabnik

cc @rust-lang/docs
2017-01-24 15:26:20 +00:00
bors
d2d8ae6575 Auto merge of #39214 - estebank:fix-labels-without-msg, r=nikomatsakis
Fix multiple labels when some don't have message

The diagnostic emitter now accounts for labels with no text message, presenting the underline on its own, without drawing the line for the non existing message below it. Go from

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ----^^^^^^^----
  |   |   |
  |   |   `b` is a good letter
  |
```

to

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ----^^^^^^^----
  |       |
  |       `b` is a good letter
```

from

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ^^^^-------^^^^
  |   |   |
  |   |
  |   `a` is a good letter
```

to

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ^^^^-------^^^^ `a` is a good letter
```

and from

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ^^^^-------^^^^
  |   |   |
  |   |
  |
```

to

```
error: foo
 --> test.rs:3:6
  |
3 |   a { b { c } d }
  |   ^^^^-------^^^^
```
r? @nikomatsakis
cc @jonathandturner, @GuillaumeGomez, @nrc
2017-01-24 11:51:34 +00:00
king6cong
e7c0f747e3 doc typo fix 2017-01-24 17:35:19 +08:00
bors
65b17f53ef Auto merge of #39173 - jseyfried:tokenstream, r=nrc
Refactor `TokenStream`

r? @nrc
2017-01-24 09:29:18 +00:00
king6cong
4c5d1a4c22 doc comment rewording 2017-01-24 16:42:17 +08:00
bors
ae472485b7 Auto merge of #39145 - nrc:opt-cfg-mod, r=@jseyfried
Add an option to the parser so cfg'ed out modules can still be parsed

r? @jseyfried

cc @dtolnay, @erickt it would be great if we could get this picked up into Syntex asap - it fixes a pretty nasty bug in Rustfmt.
2017-01-24 06:57:29 +00:00
bors
0ba60387f2 Auto merge of #39227 - alexcrichton:enable-i686-musl, r=brson
travis: Enable testing i686 musl

This fixes the final issues with the target related to unwinding by disabling
removal of frame pointers.
2017-01-24 03:43:22 +00:00