]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agorustc_typeck: pass all lifetimes through AstConv::opt_ast_region_to_region.
Eduard-Mihai Burtescu [Wed, 4 Jan 2017 21:23:11 +0000 (23:23 +0200)]
rustc_typeck: pass all lifetimes through AstConv::opt_ast_region_to_region.

7 years agorustc_typeck: force users of RegionScope to get anon_region's one by one.
Eduard-Mihai Burtescu [Wed, 4 Jan 2017 12:32:44 +0000 (14:32 +0200)]
rustc_typeck: force users of RegionScope to get anon_region's one by one.

7 years agoAuto merge of #37057 - brson:nosuggest, r=nikomatsakis
bors [Fri, 27 Jan 2017 22:13:41 +0000 (22:13 +0000)]
Auto merge of #37057 - brson:nosuggest, r=nikomatsakis

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.

r? @nikomatsakis

7 years agoAuto merge of #39320 - alexcrichton:less-backtraces, r=aturon
bors [Fri, 27 Jan 2017 18:12:04 +0000 (18:12 +0000)]
Auto merge of #39320 - alexcrichton:less-backtraces, r=aturon

travis: Turn off core dumps on OSX

I've seen these take up quite a bit of log space and I have the sneaking
suspicion that they're just making our test suite take longer (sometimes timing
out on 32-bit OSX now). In any case the backtraces haven't proven too useful,
unfortunately.

7 years agoAuto merge of #39282 - petrochenkov:selfstab, r=nikomatsakis
bors [Fri, 27 Jan 2017 12:23:23 +0000 (12:23 +0000)]
Auto merge of #39282 - petrochenkov:selfstab, r=nikomatsakis

Stabilize Self and associated types in struct expressions and patterns

Rebase of https://github.com/rust-lang/rust/pull/37734
Closes https://github.com/rust-lang/rust/issues/37544
r? @nikomatsakis

7 years agoAuto merge of #39252 - alexcrichton:less-exports, r=nrc
bors [Fri, 27 Jan 2017 10:01:45 +0000 (10:01 +0000)]
Auto merge of #39252 - alexcrichton:less-exports, r=nrc

Hide a few more standard library symbols

These commits touch up some of the symbol visibility rules for some crates related to the standard library, notably:

* Symbols that are `pub extern` and `#[no_mangle]` which are internal-to-rust ABI things are no longer at the `C` export level, but the `Rust` export level. This includes allocators, panic runtimes, and compiler builtins.
* The libbacktrace library is now compiled with `-fvisibility=hidden` to ensure that we don't export those symbols.

7 years agostd: Compile libbacktrace with -fvisibility=hidden
Alex Crichton [Sun, 22 Jan 2017 20:58:56 +0000 (12:58 -0800)]
std: Compile libbacktrace with -fvisibility=hidden

We don't want these symbols exported from the standard library, this is
just an internal implementation detail of the standard library
currently.

Closes #34984

7 years agorustc: Don't export builtins/panic/alloc syms
Alex Crichton [Sun, 22 Jan 2017 20:53:35 +0000 (12:53 -0800)]
rustc: Don't export builtins/panic/alloc syms

This hides symbols from various unstable and implementation-detail
crates of the standard library. Although typically transitive exported
`pub extern` functions are exported from cdylibs, these crates aren't
necessary as they're all implementation details.

Closes #34493

7 years agoAuto merge of #39281 - michaelwoerister:make-cc-incr-comp-opt-in, r=nikomatsakis
bors [Fri, 27 Jan 2017 07:36:43 +0000 (07:36 +0000)]
Auto merge of #39281 - michaelwoerister:make-cc-incr-comp-opt-in, r=nikomatsakis

incr.comp.: Make cross-crate tracking for incr. comp. opt-in.

The current implementation of cross-crate dependency tracking can cause quite long compile times and high memory usage for some crates (see #39208 for example). This PR therefore makes that part of dependency tracking optional. Incremental compilation still works, it will only have very coarse dep-tracking for upstream crates.

r? @nikomatsakis

7 years agoAuto merge of #39139 - estebank:issue-38147, r=nikomatsakis
bors [Fri, 27 Jan 2017 04:57:12 +0000 (04:57 +0000)]
Auto merge of #39139 - estebank:issue-38147, r=nikomatsakis

Point to immutable arg/fields when trying to use as &mut

Present the following output when trying to access an immutable borrow's
field as mutable:

```
error[E0389]: cannot borrow data mutably in a `&` reference
  --> $DIR/issue-38147-1.rs:27:9
   |
26 | fn f(&self) {
   |      -----  use `&mut self` here to make mutable
27 |     f.s.push('x');
   |     ^^^ assignment into an immutable reference
```

And the following when trying to access an immutable struct field as mutable:

```
error: cannot borrow immutable borrowed content `*self.s` as mutable
  --> $DIR/issue-38147-3.rs:17:9
   |
12 |     s: &'a String
   |     ------------- use `&'a mut String` here to make mutable
...|
16 |     fn f(&self) {
   |          -----  use `&mut self` here to make mutable
17 |         self.s.push('x');
   |         ^^^^^^ cannot borrow as mutable
```

Fixes #38147.

7 years agoAuto merge of #39158 - petrochenkov:bounds, r=nikomatsakis
bors [Fri, 27 Jan 2017 01:27:12 +0000 (01:27 +0000)]
Auto merge of #39158 - petrochenkov:bounds, r=nikomatsakis

Bounds parsing refactoring 2

See https://github.com/rust-lang/rust/pull/37511 for previous discussion.
cc @matklad

Relaxed parsing rules:
 - zero bounds after `:` are allowed in all contexts.
 - zero predicates are allowed after `where`.
- trailing separator `,` is allowed after predicates in `where` clauses not followed by `{`.

Other parsing rules:
 - trailing separator `+` is still allowed in all bound lists.

Code is also cleaned up and tests added.

I haven't touched parsing of trait object types yet, I'll do it later.

7 years agorustc: Remove all "consider using an explicit lifetime parameter" suggestions
Brian Anderson [Sun, 9 Oct 2016 17:30:11 +0000 (10:30 -0700)]
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.

7 years agoPoint to immutable arg/fields when trying to use as &mut
Esteban Küber [Tue, 17 Jan 2017 07:42:11 +0000 (23:42 -0800)]
Point to immutable arg/fields when trying to use as &mut

Point to immutable borrow arguments and fields when trying to use them as
mutable borrows. Add label to primary span on "cannot borrow as mutable"
errors.

Present the following output when trying to access an immutable borrow's
field as mutable:

```
error[E0389]: cannot borrow data mutably in a `&` reference
  --> $DIR/issue-38147-1.rs:27:9
   |
26 | fn f(&self) {
   |      -----  use `&mut self` here to make mutable
27 |     f.s.push('x');
   |     ^^^ assignment into an immutable reference
```

And the following when trying to access an immutable struct field as mutable:

```
error: cannot borrow immutable borrowed content `*self.s` as mutable
  --> $DIR/issue-38147-3.rs:17:9
   |
12 |     s: &'a String
   |     ------------- use `&'a mut String` here to make mutable
...|
16 |     fn f(&self) {
   |          -----  use `&mut self` here to make mutable
17 |         self.s.push('x');
   |         ^^^^^^ cannot borrow as mutable
```

7 years agoAuto merge of #39066 - arielb1:lifetime-extension-test, r=nikomatsakis
bors [Thu, 26 Jan 2017 17:42:52 +0000 (17:42 +0000)]
Auto merge of #39066 - arielb1:lifetime-extension-test, r=nikomatsakis

End temporary lifetimes being extended by `let X: &_` hints

cc #39283

r? @nikomatsakis

7 years agotravis: Turn off core dumps on OSX
Alex Crichton [Thu, 26 Jan 2017 17:04:07 +0000 (09:04 -0800)]
travis: Turn off core dumps on OSX

I've seen these take up quite a bit of log space and I have the sneaking
suspicion that they're just making our test suite take longer (sometimes timing
out on 32-bit OSX now). In any case the backtraces haven't proven too useful,
unfortunately.

7 years agoAuto merge of #39309 - eddyb:map-shmap, r=nikomatsakis
bors [Thu, 26 Jan 2017 15:02:23 +0000 (15:02 +0000)]
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

7 years agoBetter comments for FIXMEs
Vadim Petrochenkov [Thu, 26 Jan 2017 14:41:37 +0000 (17:41 +0300)]
Better comments for FIXMEs

7 years agoAuto merge of #38819 - GuillaumeGomez:main_func_wrong_type, r=GuillaumeGomez
bors [Thu, 26 Jan 2017 12:23:13 +0000 (12:23 +0000)]
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"

7 years agorustc: don't call the HIR AST.
Eduard-Mihai Burtescu [Thu, 26 Jan 2017 01:21:50 +0000 (03:21 +0200)]
rustc: don't call the HIR AST.

7 years agorustc: rename TyCtxt's `map` field to `hir`.
Eduard-Mihai Burtescu [Thu, 26 Jan 2017 00:41:06 +0000 (02:41 +0200)]
rustc: rename TyCtxt's `map` field to `hir`.

7 years agoUpdate error code number
Guillaume Gomez [Thu, 26 Jan 2017 10:17:17 +0000 (11:17 +0100)]
Update error code number

7 years agoAdd a distinct error code and description for "main function has wrong type"
Guillaume Gomez [Wed, 4 Jan 2017 11:56:33 +0000 (12:56 +0100)]
Add a distinct error code and description for "main function has wrong type"

7 years agoAuto merge of #39075 - est31:remove_reflect, r=nikomatsakis
bors [Thu, 26 Jan 2017 09:54:03 +0000 (09:54 +0000)]
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

7 years agoAuto merge of #39000 - nikomatsakis:incr_comp_crosscontaminate_impl_item, r=michaelwo...
bors [Thu, 26 Jan 2017 04:25:03 +0000 (04:25 +0000)]
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?

7 years agoAuto merge of #38961 - steveklabnik:fix-sort-wording, r=alexcrichton
bors [Thu, 26 Jan 2017 01:51:26 +0000 (01:51 +0000)]
Auto merge of #38961 - steveklabnik:fix-sort-wording, r=alexcrichton

Fix wording around sort guarantees

Fixes #38524

/cc @rust-lang/libs @stjepang

7 years agoAuto merge of #38920 - petrochenkov:selfimpl, r=eddyb
bors [Wed, 25 Jan 2017 23:08:56 +0000 (23:08 +0000)]
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

7 years agorename `Tables` to `TypeckTables`
Niko Matsakis [Wed, 25 Jan 2017 21:24:00 +0000 (16:24 -0500)]
rename `Tables` to `TypeckTables`

7 years agoremove outdated text
Niko Matsakis [Wed, 25 Jan 2017 20:56:30 +0000 (15:56 -0500)]
remove outdated text

7 years agomerge TypeckItemBody and Tables depnodes
Niko Matsakis [Thu, 12 Jan 2017 23:11:02 +0000 (18:11 -0500)]
merge TypeckItemBody and Tables depnodes

7 years agofix the test case by supplying proper options
Niko Matsakis [Thu, 12 Jan 2017 17:01:18 +0000 (12:01 -0500)]
fix the test case by supplying proper options

7 years agopacify the mercilous tidy
Niko Matsakis [Wed, 11 Jan 2017 21:13:07 +0000 (16:13 -0500)]
pacify the mercilous tidy

7 years agoprocess trait/impl items directly from the visitor callback
Niko Matsakis [Wed, 11 Jan 2017 20:46:11 +0000 (15:46 -0500)]
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)

7 years agoAuto merge of #38856 - zackw:process-envs, r=aturon
bors [Wed, 25 Jan 2017 20:24:02 +0000 (20:24 +0000)]
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

7 years agoRemove trailing whitespace
Stjepan Glavina [Fri, 20 Jan 2017 08:11:11 +0000 (09:11 +0100)]
Remove trailing whitespace

7 years agoFix: insertion_len -> max_insertion
Stjepan Glavina [Tue, 17 Jan 2017 00:11:06 +0000 (01:11 +0100)]
Fix: insertion_len -> max_insertion

7 years agoExpand the sort docs
Stjepan Glavina [Sat, 14 Jan 2017 00:46:30 +0000 (01:46 +0100)]
Expand the sort docs

7 years agoFix wording around sort guarantees
Steve Klabnik [Tue, 10 Jan 2017 15:23:21 +0000 (10:23 -0500)]
Fix wording around sort guarantees

Fixes #38524

7 years agoAuto merge of #39296 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Wed, 25 Jan 2017 17:23:54 +0000 (17:23 +0000)]
Auto merge of #39296 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 6 pull requests

- Successful merges: #38930, #39212, #39251, #39267, #39276, #39278
- Failed merges:

7 years agoRollup merge of #39278 - das-g:patch-1, r=steveklabnik
Guillaume Gomez [Wed, 25 Jan 2017 16:08:20 +0000 (17:08 +0100)]
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`

7 years agoRollup merge of #39276 - GuillaumeGomez:array_urls, r=frewsxcv
Guillaume Gomez [Wed, 25 Jan 2017 16:08:19 +0000 (17:08 +0100)]
Rollup merge of #39276 - GuillaumeGomez:array_urls, r=frewsxcv

Add missing urls for array docs

r? @frewsxcv

7 years agoRollup merge of #39267 - king6cong:master, r=steveklabnik
Guillaume Gomez [Wed, 25 Jan 2017 16:08:18 +0000 (17:08 +0100)]
Rollup merge of #39267 - king6cong:master, r=steveklabnik

doc comment rewording

7 years agoRollup merge of #39251 - wesleywiser:fixme_1, r=BurntSushi
Guillaume Gomez [Wed, 25 Jan 2017 16:08:17 +0000 (17:08 +0100)]
Rollup merge of #39251 - wesleywiser:fixme_1, r=BurntSushi

Remove a FIXME in core/hash tests

Removes a FIXME

7 years agoRollup merge of #39212 - redox-os:master, r=brson
Guillaume Gomez [Wed, 25 Jan 2017 16:08:16 +0000 (17:08 +0100)]
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

7 years agoRollup merge of #38930 - insaneinside:place-left-arrow-syntax-docs, r=brson
Guillaume Gomez [Wed, 25 Jan 2017 16:08:14 +0000 (17:08 +0100)]
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`.

7 years agoAuto merge of #39286 - nrc:save-path, r=eddyb
bors [Wed, 25 Jan 2017 11:59:18 +0000 (11:59 +0000)]
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

7 years agoAuto merge of #39277 - tedsta:fuchsia_std_process, r=alexcrichton
bors [Wed, 25 Jan 2017 06:32:31 +0000 (06:32 +0000)]
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).

7 years agosave-analysis: walk paths
Nick Cameron [Wed, 25 Jan 2017 04:00:19 +0000 (17:00 +1300)]
save-analysis: walk paths

Catches generic types in paths

7 years agosave-analysis: walk path expressions
Nick Cameron [Wed, 25 Jan 2017 03:46:34 +0000 (16:46 +1300)]
save-analysis: walk path expressions

This is actually kinda hard to hit, but it fixes missing the `foo` in `for _ in foo {}`.

7 years agoAuto merge of #35712 - oli-obk:exclusive_range_patterns, r=nikomatsakis
bors [Wed, 25 Jan 2017 02:17:33 +0000 (02:17 +0000)]
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 => {},
    _ => {}
}
```

7 years agoend temporary lifetimes being extended by `let X: &_` hints
Ariel Ben-Yehuda [Sat, 14 Jan 2017 17:59:10 +0000 (19:59 +0200)]
end temporary lifetimes being extended by `let X: &_` hints

Fixes #36082.

7 years agoAuto merge of #39245 - alexcrichton:enable-platform, r=brson
bors [Tue, 24 Jan 2017 23:34:35 +0000 (23:34 +0000)]
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

7 years agoincr.comp.: Make cross-crate tracking for incr. comp. opt-in.
Michael Woerister [Tue, 24 Jan 2017 16:03:37 +0000 (11:03 -0500)]
incr.comp.: Make cross-crate tracking for incr. comp. opt-in.

7 years agorustbuild: Start building --enable-extended
Alex Crichton [Sat, 21 Jan 2017 01:03:06 +0000 (17:03 -0800)]
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.

7 years agoStabilize Self and associated types in struct expressions and patterns
Vadim Petrochenkov [Sat, 12 Nov 2016 12:33:16 +0000 (15:33 +0300)]
Stabilize Self and associated types in struct expressions and patterns

7 years agoRemove Reflect
est31 [Sun, 15 Jan 2017 07:42:33 +0000 (08:42 +0100)]
Remove Reflect

* Remove the Reflect trait
* Remove the "reflect" lang feature

7 years agofix mailmap
Steve Klabnik [Tue, 24 Jan 2017 22:22:00 +0000 (17:22 -0500)]
fix mailmap

7 years agofix book: refer to `add_two` as "tested function"
Raphael Das Gupta [Tue, 24 Jan 2017 21:44:41 +0000 (22:44 +0100)]
fix book: refer to `add_two` as "tested function"

rather than "test function", which would be `it_works`

7 years agoUpdated Fuchsia support for std::process. Adds support for try_wait. Misc. updates...
Theodore DeRego [Tue, 24 Jan 2017 21:01:47 +0000 (13:01 -0800)]
Updated Fuchsia support for std::process. Adds support for try_wait. Misc. updates to reflect changes in Magenta

7 years agoAdd missing urls for array docs
Guillaume Gomez [Tue, 24 Jan 2017 20:16:41 +0000 (21:16 +0100)]
Add missing urls for array docs

7 years agoparser: Permit trailing +'s in bound lists
Vadim Petrochenkov [Tue, 24 Jan 2017 19:55:45 +0000 (22:55 +0300)]
parser: Permit trailing +'s in bound lists

7 years agoImprove some expected/found error messages from parser
Vadim Petrochenkov [Wed, 18 Jan 2017 16:01:04 +0000 (19:01 +0300)]
Improve some expected/found error messages from parser

7 years agoAdd tests
Vadim Petrochenkov [Wed, 18 Jan 2017 14:41:57 +0000 (17:41 +0300)]
Add tests

7 years agoRefactor parsing of generic arguments/parameters and where clauses
Vadim Petrochenkov [Tue, 17 Jan 2017 18:18:29 +0000 (21:18 +0300)]
Refactor parsing of generic arguments/parameters and where clauses

7 years agoAuto merge of #39222 - GuillaumeGomez:rustdoc_where, r=frewsxcv,steveklabnik,alexcric...
bors [Tue, 24 Jan 2017 15:26:20 +0000 (15:26 +0000)]
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

7 years agoAuto merge of #39214 - estebank:fix-labels-without-msg, r=nikomatsakis
bors [Tue, 24 Jan 2017 11:51:34 +0000 (11:51 +0000)]
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

7 years agodoc typo fix
king6cong [Tue, 24 Jan 2017 09:35:19 +0000 (17:35 +0800)]
doc typo fix

7 years agoAuto merge of #39173 - jseyfried:tokenstream, r=nrc
bors [Tue, 24 Jan 2017 09:29:18 +0000 (09:29 +0000)]
Auto merge of #39173 - jseyfried:tokenstream, r=nrc

Refactor `TokenStream`

r? @nrc

7 years agodoc comment rewording
king6cong [Tue, 24 Jan 2017 08:42:00 +0000 (16:42 +0800)]
doc comment rewording

7 years agoAuto merge of #39145 - nrc:opt-cfg-mod, r=@jseyfried
bors [Tue, 24 Jan 2017 06:57:29 +0000 (06:57 +0000)]
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.

7 years agoAuto merge of #39227 - alexcrichton:enable-i686-musl, r=brson
bors [Tue, 24 Jan 2017 03:43:22 +0000 (03:43 +0000)]
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.

7 years agoAuto merge of #39048 - lambda:impl-tosocketaddrs-for-string, r=alexcrichton
bors [Tue, 24 Jan 2017 01:17:09 +0000 (01:17 +0000)]
Auto merge of #39048 - lambda:impl-tosocketaddrs-for-string, r=alexcrichton

impl ToSocketAddrs for String

`ToSocketAddrs` is implemented for a number of different types,
including `(IpAddr, u16)`, `&str`, and various others, for the
convenience of being able to run things like
`TcpListener::bind("10.11.12.13:1415")`.  However, because this is a
generic parameter with a trait bound, if you have a `String` you cannot
pass it in, either directly as `TcpListener::bind(string)`, or the
`TcpListener::bind(&string)` as you might expect due to deref coercion;
you have to use `TcpListener::bind(&*string)`, which is noisy and hard
to discover (though #39029 suggests better error messages to make it
more discoverable).

Rather than making people stumble over this, just implement
`ToSocketAddrs` for `String`.

7 years agoAuto merge of #39260 - steveklabnik:rollup, r=steveklabnik
bors [Mon, 23 Jan 2017 22:38:33 +0000 (22:38 +0000)]
Auto merge of #39260 - steveklabnik:rollup, r=steveklabnik

Rollup of 7 pull requests

- Successful merges: #38794, #38956, #38993, #39191, #39200, #39233, #39258
- Failed merges:

7 years agoRollup merge of #39258 - jacwah:makefile-note, r=aturon
Steve Klabnik [Mon, 23 Jan 2017 21:40:53 +0000 (16:40 -0500)]
Rollup merge of #39258 - jacwah:makefile-note, r=aturon

build: Mention rustbuild in Makefile.in comments

I think this patch will help newcomers like myself with the build system. I didn't understand that the make targets listed in the Makefile.in comments only worked with the old system, until it was pointed out to me in #39256.

7 years agoRollup merge of #39233 - frewsxcv:upper-lower-docs, r=GuillaumeGomez
Steve Klabnik [Mon, 23 Jan 2017 21:40:52 +0000 (16:40 -0500)]
Rollup merge of #39233 - frewsxcv:upper-lower-docs, r=GuillaumeGomez

Add more references between lowercase/uppercase operations.

None

7 years agoRollup merge of #39200 - DirkyJerky:patch-1, r=steveklabnik
Steve Klabnik [Mon, 23 Jan 2017 21:40:50 +0000 (16:40 -0500)]
Rollup merge of #39200 - DirkyJerky:patch-1, r=steveklabnik

Docs for atomic orderings: link to the 'nomicon article for further reading

7 years agoRollup merge of #39191 - cesarb:book/trait-objects-vtable-size-and-align, r=steveklabnik
Steve Klabnik [Mon, 23 Jan 2017 21:40:49 +0000 (16:40 -0500)]
Rollup merge of #39191 - cesarb:book/trait-objects-vtable-size-and-align, r=steveklabnik

book: size and align in trait object vtables are used

The book currently claims that the `size` and `align` fields in the
trait object vtable are not used, but this is false. These two fields
are used by the stable `mem::size_of_val` and `mem::align_of_val`
functions.

See the `ty::TyDynamic` case of the `glue::size_and_align_of_dst`
function in librustc_trans, which is used to implement both intrinsics
in the unsized case.

r? @steveklabnik

7 years agoRollup merge of #38993 - krdln:patch-1, r=steveklabnik
Steve Klabnik [Mon, 23 Jan 2017 21:40:48 +0000 (16:40 -0500)]
Rollup merge of #38993 - krdln:patch-1, r=steveklabnik

Add `&mut expr` to syntax index

7 years agoRollup merge of #38956 - theduke:document-field-init-shorthand-38830, r=steveklabnik
Steve Klabnik [Mon, 23 Jan 2017 21:40:47 +0000 (16:40 -0500)]
Rollup merge of #38956 - theduke:document-field-init-shorthand-38830, r=steveklabnik

Update struct_expr grammar for field init shorthand.

Part of the work for #38830 .

r? @steveklabnik

7 years agoRollup merge of #38794 - ConnyOnny:master, r=steveklabnik
Steve Klabnik [Mon, 23 Jan 2017 21:40:46 +0000 (16:40 -0500)]
Rollup merge of #38794 - ConnyOnny:master, r=steveklabnik

book: match enum warning

Matching enums with named fields in the previous way yielded the "non_shorthand_field_patterns" warning.
The new code shows the shorthand syntax as well as field renaming, so it should be exhaustive ;-)

7 years agoAdd an option to the parser so cfg'ed out modules can still be parsed
Nick Cameron [Wed, 18 Jan 2017 00:13:36 +0000 (13:13 +1300)]
Add an option to the parser so cfg'ed out modules can still be parsed

7 years agobuild: Link to new build sys from Makefile.in
Jacob Wahlgren [Mon, 23 Jan 2017 18:56:48 +0000 (19:56 +0100)]
build: Link to new build sys from Makefile.in

7 years agoRemove `open_span` and `close_span` from `Delimited`.
Jeffrey Seyfried [Mon, 23 Jan 2017 04:58:15 +0000 (04:58 +0000)]
Remove `open_span` and `close_span` from `Delimited`.

7 years agoAuto merge of #39248 - Wilfred:patch-1, r=frewsxcv
bors [Mon, 23 Jan 2017 05:05:51 +0000 (05:05 +0000)]
Auto merge of #39248 - Wilfred:patch-1, r=frewsxcv

Adding missing URL to release notes

7 years agoRemove a FIXME in core/hash tests
Wesley Wiser [Mon, 23 Jan 2017 03:35:27 +0000 (22:35 -0500)]
Remove a FIXME in core/hash tests

7 years agoAuto merge of #39242 - Eijebong:typo_fix, r=apasel422
bors [Mon, 23 Jan 2017 02:53:57 +0000 (02:53 +0000)]
Auto merge of #39242 - Eijebong:typo_fix, r=apasel422

Fix minor typo

7 years agoAuto merge of #39247 - est31:master, r=jseyfried
bors [Mon, 23 Jan 2017 00:36:00 +0000 (00:36 +0000)]
Auto merge of #39247 - est31:master, r=jseyfried

Remove proc_macro from the tidy whitelist again

PR #38842 has exposed that we were missing the src/test/compile-fail-fulldeps
directory in the search for feature gate tests. Because the detection didn't
work despite the effort to name the test appropriately and add a correct
"// gate-test-proc_macro" comment, proc_macro was added to the whitelist.

We fix this little weakness in the feature gate tidy check and add
the src/test/compile-fail-fulldeps directory to the checked directories.

Part of issue #39059 .

7 years agoAdding missing URL to release notes
Wilfred Hughes [Sun, 22 Jan 2017 23:26:45 +0000 (23:26 +0000)]
Adding missing URL to release notes

7 years agoRemove proc_macro from the tidy whitelist again
est31 [Sun, 22 Jan 2017 22:05:51 +0000 (23:05 +0100)]
Remove proc_macro from the tidy whitelist again

PR #38842 has exposed that we were missing the src/test/compile-fail-fulldeps
directory in the search for feature gate tests. Because the detection didn't
work despite the effort to name the test appropriately and add a correct
"// gate-test-proc_macro" comment, proc_macro was added to the whitelist.

We fix this little weakness in the feature gate tidy check and add
the src/test/compile-fail-fulldeps directory to the checked directories.

7 years agoAuto merge of #39238 - king6cong:pr, r=frewsxcv
bors [Sun, 22 Jan 2017 22:20:12 +0000 (22:20 +0000)]
Auto merge of #39238 - king6cong:pr, r=frewsxcv

better comment wording

7 years agoRemove crate `proc_macro_tokens`.
Jeffrey Seyfried [Sun, 22 Jan 2017 09:09:33 +0000 (09:09 +0000)]
Remove crate `proc_macro_tokens`.

7 years agoRefactor `TokenStream`.
Jeffrey Seyfried [Wed, 18 Jan 2017 03:27:09 +0000 (03:27 +0000)]
Refactor `TokenStream`.

7 years agoAuto merge of #39243 - cseale:issue_30924, r=est31
bors [Sun, 22 Jan 2017 19:12:59 +0000 (19:12 +0000)]
Auto merge of #39243 - cseale:issue_30924, r=est31

[Gate Tests] - marking feature tests

Removal of the lang feature gate tests whitelist #39059

r? @est31

7 years agotravis: Enable testing i686 musl
Alex Crichton [Fri, 20 Jan 2017 23:32:47 +0000 (15:32 -0800)]
travis: Enable testing i686 musl

This fixes the final issues with the target related to unwinding by disabling
removal of frame pointers.

7 years ago[Gate Tests] - marking feature tests
Colm Seale [Sun, 22 Jan 2017 16:35:15 +0000 (16:35 +0000)]
[Gate Tests] - marking feature tests

Removal of the lang feature gate tests whitelist #39059

r? @est31

7 years agoAuto merge of #38648 - utkarshkukreti:question-mark-in-libstd-documentation-examples...
bors [Sun, 22 Jan 2017 16:55:16 +0000 (16:55 +0000)]
Auto merge of #38648 - utkarshkukreti:question-mark-in-libstd-documentation-examples, r=pnkfelix,steveklabnik,frewsxcvx

libstd: replace all `try!` with `?` in documentation examples

See #38644.

For the record, I used the following Perl one-liner and then manually fixed a couple of things it got wrong:

    $ perl -p -i -e 's#(///.*)try!\((.*)\)#$1$2?#' src/libstd/**/*.rs

7 years agoFix minor typo
Eijebong [Sun, 22 Jan 2017 16:27:29 +0000 (17:27 +0100)]
Fix minor typo

7 years agolibstd: mention `?` operator instead of removing `try!` macro reference
Utkarsh Kukreti [Thu, 29 Dec 2016 08:42:14 +0000 (14:12 +0530)]
libstd: mention `?` operator instead of removing `try!` macro reference

7 years agolibstd: update std::io module documentation to not mention `try!`
Utkarsh Kukreti [Wed, 28 Dec 2016 09:09:41 +0000 (14:39 +0530)]
libstd: update std::io module documentation to not mention `try!`

We're not using it in the examples anymore.

7 years agolibstd: replace all `try!` with `?` in documentation examples
Utkarsh Kukreti [Wed, 28 Dec 2016 09:02:35 +0000 (14:32 +0530)]
libstd: replace all `try!` with `?` in documentation examples

See #38644.

7 years agoAuto merge of #38108 - linclark:32777-E0328, r=GuillaumeGomez
bors [Sun, 22 Jan 2017 14:38:04 +0000 (14:38 +0000)]
Auto merge of #38108 - linclark:32777-E0328, r=GuillaumeGomez

Add error explanation for E0328.

This PR adds an explanation for an error in the list in #32777.

I haven't used this feature myself, so I was piecing it together from the docs. Please let me know if any changes in wording should be made.

One problem: When I followed the instructions in CONTRIBUTING.md, it said to run `make check-stage1` before posting the PR. This reported failures, but they seemed to be intermittent. I got different numbers of failures on each run. Here's the output for the last run

```
failures:

---- [run-make] run-make/rustc-macro-dep-files stdout ----

error: make failed
status: exit code: 2
command: "make"
stdout:
------------------------------------------
DYLD_LIBRARY_PATH="/Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin:/Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/lib:" '/Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/bin/rustc' --out-dir /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin -L /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin  foo.rs
DYLD_LIBRARY_PATH="/Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin:/Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/lib:" '/Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/bin/rustc' --out-dir /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin -L /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin  bar.rs --emit dep-info

------------------------------------------
stderr:
------------------------------------------
dyld: lazy symbol binding failed: Symbol not found: __ZN4core3fmt5write17h2f7663117dd4fb40E
  Referenced from: /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin/libfoo.dylib
  Expected in: /Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/lib/libstd-fdb5dc8c.dylib

dyld: Symbol not found: __ZN4core3fmt5write17h2f7663117dd4fb40E
  Referenced from: /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin/libfoo.dylib
  Expected in: /Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/lib/libstd-fdb5dc8c.dylib

make[1]: *** [all] Trace/BPT trap: 5

------------------------------------------

thread '[run-make] run-make/rustc-macro-dep-files' panicked at 'explicit panic', /Users/lclark/Repos/rust/src/tools/compiletest/src/runtest.rs:2407
note: Run with `RUST_BACKTRACE=1` for a backtrace.

failures:
    [run-make] run-make/rustc-macro-dep-files

test result: FAILED. 136 passed; 1 failed; 0 ignored; 0 measured

thread 'main' panicked at 'Some tests failed', /Users/lclark/Repos/rust/src/tools/compiletest/src/main.rs:302
make: *** [tmp/check-stage1-T-x86_64-apple-darwin-H-x86_64-apple-darwin-rmake.ok] Error 101
```

r? @GuillaumeGomez