]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #41035 - jmesmon:revert-bad-raw-fd-impls, r=aturon
Corey Farwell [Wed, 5 Apr 2017 16:44:35 +0000 (12:44 -0400)]
Rollup merge of #41035 - jmesmon:revert-bad-raw-fd-impls, r=aturon

Revert "Implement AsRawFd/IntoRawFd for RawFd"

This reverts commit 2cf686f2cdd6446a3cd47df0305ead40fabe85df (#40842)

RawFd is a type alias for c_int, which is itself a type alias for i32.
As a result, adding AsRawFd and IntoRawFd impls for RawFd actually adds
them for i32.

As a result, the reverted commit makes this valid:

```
use std::os::unix::io::AsRawFd;

fn arf<T: AsRawFd>(_: T) {}

fn main() {
    arf(32i32)
}
```

Implimenting AsRawFd and IntoRawFd for i32 breaks the promises of both
those traits that their methods return a valid RawFd.

r? @aturon
cc @Mic92 @kamalmarhubi

7 years agoRollup merge of #41019 - mandeep:fix-vec-swapremove-docs, r=BurntSushi
Corey Farwell [Wed, 5 Apr 2017 16:44:33 +0000 (12:44 -0400)]
Rollup merge of #41019 - mandeep:fix-vec-swapremove-docs, r=BurntSushi

Fixed typo in doc comments for swap_remove

While reading the Vec docs, I came across the docs for swap_remove. I believe there is a typo in the comment and ```return``` should be ```returns```. This PR fixes this issue.

I also feel that the entire doc comment is a bit of a run-on and could be changed to something along the lines of ```Removes an element from anywhere in the vector and returns it. The vector is mutated and the removed element is replaced by the last element of the vector. ```

Thoughts?

7 years agoRollup merge of #41014 - SimonSapin:patch-6, r=frewsxcv
Corey Farwell [Wed, 5 Apr 2017 16:44:33 +0000 (12:44 -0400)]
Rollup merge of #41014 - SimonSapin:patch-6, r=frewsxcv

std::thread docs: fix link to current()

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 agoReduce a table used for `Debug` impl of `str`.
Kang Seonghoon [Tue, 21 Mar 2017 18:27:06 +0000 (03:27 +0900)]
Reduce a table used for `Debug` impl of `str`.

This commit shrinks the size of the aforementioned table from
2,102 bytes to 1,197 bytes. This is achieved by an observation that
most u16 entries are common in its upper byte. Specifically:

- SINGLETONS now uses two tables, one for (upper byte, lower count)
  and another for a series of lower bytes. For each upper byte given
  number of lower bytes are read and compared.

- NORMAL now uses a variable length format for the count of "true"
  codepoints and "false" codepoints (one byte with MSB unset, or
  two big-endian bytes with the first MSB set).

The code size and relative performance roughly remains same as this
commit tries to optimize for both. The new table and algorithm has
been verified for the equivalence to older ones.

7 years agoProperly adjust filenames when multiple emissions
Simonas Kazlauskas [Wed, 5 Apr 2017 15:59:16 +0000 (18:59 +0300)]
Properly adjust filenames when multiple emissions

Fixes #40993

7 years agotidy clean and small text fix
steveklabnik [Wed, 5 Apr 2017 15:58:53 +0000 (11:58 -0400)]
tidy clean and small text fix

7 years agostyle: space between struct name and opening brace
QuietMisdreavus [Wed, 5 Apr 2017 15:02:37 +0000 (10:02 -0500)]
style: space between struct name and opening brace

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 agodist-powerpc-linux: use a pure 32-bit CPU profile
Josh Stone [Wed, 5 Apr 2017 07:41:08 +0000 (00:41 -0700)]
dist-powerpc-linux: use a pure 32-bit CPU profile

With `-mcpu=power4`, code might use instructions like `fcfid`, excluding
older CPUs like the PowerPC G4, which apparently some users would like
to use.  The generic `-mcpu=powerpc` should stick to pure 32-bit PowerPC
instructions.

Fixes rust-lang/cargo#3852.

7 years agoAdd tracking issue for offset_to
Amanieu d'Antras [Wed, 5 Apr 2017 06:45:44 +0000 (07:45 +0100)]
Add tracking issue for offset_to

7 years agoFixes other targets rustlibs installation
GitLab [Mon, 13 Mar 2017 17:44:54 +0000 (14:44 -0300)]
Fixes other targets rustlibs installation

When the user select more than one target to generate rustlibs for, rustbuild will only install the host one.

This patch fixes it, more info in https://github.com/rust-lang/rust/issues/39235#issuecomment-285878858

7 years agotravis: Update sccache binaries
Alex Crichton [Tue, 4 Apr 2017 22:55:23 +0000 (15:55 -0700)]
travis: Update sccache binaries

I've tracked down what I believe is the last spurious sccache failure on #40240
to behavior in mio (carllerche/mio#583), and this commit updates the binaries to
a version which has that fix incorporated.

7 years agoEnable appveyor cache, add more paranoia
Aidan Hobson Sayers [Tue, 4 Apr 2017 21:51:16 +0000 (22:51 +0100)]
Enable appveyor cache, add more paranoia

7 years agoSimplify HashMap Bucket interface
arthurprs [Wed, 15 Mar 2017 22:26:27 +0000 (23:26 +0100)]
Simplify HashMap Bucket interface

* Store capacity_mask instead of capacity
* Move bucket index into RawBucket
* Bucket index is now always within [0..table_capacity)
* Clone RawTable using RawBucket
* Simplify iterators by moving logic into RawBuckets
* Make retain aware of the number of elements

7 years agoChange docs to follow review requests
Michael Gattozzi [Tue, 4 Apr 2017 20:23:52 +0000 (16:23 -0400)]
Change docs to follow review requests

7 years agoBranch arms need to match the return value even if it's not being assigned to anything
Nathan Stocks [Tue, 4 Apr 2017 19:50:24 +0000 (13:50 -0600)]
Branch arms need to match the return value even if it's not being assigned to anything

7 years agoFix links
steveklabnik [Tue, 4 Apr 2017 19:39:44 +0000 (15:39 -0400)]
Fix links

part of https://github.com/rust-lang/rust/issues/40912

[]\n() is not actually a link.

7 years agosimplify implementation of [T]::splitn and friends #41020
Jason Orendorff [Mon, 3 Apr 2017 20:27:42 +0000 (15:27 -0500)]
simplify implementation of [T]::splitn and friends #41020

7 years agoadd [T]::rsplit() and rsplit_mut() #41020
Jason Orendorff [Mon, 3 Apr 2017 20:25:30 +0000 (15:25 -0500)]
add [T]::rsplit() and rsplit_mut() #41020

7 years agostd: Use `poll` instead of `select`
Alex Crichton [Mon, 3 Apr 2017 18:41:45 +0000 (11:41 -0700)]
std: Use `poll` instead of `select`

This gives us the benefit of supporting file descriptors over the limit that
select supports, which...

Closes #40894

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 agorustdoc: don't add a space before `{` on traits with where clauses
QuietMisdreavus [Tue, 4 Apr 2017 16:16:16 +0000 (11:16 -0500)]
rustdoc: don't add a space before `{` on traits with where clauses

cc #41025

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 agopush `borrowck` into its own task
Niko Matsakis [Tue, 4 Apr 2017 16:06:35 +0000 (12:06 -0400)]
push `borrowck` into its own task

7 years agokill `Liveness`
Niko Matsakis [Tue, 4 Apr 2017 15:28:48 +0000 (11:28 -0400)]
kill `Liveness`

7 years agoDo not recommend private fields called as method
Esteban Küber [Tue, 4 Apr 2017 15:58:27 +0000 (08:58 -0700)]
Do not recommend private fields called as method

7 years agorustdoc: properly indent fn signatures in traits
QuietMisdreavus [Tue, 4 Apr 2017 15:31:57 +0000 (10:31 -0500)]
rustdoc: properly indent fn signatures in traits

7 years agoremove `EffectCheck`
Niko Matsakis [Tue, 4 Apr 2017 15:19:36 +0000 (11:19 -0400)]
remove `EffectCheck`

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 agocstore: return an immutable borrow from `visible_parent_map`
Ariel Ben-Yehuda [Tue, 4 Apr 2017 15:11:03 +0000 (18:11 +0300)]
cstore: return an immutable borrow from `visible_parent_map`

Fixes #41053.

7 years agokill `CheckStaticRecursion`
Niko Matsakis [Tue, 4 Apr 2017 15:09:12 +0000 (11:09 -0400)]
kill `CheckStaticRecursion`

7 years agokill the `CheckLoops` DepNode
Niko Matsakis [Tue, 4 Apr 2017 15:08:52 +0000 (11:08 -0400)]
kill the `CheckLoops` DepNode

7 years agoOn-demandify reachability
Taylor Cramer [Mon, 27 Mar 2017 22:55:56 +0000 (15:55 -0700)]
On-demandify reachability

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 agoMove 'coherence-overlapping-inherent-impl-trait' test to ui
topecongiro [Tue, 4 Apr 2017 12:08:56 +0000 (21:08 +0900)]
Move 'coherence-overlapping-inherent-impl-trait' test to ui

7 years agoMove 'overlapping_inherent_impls' test to ui
topecongiro [Tue, 4 Apr 2017 12:00:56 +0000 (21:00 +0900)]
Move 'overlapping_inherent_impls' test to ui

7 years agoReplace magic number with readable sig constant
Anatol Pomozov [Tue, 4 Apr 2017 05:41:55 +0000 (22:41 -0700)]
Replace magic number with readable sig constant

SIG_ERR is defined as 'pub const SIG_ERR: sighandler_t = !0 as sighandler_t;'

7 years agoFixed ICEs with pattern matching in const fn. Fixes #38199, fixes #31577, fixes ...
Ryan Scott [Tue, 28 Mar 2017 07:16:23 +0000 (16:16 +0900)]
Fixed ICEs with pattern matching in const fn. Fixes #38199, fixes #31577, fixes #29093, and fixes #40012.

7 years agorebased
Nick Cameron [Wed, 15 Mar 2017 21:43:11 +0000 (10:43 +1300)]
rebased

7 years agosave-analysis: index extern blocks
Nick Cameron [Wed, 8 Mar 2017 05:04:30 +0000 (18:04 +1300)]
save-analysis: index extern blocks

7 years agosave-analysis: only index path references once
Nick Cameron [Wed, 8 Mar 2017 03:30:31 +0000 (16:30 +1300)]
save-analysis: only index path references once

7 years agoMake 'overlapping_inherent_impls' lint a hard error
topecongiro [Tue, 4 Apr 2017 01:43:16 +0000 (10:43 +0900)]
Make 'overlapping_inherent_impls' lint a hard error

7 years agoHandle options-with-arguments before subcommands such as './x.py -j 10 build' and...
Nathan Stocks [Tue, 4 Apr 2017 01:15:31 +0000 (19:15 -0600)]
Handle options-with-arguments before subcommands such as './x.py -j 10 build' and detect pathological cases like './x.py --option-that-takes-argument clean build'

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

7 years agoFix bug parsing `#[derive]` macro invocations.
Jeffrey Seyfried [Mon, 3 Apr 2017 22:23:32 +0000 (22:23 +0000)]
Fix bug parsing `#[derive]` macro invocations.

7 years agoLoosen src_is_git to just check exists()
Josh Stone [Mon, 3 Apr 2017 22:28:06 +0000 (15:28 -0700)]
Loosen src_is_git to just check exists()

7 years agoHandle ordered lists as well
Guillaume Gomez [Mon, 3 Apr 2017 22:24:08 +0000 (00:24 +0200)]
Handle ordered lists as well

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 agoRemoved trailing whitespace on line 682
mandeep [Mon, 3 Apr 2017 20:48:12 +0000 (15:48 -0500)]
Removed trailing whitespace on line 682

7 years agoOnly use cargo-vendor if building from git sources
Josh Stone [Mon, 3 Apr 2017 20:46:53 +0000 (13:46 -0700)]
Only use cargo-vendor if building from git sources

7 years agoAdd a common Build::src_is_git flag
Josh Stone [Mon, 3 Apr 2017 20:46:50 +0000 (13:46 -0700)]
Add a common Build::src_is_git flag

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 agoReplace ^ with <sup> html balise
Guillaume Gomez [Mon, 3 Apr 2017 19:17:47 +0000 (21:17 +0200)]
Replace ^ with <sup> html balise

7 years agoMove libXtest into libX/tests
Stjepan Glavina [Mon, 3 Apr 2017 14:53:04 +0000 (16:53 +0200)]
Move libXtest into libX/tests

This change moves:

1. `libcoretest` into `libcore/tests`
2. `libcollectionstest` into `libcollections/tests`

This is a follow-up to #39561.

7 years agoSort enum suggestions
Esteban Küber [Mon, 3 Apr 2017 14:46:35 +0000 (07:46 -0700)]
Sort enum suggestions

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 agoRefactored swap_remove doc comment upon discussing with BurntSushi and steveklabnik
mandeep [Mon, 3 Apr 2017 14:51:34 +0000 (09:51 -0500)]
Refactored swap_remove doc comment upon discussing with BurntSushi and steveklabnik

7 years agoRevert "Implement AsRawFd/IntoRawFd for RawFd"
Cody P Schafer [Mon, 3 Apr 2017 14:14:10 +0000 (10:14 -0400)]
Revert "Implement AsRawFd/IntoRawFd for RawFd"

This reverts commit 2cf686f2cdd6446a3cd47df0305ead40fabe85df (#40842)

RawFd is a type alias for c_int, which is itself a type alias for i32.
As a result, adding AsRawFd and IntoRawFd impls for RawFd actually adds
them for i32.

As a result, the reverted commit makes this valid:

```
use std::os::unix::io::AsRawFd;

fn arf<T: AsRawFd>(_: T) {}

fn main() {
    arf(32i32)
}
```

Implimenting AsRawFd and IntoRawFd for i32 breaks the promises of both
those traits that their methods return a valid RawFd.

r? @aturon
cc @Mic92 @kamalmarhubi

7 years agoMerge branch 'master' into issue-40006
Esteban Küber [Mon, 3 Apr 2017 11:58:48 +0000 (04:58 -0700)]
Merge branch 'master' into issue-40006

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 agoAdd ptr::offset_to
Amanieu d'Antras [Fri, 31 Mar 2017 12:52:46 +0000 (13:52 +0100)]
Add ptr::offset_to

7 years agoiter: Simplification in rfind's provided implementation
Ulrik Sverdrup [Mon, 3 Apr 2017 00:03:12 +0000 (02:03 +0200)]
iter: Simplification in rfind's provided implementation

- Prefer simpler constructs instead of going through &mut I's Iterator
  implementation.

7 years agoiter: Use underlying find/rfind for the same methods in Rev
Ulrik Sverdrup [Mon, 3 Apr 2017 00:03:12 +0000 (02:03 +0200)]
iter: Use underlying find/rfind for the same methods in Rev

7 years agoHandle symlinks in src/bootstrap/clean.rs (mostly) -- resolves #40860.
Nathan Stocks [Sun, 2 Apr 2017 22:26:43 +0000 (16:26 -0600)]
Handle symlinks in src/bootstrap/clean.rs (mostly) -- resolves #40860.

The broken condition can be replicated with:

``shell
export MYARCH=x86_64-apple-darwin && mkdir -p build/$MYARCH/subdir &&
touch build/$MYARCH/subdir/file && ln -s build/$MYARCH/subdir/file
build/$MYARCH/subdir/symlink
``

`src/bootstrap/clean.rs` has a custom implementation of removing a tree
`fn rm_rf` that used `std::path::Path::{is_file, is_dir, exists}` while
recursively deleting directories and files.  Unfortunately, `Path`'s
implementation of `is_file()` and `is_dir()` and `exists()` always
unconditionally follow symlinks, which is the exact opposite of standard
implementations of deleting file trees.

It appears that this custom implementation is being used to workaround a
behavior in Windows where the files often get marked as read-only, which
prevents us from simply using something nice and simple like
`std::fs::remove_dir_all`, which properly deletes links instead of
following them.

So it looks like the fix is to use `.symlink_metadata()` to figure out
whether tree items are files/symlinks/directories.  The one corner case
this won't cover is if there is a broken symlink in the "root"
`build/$MYARCH` directory, because those initial entries are run through
`Path::canonicalize()`, which panics with broken symlinks.  So lets just
never use symlinks in that one directory. :-)

7 years agoFix breaking the 'clean' subcommand caused replacing a single-letter variable with...
Nathan Stocks [Sun, 2 Apr 2017 19:11:53 +0000 (13:11 -0600)]
Fix breaking the 'clean' subcommand caused replacing a single-letter variable with the same value in two contexts where it was used differently.  That's why you don't use "m" as a variable for hundreds of lines in an outer function, and re-use it in closures several times in the same function.  Sheesh.

7 years agoSimplify a "use" statement as per @grunweg's feedback.
Nathan Stocks [Sun, 2 Apr 2017 16:28:36 +0000 (10:28 -0600)]
Simplify a "use" statement as per @grunweg's feedback.

7 years agoOops, we can't parse options until all options have been defined. Tiny bit of manual...
Nathan Stocks [Sun, 2 Apr 2017 05:16:46 +0000 (23:16 -0600)]
Oops, we can't parse options until all options have been defined.  Tiny bit of manual arg-parsing.  Fixed tidy stuff too.

7 years agoFinish the improvements I planned.
Nathan Stocks [Sat, 1 Apr 2017 21:48:03 +0000 (15:48 -0600)]
Finish the improvements I planned.

- No more manual args manipulation -- getopts used for everything.
  As a result, options can be in any position, now, even before the
  subcommand.
- The additional options for test, bench, and dist now appear in the
  help output.
- No more single-letter variable bindings used internally for large
  scopes.
- Don't output the time measurement when just invoking 'x.py'
- Logic is now much more linear.  We build strings up, and then print
  them.

7 years agoSave my TODO's as comments, so I don't forget.
Nathan Stocks [Fri, 31 Mar 2017 04:35:55 +0000 (22:35 -0600)]
Save my TODO's as comments, so I don't forget.

7 years agoUsing an untyped, one-letter variable binding as an argument to a function and then...
Nathan Stocks [Fri, 31 Mar 2017 04:20:51 +0000 (22:20 -0600)]
Using an untyped, one-letter variable binding as an argument to a function and then not using it until over 100 lines later is just mean.

7 years agoVastly improve the help output.
Nathan Stocks [Fri, 31 Mar 2017 04:18:27 +0000 (22:18 -0600)]
Vastly improve the help output.

- Don't print 'unknown subcommand' at the top of the help message.  The help message now clearly instructs the user to provide a subcommand.
- Clarify the usage line.  Subcommand is required.  Don't echo invalid input back out in the usage line (what the...???).  args renamed to paths, because that's what all the args are referred to elsewhere.
- List the available subcommands immediately following the usage line.  It's the one required argument, after all.
- Slightly improve the extra documentation for the build, test, and doc commands.
- Don't print 'Available invocations:' at all.  It occurred immediately before 'Available paths:'.
- Clearly state that running with '-h -v' will produce a list of available paths.

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 agoIntroduce `TyErr` independent from `TyInfer`
Esteban Küber [Wed, 29 Mar 2017 01:56:29 +0000 (18:56 -0700)]
Introduce `TyErr` independent from `TyInfer`

Add a `TyErr` type to represent unknown types in places where
parse errors have happened, while still able to build the AST.

Initially only used to represent incorrectly written fn arguments and
avoid "expected X parameters, found Y" errors when called with the
appropriate amount of parameters. We cannot use `TyInfer` for this as
`_` is not allowed as a valid argument type.

Example output:

```rust
error: expected one of `:` or `@`, found `,`
  --> file.rs:12:9
   |
12 | fn bar(x, y: usize) {}
   |         ^

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> file.rs:19:9
   |
12 | fn bar(x, y) {}
   | --------------- defined here
...
19 |     bar(1, 2, 3);
   |         ^^^^^^^ expected 2 parameters
```

7 years agoSuggest using enum when a variant is used as a type
Esteban Küber [Thu, 23 Mar 2017 22:14:45 +0000 (15:14 -0700)]
Suggest using enum when a variant is used as a type

Given a file:

```rust
enum Fruit {
    Apple(i64),
    Orange(i64),
}

fn should_return_fruit() -> Apple {
    Apple(5)
}
```

Provide the following output:

```rust
error[E0412]: cannot find type `Apple` in this scope
  --> file.rs:16:29
   |
16 | fn should_return_fruit() -> Apple {
   |                             ^^^^^ not found in this scope
   |
help: there is an enum variant `Fruit::Apple`, did you mean to use `Fruit`?
  --> file.rs:12:5
   |
12 |     Apple(i64),
   |     ^^^^^^^^^^

error[E0425]: cannot find function `Apple` in this scope
  --> file.rs:17:5
   |
17 |     Apple(5)
   |     ^^^^^ not found in this scope
   |
   = help: possible candidate is found in another module, you can import it into scope:
             `use Fruit::Apple;`
```

7 years agoFixed typo in doc comments for swap_remove
mandeep [Sun, 2 Apr 2017 16:21:05 +0000 (11:21 -0500)]
Fixed typo in doc comments for swap_remove

7 years agomark build::cfg::start_new_block as inline(never)
Ariel Ben-Yehuda [Sun, 2 Apr 2017 13:18:39 +0000 (16:18 +0300)]
mark build::cfg::start_new_block as inline(never)

LLVM has a bug - PR32488 - where it fails to deduplicate allocas in some
circumstances. The function `start_new_block` has allocas totalling 1216
bytes, and when LLVM inlines several copies of that function into
the recursive function `expr::into`, that function's stack space usage
goes into tens of kiBs, causing stack overflows.

Mark `start_new_block` as inline(never) to keep it from being inlined,
getting stack usage under control.

Fixes #40493.
Fixes #40573.

7 years agostd::thread docs: fix link to current()
Simon Sapin [Sun, 2 Apr 2017 10:03:54 +0000 (12:03 +0200)]
std::thread docs: fix link to current()

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 agoDon't panic if we have tidy errors.
Corey Farwell [Sun, 19 Mar 2017 15:22:48 +0000 (11:22 -0400)]
Don't panic if we have tidy errors.

Otherwise we get the standard Rust panic message alongside "some tidy
checks failed" which seems unnecessary.

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 agoUpdate cargo submodule
Alex Crichton [Sat, 1 Apr 2017 13:58:11 +0000 (06:58 -0700)]
Update cargo submodule

Pulls in a fix for rust-lang/rust#40956

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.