]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #41007 - pgerber:dir_builder, r=frewsxcv
Corey Farwell [Wed, 5 Apr 2017 16:44:32 +0000 (12:44 -0400)]
Rollup merge of #41007 - pgerber:dir_builder, r=frewsxcv

Improve documentation for `std::fs::DirBuilder`

7 years agoRollup merge of #40999 - irfanhudda:improve-option-docs, r=steveklabnik
Corey Farwell [Wed, 5 Apr 2017 16:44:31 +0000 (12:44 -0400)]
Rollup merge of #40999 - irfanhudda:improve-option-docs, r=steveklabnik

Improve option API docs

Associated Issue: #29366

Improve `option` API docs for
* `IntoIter` struct
* `Iter` struct
* `IterMut` struct

r? @steveklabnik

7 years agoRollup merge of #40997 - donniebishop:from_utf8_linking, r=steveklabnik
Corey Farwell [Wed, 5 Apr 2017 16:44:30 +0000 (12:44 -0400)]
Rollup merge of #40997 - donniebishop:from_utf8_linking, r=steveklabnik

Added links to types in from_utf8 description

References #29375. Link to types mentioned in the documentation for `from_utf8` (`str`, `&[u8`], etc). Paragraphs were reformatted to keep any one line from being excessively long, but are otherwise unchanged.

7 years agoRollup merge of #40992 - donniebishop:utf8err_linking, r=alexcrichton
Corey Farwell [Wed, 5 Apr 2017 16:44:29 +0000 (12:44 -0400)]
Rollup merge of #40992 - donniebishop:utf8err_linking, r=alexcrichton

Added links to from_utf8 methods in Utf8Error

Referencing  #29375. Linked the `from_utf8` methods for both `String` and `str` in the description. Also linked the `u8` to its documentation

7 years agoRollup merge of #40988 - eugene-bulkin:ascii-docs, r=frewsxcv
Corey Farwell [Wed, 5 Apr 2017 16:44:28 +0000 (12:44 -0400)]
Rollup merge of #40988 - eugene-bulkin:ascii-docs, r=frewsxcv

API Docs: ascii

Add/update docs for the `ascii` module per #29341.

r? @steveklabnik

7 years agoRollup merge of #40981 - Technius:master, r=steveklabnik
Corey Farwell [Wed, 5 Apr 2017 16:44:27 +0000 (12:44 -0400)]
Rollup merge of #40981 - Technius:master, r=steveklabnik

Add links and some examples to std::sync::mpsc docs

Addresses part of #29377
r? @steveklabnik

I took a stab at adding links to the `std::sync::mpsc` docs, and I also wrote a few examples.

Edit: Whoops, typed in `?r` instead of `r?`.

7 years agoRollup merge of #40977 - projektir:BarrierWaitResult_doc, r=steveklabnik
Corey Farwell [Wed, 5 Apr 2017 16:44:26 +0000 (12:44 -0400)]
Rollup merge of #40977 - projektir:BarrierWaitResult_doc, r=steveklabnik

Updating the description for BarrierWaitResult #29377

Referencing `Barrier`, removing reference to `is_leader`.

7 years agoRollup merge of #40949 - stjepang:fix-vecdeque-docs, r=frewsxcv
Corey Farwell [Wed, 5 Apr 2017 16:44:25 +0000 (12:44 -0400)]
Rollup merge of #40949 - stjepang:fix-vecdeque-docs, r=frewsxcv

Improve some docs for VecDeque

r? @GuillaumeGomez

7 years agoRollup merge of #40870 - alexcrichton:stabilize-windows-subsystem, r=aturon
Corey Farwell [Wed, 5 Apr 2017 16:44:25 +0000 (12:44 -0400)]
Rollup merge of #40870 - alexcrichton:stabilize-windows-subsystem, r=aturon

rustc: Stabilize the `#![windows_subsystem]` attribute

This commit stabilizes the `#![windows_subsystem]` attribute which is a
conservative exposure of the `/SUBSYSTEM` linker flag on Widnows platforms. This
is useful for creating applications as well as console programs.

Closes #37499

7 years agoRollup merge of #40608 - GuillaumeGomez:mutex-doc-inconsistency, r=steveklabnik
Corey Farwell [Wed, 5 Apr 2017 16:44:24 +0000 (12:44 -0400)]
Rollup merge of #40608 - GuillaumeGomez:mutex-doc-inconsistency, r=steveklabnik

Fix mutex's docs inconsistency

Fixes #40176.

r? @steveklabnik
cc @rust-lang/docs

7 years agoAuto merge of #40811 - estebank:issue-32540, r=jonathandturner
bors [Wed, 5 Apr 2017 09:23:27 +0000 (09:23 +0000)]
Auto merge of #40811 - estebank:issue-32540, r=jonathandturner

Point at last valid token on failed `expect_one_of`

```rust
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `)`
  --> $DIR/token-error-correct-3.rs:29:9
   |
25 |         foo()
   |              - expected one of `.`, `;`, `?`, `}`, or an operator after this
...
29 |     } else {
   |     ^ unexpected token
```

Fix #32540.

7 years agoAuto merge of #41059 - TimNN:rollup, r=TimNN
bors [Tue, 4 Apr 2017 17:23:32 +0000 (17:23 +0000)]
Auto merge of #41059 - TimNN:rollup, r=TimNN

Rollup of 1 pull requests

- Successful merges: #40998
- Failed merges: #41045

7 years agoupdate image name for DEPLOY_ALT
Tim Neumann [Tue, 4 Apr 2017 16:14:14 +0000 (18:14 +0200)]
update image name for DEPLOY_ALT

7 years agoMerge branch 'master' into issue-32540
Esteban Küber [Tue, 4 Apr 2017 15:10:22 +0000 (08:10 -0700)]
Merge branch 'master' into issue-32540

7 years agofix rollup
Tim Neumann [Tue, 4 Apr 2017 13:46:48 +0000 (15:46 +0200)]
fix rollup

7 years agoMerge remote-tracking branch 'hub/centos5-vault' into rollup
Tim Neumann [Tue, 4 Apr 2017 13:43:07 +0000 (15:43 +0200)]
Merge remote-tracking branch 'hub/centos5-vault' into rollup

7 years agoRollup merge of #40998 - alexcrichton:split-dist, r=TimNN
Tim Neumann [Tue, 4 Apr 2017 13:41:17 +0000 (15:41 +0200)]
Rollup merge of #40998 - alexcrichton:split-dist, r=TimNN

travis: Split all dist builders in two

Previously we would use one builder on Travis to produce two sets of host
compilers for two different targets. Unfortunately though we've recently
increased how much we're building for each target so this is starting to take
unnecessarily long (#40804). This commit splits the dist builders in two by
ensuring that we only dist one target on each builder, which should take a much
shorter amount of time. This should also unblock other work such as landing the
RLS (#40584).

7 years agoFix styling issues
Bryan Tan [Mon, 3 Apr 2017 23:09:19 +0000 (16:09 -0700)]
Fix styling issues

7 years agouse fixed ip for vault.centos.org until updates have propagated to all mirrors
Tim Neumann [Mon, 3 Apr 2017 20:51:06 +0000 (22:51 +0200)]
use fixed ip for vault.centos.org until updates have propagated to all mirrors

7 years agoswitch to vault.centos.org
Tim Neumann [Mon, 3 Apr 2017 20:14:45 +0000 (22:14 +0200)]
switch to vault.centos.org

7 years agotravis: Split all dist builders in two
Alex Crichton [Sat, 1 Apr 2017 14:18:43 +0000 (07:18 -0700)]
travis: Split all dist builders in two

Previously we would use one builder on Travis to produce two sets of host
compilers for two different targets. Unfortunately though we've recently
increased how much we're building for each target so this is starting to take
unnecessarily long (#40804). This commit splits the dist builders in two by
ensuring that we only dist one target on each builder, which should take a much
shorter amount of time. This should also unblock other work such as landing the
RLS (#40584).

7 years agoFix mutex's docs inconsistency
Guillaume Gomez [Fri, 17 Mar 2017 17:32:17 +0000 (18:32 +0100)]
Fix mutex's docs inconsistency

7 years agoAuto merge of #40915 - nrc:save-assoc, r=eddyb
bors [Mon, 3 Apr 2017 03:26:09 +0000 (03:26 +0000)]
Auto merge of #40915 - nrc:save-assoc, r=eddyb

save-analysis: track associated types

r? @eddyb

7 years agoAuto merge of #40919 - GuillaumeGomez:fix-new-rustdoc, r=frewsxcv,steveklabnik
bors [Sun, 2 Apr 2017 18:16:09 +0000 (18:16 +0000)]
Auto merge of #40919 - GuillaumeGomez:fix-new-rustdoc, r=frewsxcv,steveklabnik

Add support for image, rules and footnotes

Part of #40912.

r? @rust-lang/docs

PS: the footnotes are waiting for https://github.com/google/pulldown-cmark/pull/21 to be merged to be fully working.

7 years agoImprove documentation for `std::fs::DirBuilder`
Peter Gerber [Sat, 1 Apr 2017 13:58:37 +0000 (15:58 +0200)]
Improve documentation for `std::fs::DirBuilder`

7 years agoMinor changes to core::option docs
Irfan Hudda [Sun, 2 Apr 2017 00:40:34 +0000 (06:10 +0530)]
Minor changes to core::option docs

7 years agoImprove docs of core::option::Iter
Irfan Hudda [Sat, 1 Apr 2017 16:47:48 +0000 (22:17 +0530)]
Improve docs of core::option::Iter

7 years agoImprove docs of core::option::IterMut
Irfan Hudda [Sat, 1 Apr 2017 16:39:10 +0000 (22:09 +0530)]
Improve docs of core::option::IterMut

7 years agoImprove docs of core::option::IntoIter
Irfan Hudda [Sat, 1 Apr 2017 16:28:30 +0000 (21:58 +0530)]
Improve docs of core::option::IntoIter

7 years agoAdded links to types in from_utf8 description
Donnie Bishop [Sat, 1 Apr 2017 13:56:40 +0000 (09:56 -0400)]
Added links to types in from_utf8 description

7 years agorustc: Stabilize the `#![windows_subsystem]` attribute
Alex Crichton [Mon, 20 Mar 2017 19:49:13 +0000 (12:49 -0700)]
rustc: Stabilize the `#![windows_subsystem]` attribute

This commit stabilizes the `#![windows_subsystem]` attribute which is a
conservative exposure of the `/SUBSYSTEM` linker flag on Widnows platforms. This
is useful for creating applications as well as console programs.

Closes #37499

7 years agoAdd more std::ascii module-level docs.
Eugene Bulkin [Sat, 1 Apr 2017 07:47:58 +0000 (00:47 -0700)]
Add more std::ascii module-level docs.

7 years agoClean up std::ascii sub-level docs.
Eugene Bulkin [Sat, 1 Apr 2017 07:07:55 +0000 (00:07 -0700)]
Clean up std::ascii sub-level docs.

* Change `utf8` variable names to `non_ascii` to be more clear, since
ASCII and UTF-8 are compatible.

* Fix `EscapeDefault` struct description to follow the typical iterator
method format with a link to the generating function.

* Add more `escape_default` examples to cover every case mentioned in
the function description itself.

7 years agoForce footnote references to be sorted by id
Guillaume Gomez [Sat, 1 Apr 2017 06:31:37 +0000 (00:31 -0600)]
Force footnote references to be sorted by id

7 years agoFix warnings in examples
Bryan Tan [Sat, 1 Apr 2017 06:22:59 +0000 (23:22 -0700)]
Fix warnings in examples

7 years agoAuto merge of #40967 - alexcrichton:old-osx, r=brson
bors [Sat, 1 Apr 2017 05:56:08 +0000 (05:56 +0000)]
Auto merge of #40967 - alexcrichton:old-osx, r=brson

travis: Compile OSX releases with Xcode 7

Unfortunately what we're using right now, Xcode 8.2, cannot compile LLVM for OSX
10.7. We've done this historically and Gecko would like to maintain this
compabitiliby. This commit moves our release builders for OSX to using Xcode 7
which can compile LLVM for 10.7.

The builders running tests continue to use Xcode 8.2, however, because the LLDB
version with Xcode 7, 350, is blacklisted in running our LLDB tests. To continue
running LLDB tests we'll stick with Xcode 8.2.

7 years agoAdded links to from_utf8 methods in Utf8Error
Donnie Bishop [Sat, 1 Apr 2017 03:22:22 +0000 (23:22 -0400)]
Added links to from_utf8 methods in Utf8Error

7 years agoFix broken links to std::iter::Iterator::next
Bryan Tan [Sat, 1 Apr 2017 01:51:37 +0000 (18:51 -0700)]
Fix broken links to std::iter::Iterator::next

7 years agoChange wording for push_front
Stjepan Glavina [Sat, 1 Apr 2017 00:47:37 +0000 (02:47 +0200)]
Change wording for push_front

7 years agoAdd links and examples to std::sync::mpsc docs (#29377)
Bryan Tan [Sat, 1 Apr 2017 00:05:45 +0000 (17:05 -0700)]
Add links and examples to std::sync::mpsc docs (#29377)

This change adds links to to `Receiver`, `Iter`, `TryIter`, `IntoIter`,
`Sender`, `SyncSender`, `SendError`, `RecvError`, `TryRecvError`,
`RecvTimeoutError`, `TrySendError`, `Sender::send`, `SyncSender::send`,
`SyncSender::try_send`, `Receiver::recv`, `Receiver::recv_timeout`,
`Receiver::iter`, and `Receiver::try_iter`.

Examples added to `Receiver`, `Sender`, `Receiver::iter`.

7 years agoAuto merge of #40972 - frewsxcv:rollup, r=frewsxcv
bors [Fri, 31 Mar 2017 23:23:49 +0000 (23:23 +0000)]
Auto merge of #40972 - frewsxcv:rollup, r=frewsxcv

Rollup of 6 pull requests

- Successful merges: #40703, #40728, #40763, #40871, #40935, #40947
- Failed merges:

7 years agoUpdating the description for BarrierWaitResult #29377
projektir [Fri, 31 Mar 2017 22:58:32 +0000 (18:58 -0400)]
Updating the description for BarrierWaitResult #29377

7 years agoRollup merge of #40947 - stjepang:test-sort-random-cmp, r=alexcrichton
Corey Farwell [Fri, 31 Mar 2017 20:48:29 +0000 (16:48 -0400)]
Rollup merge of #40947 - stjepang:test-sort-random-cmp, r=alexcrichton

Test sort algorithms using a random cmp function

This ensures that sorting using a broken comparison function doesn't panic nor fail in some other way (especially not segfault).

r? @alexcrichton

7 years agoRollup merge of #40935 - donniebishop:str_boilerplate_docs, r=steveklabnik
Corey Farwell [Fri, 31 Mar 2017 20:48:28 +0000 (16:48 -0400)]
Rollup merge of #40935 - donniebishop:str_boilerplate_docs, r=steveklabnik

Modify str Structs descriptions

References #29375. Modified descriptions of multiple structs to be more in line with structs found under [`std::iter`](https://doc.rust-lang.org/std/iter/#structs), such as [`Chain`](https://doc.rust-lang.org/std/iter/struct.Chain.html) and [`Enumerate`](https://doc.rust-lang.org/std/iter/struct.Enumerate.html)

7 years agoRollup merge of #40871 - projektir:atomic_links, r=steveklabnik
Corey Farwell [Fri, 31 Mar 2017 20:48:27 +0000 (16:48 -0400)]
Rollup merge of #40871 - projektir:atomic_links, r=steveklabnik

Adding links for Atomics docs #29377

r? @steveklabnik

This should be good for `std::sync::atomic`. The other pages still need more (examples, etc.).

7 years agoRollup merge of #40763 - pirate:patch-2, r=steveklabnik
Corey Farwell [Fri, 31 Mar 2017 20:48:26 +0000 (16:48 -0400)]
Rollup merge of #40763 - pirate:patch-2, r=steveklabnik

Add helpful hint in io docs about how ? is not allowed in main()

This is my effort to help alleviate the confusion caused by the error message:
```rust
error[E0277]: the trait bound `(): std::ops::Carrier` is not satisfied
  --> hello_world.rs:72:5
   |
72 |     io::stdin().read_line(&mut d_input)?;
   |     ------------------------------------
   |     |
   |     the trait `std::ops::Carrier` is not implemented for `()`
   |     in this macro invocation
   |
   = note: required by `std::ops::Carrier::from_error`

error: aborting due to previous error
```
This has been discussed at length in https://github.com/rust-lang/rust/issues/35946, but I figured it would be helpful to mention in the docs.
Reading user input is one of the first things beginners will look up in the docs, so my thinking was they'd see this warning here and not have to deal with the [tricky error message](https://blog.rust-lang.org/2017/03/02/lang-ergonomics.html).

If you think this isn't the right place to put this in the docs, that's understandable, I'm open to suggestions for putting it elsewhere or removing it entirely.

7 years agoRollup merge of #40728 - topecongiro:stabilize, r=arielb1
Corey Farwell [Fri, 31 Mar 2017 20:48:25 +0000 (16:48 -0400)]
Rollup merge of #40728 - topecongiro:stabilize, r=arielb1

Make overlapping_inherent_impls lint a hard error

Closes #36889.

7 years agoRollup merge of #40703 - GuillaumeGomez:pointer-docs, r=steveklabnik
Corey Farwell [Fri, 31 Mar 2017 20:48:24 +0000 (16:48 -0400)]
Rollup merge of #40703 - GuillaumeGomez:pointer-docs, r=steveklabnik

Add missing urls in ptr docs

r? @rust-lang/docs

7 years agotravis: Compile OSX releases with Xcode 7
Alex Crichton [Fri, 31 Mar 2017 18:04:25 +0000 (11:04 -0700)]
travis: Compile OSX releases with Xcode 7

Unfortunately what we're using right now, Xcode 8.2, cannot compile LLVM for OSX
10.7. We've done this historically and Gecko would like to maintain this
compabitiliby. This commit moves our release builders for OSX to using Xcode 7
which can compile LLVM for 10.7.

The builders running tests continue to use Xcode 8.2, however, because the LLDB
version with Xcode 7, 350, is blacklisted in running our LLDB tests. To continue
running LLDB tests we'll stick with Xcode 8.2.

7 years agoAdd end whitespace ignore flag for tidy
Guillaume Gomez [Fri, 31 Mar 2017 18:08:31 +0000 (12:08 -0600)]
Add end whitespace ignore flag for tidy

7 years agoFix hard break issue
Guillaume Gomez [Fri, 31 Mar 2017 17:02:46 +0000 (11:02 -0600)]
Fix hard break issue

7 years agoAuto merge of #40950 - frewsxcv:rollup, r=frewsxcv
bors [Fri, 31 Mar 2017 16:04:18 +0000 (16:04 +0000)]
Auto merge of #40950 - frewsxcv:rollup, r=frewsxcv

Rollup of 10 pull requests

- Successful merges: #40694, #40842, #40869, #40888, #40898, #40904, #40925, #40928, #40929, #40934
- Failed merges:

7 years agoRollup merge of #40934 - SamWhited:improve_write_writeln_docs, r=steveklabnik
Corey Farwell [Fri, 31 Mar 2017 15:43:39 +0000 (11:43 -0400)]
Rollup merge of #40934 - SamWhited:improve_write_writeln_docs, r=steveklabnik

Improve the docs for the write and writeln macros

This change reduces duplication by linking the documentation for
`writeln!` to `write!`. It also restructures the `write!` documentation
to read in a more logical manner (I hope; feedback would be welcome).

Updates #29329, #29381

7 years agoRollup merge of #40929 - bluss:full-reverse, r=alexcrichton
Corey Farwell [Fri, 31 Mar 2017 15:43:38 +0000 (11:43 -0400)]
Rollup merge of #40929 - bluss:full-reverse, r=alexcrichton

Implement all PartialOrd methods for Reverse

When making a forwarding wrapper we must in general forward all methods,
so that we use the type's own `lt` for example instead of the default.

Example important case: f32's partial_cmp does several operations but
its lt is a primitive.

Follow up on #40720

7 years agoRollup merge of #40928 - GAJaloyan:patch-2, r=eddyb
Corey Farwell [Fri, 31 Mar 2017 15:43:37 +0000 (11:43 -0400)]
Rollup merge of #40928 - GAJaloyan:patch-2, r=eddyb

adding debug in consume_body function

When in debug_assertions=true mode, the function consume_body lacks some debug output, which makes it harder to follow the control flow. This commit adds this needed debug.

7 years agoRollup merge of #40925 - DaseinPhaos:patch-5, r=steveklabnik
Corey Farwell [Fri, 31 Mar 2017 15:43:36 +0000 (11:43 -0400)]
Rollup merge of #40925 - DaseinPhaos:patch-5, r=steveklabnik

Add missing link in unstable-book

add link to specialization's tracking issue

7 years agoRollup merge of #40904 - rap2hpoutre:patch-1, r=steveklabnik
Corey Farwell [Fri, 31 Mar 2017 15:43:35 +0000 (11:43 -0400)]
Rollup merge of #40904 - rap2hpoutre:patch-1, r=steveklabnik

Add example to std::process::abort

This is a first step in order to complete this issue: https://github.com/rust-lang/rust/issues/29370
I submitted this PR with the help of @steveklabnik More info here: https://github.com/rust-lang/rust/issues/29370#issuecomment-290089330

It's my first PR on Rust, I'm learning how to contribute: Should I ping someone? I will post another PR with a more complicated example soon, I prefer send it separately (cause maybe I made some mistakes).

7 years agoRollup merge of #40898 - MaloJaffre:remove-unused-feature, r=alexcrichton
Corey Farwell [Fri, 31 Mar 2017 15:43:34 +0000 (11:43 -0400)]
Rollup merge of #40898 - MaloJaffre:remove-unused-feature, r=alexcrichton

Remove unused feature from error index generator

Remove feature `rustdoc`.

7 years agoRollup merge of #40888 - wesleywiser:rustdoc_src_sidebar, r=GuillaumeGomez
Corey Farwell [Fri, 31 Mar 2017 15:43:33 +0000 (11:43 -0400)]
Rollup merge of #40888 - wesleywiser:rustdoc_src_sidebar, r=GuillaumeGomez

Make the rustdoc sidebar white on `src` pages

Fixes #40724

7 years agoRollup merge of #40869 - ctjhoa:master, r=steveklabnik
Corey Farwell [Fri, 31 Mar 2017 15:43:32 +0000 (11:43 -0400)]
Rollup merge of #40869 - ctjhoa:master, r=steveklabnik

Improve os::linux documentation (#29367)

Improve `os::linux` documentation according to #29367

r? @steveklabnik

7 years agoRollup merge of #40842 - Mic92:RawFd, r=aturon
Corey Farwell [Fri, 31 Mar 2017 15:43:31 +0000 (11:43 -0400)]
Rollup merge of #40842 - Mic92:RawFd, r=aturon

Implement AsRawFd/IntoRawFd for RawFd

This is useful to build os abstraction like the nix crate does.
It allows to define functions, which accepts generic arguments
of data structures convertible to RawFd, including RawFd itself.
For example:

```
fn write<FD: AsRawFd>(fd: FD, buf: &[u8]) -> Result<usize>
write(file, buf);
```
instead of:
```
fn write(fd: RawFd, buf: &[u8]) -> Result<usize>
write(file.as_raw_fd(), buf);
```

cc @kamalmarhubi

7 years agoRollup merge of #40694 - frewsxcv:unstable-book-checker, r=steveklabnik
Corey Farwell [Fri, 31 Mar 2017 15:43:30 +0000 (11:43 -0400)]
Rollup merge of #40694 - frewsxcv:unstable-book-checker, r=steveklabnik

Sync all unstable features with Unstable Book; add tidy lint.

Add a tidy lint that checks for...

* Unstable Book sections with no corresponding SUMMARY.md links
* unstable features that don't have Unstable Book sections
* Unstable Book sections that don't have corresponding unstable features

7 years agoSync all unstable features with Unstable Book; add tidy lint.
Corey Farwell [Sun, 19 Mar 2017 14:45:05 +0000 (10:45 -0400)]
Sync all unstable features with Unstable Book; add tidy lint.

Add a tidy lint that checks for...

* Unstable Book sections with no corresponding SUMMARY.md links
* unstable features that don't have Unstable Book sections
* Unstable Book sections that don't have corresponding unstable features

7 years agoImprove some docs for VecDeque
Stjepan Glavina [Fri, 31 Mar 2017 15:12:47 +0000 (17:12 +0200)]
Improve some docs for VecDeque

7 years agoTest sort algorithms using a random cmp function
Stjepan Glavina [Fri, 31 Mar 2017 14:59:01 +0000 (16:59 +0200)]
Test sort algorithms using a random cmp function

7 years agoAuto merge of #40737 - nagisa:safe-slicing-strs, r=BurntSushi
bors [Fri, 31 Mar 2017 11:13:20 +0000 (11:13 +0000)]
Auto merge of #40737 - nagisa:safe-slicing-strs, r=BurntSushi

Checked slicing for strings

cc https://github.com/rust-lang/rust/issues/39932

7 years agoAdd links to std::sync::mpsc docs #29377
Bryan Tan [Fri, 31 Mar 2017 06:27:09 +0000 (23:27 -0700)]
Add links to std::sync::mpsc docs #29377

7 years agoAuto merge of #40620 - laumann:slash-in-diagnostics-path, r=BurntSushi
bors [Fri, 31 Mar 2017 03:22:39 +0000 (03:22 +0000)]
Auto merge of #40620 - laumann:slash-in-diagnostics-path, r=BurntSushi

Replace hardcoded forward slash with path::MAIN_SEPARATOR

Fixes #40149

7 years agoFix multiple footnotes and improve testing
Guillaume Gomez [Thu, 30 Mar 2017 23:29:54 +0000 (17:29 -0600)]
Fix multiple footnotes and improve testing

7 years agoRemove parentheses in method references
Donnie Bishop [Thu, 30 Mar 2017 22:33:23 +0000 (18:33 -0400)]
Remove parentheses in method references

7 years agoRevert SplitWhitespace's description
Donnie Bishop [Thu, 30 Mar 2017 20:46:16 +0000 (16:46 -0400)]
Revert SplitWhitespace's description

Original headline of SplitWhitespace's description is more descriptive as to what it contains and iterates over.

7 years agoModify SplitWhitespace's description
Donnie Bishop [Thu, 30 Mar 2017 20:36:06 +0000 (16:36 -0400)]
Modify SplitWhitespace's description

7 years agoModify EncodeUtf16's description
Donnie Bishop [Thu, 30 Mar 2017 20:35:19 +0000 (16:35 -0400)]
Modify EncodeUtf16's description

7 years agoModify Chars' description
Donnie Bishop [Thu, 30 Mar 2017 19:51:49 +0000 (15:51 -0400)]
Modify Chars' description

7 years agoModify CharIndices' description
Donnie Bishop [Thu, 30 Mar 2017 19:46:41 +0000 (15:46 -0400)]
Modify CharIndices' description

7 years agoImprove the docs for the write and writeln macros
Sam Whited [Thu, 30 Mar 2017 18:23:35 +0000 (13:23 -0500)]
Improve the docs for the write and writeln macros

This change reduces duplication by linking the documentation for
`writeln!` to `write!`. It also restructures the `write!` documentation
to read in a more logical manner.

Updates #29329, #29381

7 years agoModify Bytes' description
Donnie Bishop [Thu, 30 Mar 2017 19:40:05 +0000 (15:40 -0400)]
Modify Bytes' description

7 years agoModify Lines' description
Donnie Bishop [Thu, 30 Mar 2017 19:36:50 +0000 (15:36 -0400)]
Modify Lines' description

7 years agoAuto merge of #40524 - alexcrichton:update-bootstrap, r=alexcrichton
bors [Thu, 30 Mar 2017 17:10:11 +0000 (17:10 +0000)]
Auto merge of #40524 - alexcrichton:update-bootstrap, r=alexcrichton

rustbuild: Update bootstrap compiler

Now that we've also updated cargo's release process this commit also changes the
download location of Cargo from Cargos archives back to the static.r-l.o
archives. This should ensure that the Cargo download is the exact Cargo paired
with the rustc that we release.

7 years agocmp: Implement all PartialOrd methods for Reverse
Ulrik Sverdrup [Thu, 30 Mar 2017 15:25:36 +0000 (17:25 +0200)]
cmp: Implement all PartialOrd methods for Reverse

When making a forwarding wrapper we must in general forward all methods,
so that we use the type's own `lt` for example instead of the default.

Example important case: f32's partial_cmp does several operations but
its lt is a primitive.

7 years agoremoving trailing whitespaces
GAJaloyan [Thu, 30 Mar 2017 15:02:51 +0000 (17:02 +0200)]
removing trailing whitespaces

7 years agoadding debug in consume_body function
GAJaloyan [Thu, 30 Mar 2017 14:31:16 +0000 (16:31 +0200)]
adding debug in consume_body function

When in debug_assertions=true mode, the function consume_body lacks some debug output, which makes it harder to follow the control flow. This commit adds this needed debug.

7 years agoAuto merge of #40224 - nikomatsakis:issue-39808, r=eddyb
bors [Thu, 30 Mar 2017 14:20:20 +0000 (14:20 +0000)]
Auto merge of #40224 - nikomatsakis:issue-39808, r=eddyb

change the strategy for diverging types

The new strategy is as follows. First, the `!` type is assigned
in two cases:

- a block with a diverging statement and no tail expression (e.g.,
  `{return;}`);
- any expression with the type `!` is considered diverging.

Second, we track when we are in a diverging state, and we permit a value
of any type to be coerced **into** `!` if the expression that produced
it is diverging. This means that `fn foo() -> ! { panic!(); 22 }`
type-checks, even though the block has a type of `usize`.

Finally, coercions **from** the `!` type to any other are always
permitted.

Fixes #39808.
Fixes #39984.

7 years agoAdd missing link in unstable-book
Luxko [Thu, 30 Mar 2017 12:36:07 +0000 (20:36 +0800)]
Add missing link in unstable-book

add link to specialization's tracking issue

7 years agoremove comments that were tripping up pretty printer
Niko Matsakis [Mon, 27 Mar 2017 23:48:55 +0000 (19:48 -0400)]
remove comments that were tripping up pretty printer

7 years agofix error message for issue-10176.rs
Niko Matsakis [Sun, 26 Mar 2017 11:02:39 +0000 (07:02 -0400)]
fix error message for issue-10176.rs

7 years agoupdate UI test
Niko Matsakis [Sat, 25 Mar 2017 09:30:39 +0000 (05:30 -0400)]
update UI test

We no longer give suggestions; this is presumably related to the changes
I made in coercion. However, those suggestions appear to be wrong
anyhow!

7 years agokill the graphviz-flowgraph tests
Niko Matsakis [Fri, 24 Mar 2017 22:47:58 +0000 (18:47 -0400)]
kill the graphviz-flowgraph tests

They are so annoying to update, and haven't caught any bugs afaik.

7 years agodocument `diverges` more correctly
Niko Matsakis [Fri, 24 Mar 2017 17:36:01 +0000 (13:36 -0400)]
document `diverges` more correctly

7 years agofix `X as !` behavior
Niko Matsakis [Fri, 24 Mar 2017 17:35:49 +0000 (13:35 -0400)]
fix `X as !` behavior

7 years agoadd test illustrating current "coerce to `!`" behavior
Niko Matsakis [Fri, 24 Mar 2017 17:21:50 +0000 (13:21 -0400)]
add test illustrating current "coerce to `!`" behavior

7 years agohave coercion supply back the target type
Niko Matsakis [Thu, 23 Mar 2017 01:07:02 +0000 (21:07 -0400)]
have coercion supply back the target type

The `try_coerce` method coerces from a source to a target
type, possibly inserting adjustments. It should guarantee
that the post-adjustment type is a subtype of the target type
(or else that some side-constraint has been registered which will lead
to an error). However, it used to return the (possibly adjusted) source
as the type of the expression rather than the target. This led to
less good downstream errors.

To work around this, the code around blocks -- and particular tail
expressions in blocks -- had some special case manipulation. However,
since that code is now using the more general `CoerceMany` construct (to
account for breaks), it can no longer take advantage of that. This lead
to some regressions in compile-fail tests were errors were reported at
"less good" locations than before.

This change modifies coercions to return the target type when successful
rather the source type. This extends the behavior from blocks to all
coercions. Typically this has limited effect but on a few tests yielded
better errors results (and avoided regressions, of course).

This change also restores the hint about removing semicolons which went
missing (by giving 'force-unit' coercions a chance to add notes etc).

7 years agoremove `Clone` from `FnCtxt`
Niko Matsakis [Wed, 22 Mar 2017 01:21:24 +0000 (21:21 -0400)]
remove `Clone` from `FnCtxt`

7 years agorename `only_has_type_or_fresh_var` to `coercion_target_type`
Niko Matsakis [Fri, 24 Mar 2017 15:51:02 +0000 (11:51 -0400)]
rename `only_has_type_or_fresh_var` to `coercion_target_type`

7 years agofix handling of blocks with `CoerceMany`
Niko Matsakis [Fri, 24 Mar 2017 15:50:36 +0000 (11:50 -0400)]
fix handling of blocks with `CoerceMany`

7 years agocoercion now depends on whether the expression diverges
Niko Matsakis [Fri, 24 Mar 2017 15:48:44 +0000 (11:48 -0400)]
coercion now depends on whether the expression diverges

Before I was checking this in `demand_coerce` but that's not really the
right place. The right place is to move that into the coercion routine
itself.

7 years agoavoid allocating a vector when the coercion sites are known upfront
Niko Matsakis [Tue, 21 Mar 2017 19:37:57 +0000 (15:37 -0400)]
avoid allocating a vector when the coercion sites are known upfront

7 years agocherry-pick over the tests I wrote for the reachability code
Niko Matsakis [Tue, 21 Mar 2017 13:41:41 +0000 (09:41 -0400)]
cherry-pick over the tests I wrote for the reachability code

For the most part, the current code performs similarly, although it
differs in some particulars. I'll be nice to have these tests for
judging future changes, as well.

7 years agopacify the mercilous tidy
Niko Matsakis [Tue, 21 Mar 2017 13:19:49 +0000 (09:19 -0400)]
pacify the mercilous tidy

7 years agoadd regression test for #39808
Niko Matsakis [Sat, 18 Mar 2017 19:22:48 +0000 (15:22 -0400)]
add regression test for #39808

Fixes #39808