]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agochange the format of the linked issue number
Jorge Aparicio [Fri, 7 Apr 2017 14:46:55 +0000 (09:46 -0500)]
change the format of the linked issue number

7 years agodocument some existing unstable features
Jorge Aparicio [Fri, 7 Apr 2017 06:05:03 +0000 (01:05 -0500)]
document some existing unstable features

"msp430-interrupt", "ptx-kernel" and #![compiler_builtins_lib]

7 years agoAuto merge of #40863 - eddyb:coerce-only-once, r=arielb1
bors [Thu, 6 Apr 2017 20:15:17 +0000 (20:15 +0000)]
Auto merge of #40863 - eddyb:coerce-only-once, r=arielb1

Avoid type-checking addition and indexing twice.

Fixes #40610 by moving the common `check_expr_coercable_to_type` call before the error reporting logic for binops and removing the one from `check_str_addition`.
Fixes #40861 by removing an unnecessary `check_expr_coercable_to_type` call.

7 years agoAvoid type-checking addition and indexing twice.
Eduard-Mihai Burtescu [Mon, 27 Mar 2017 18:52:51 +0000 (21:52 +0300)]
Avoid type-checking addition and indexing twice.

7 years agoAuto merge of #41039 - alexcrichton:process-poll, r=nagisa
bors [Thu, 6 Apr 2017 11:21:55 +0000 (11:21 +0000)]
Auto merge of #41039 - alexcrichton:process-poll, r=nagisa

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 #40996 - alexcrichton:update-cargo, r=alexcrichton
bors [Thu, 6 Apr 2017 08:53:36 +0000 (08:53 +0000)]
Auto merge of #40996 - alexcrichton:update-cargo, r=alexcrichton

Update cargo submodule

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

7 years agoAuto merge of #41102 - frewsxcv:rollup, r=frewsxcv
bors [Thu, 6 Apr 2017 06:07:42 +0000 (06:07 +0000)]
Auto merge of #41102 - frewsxcv:rollup, r=frewsxcv

Rollup of 5 pull requests

- Successful merges: #40908, #41011, #41026, #41037, #41050
- Failed merges:

7 years agoRollup merge of #41050 - jseyfried:fix_derive_parsing, r=petrochenkov
Corey Farwell [Thu, 6 Apr 2017 03:51:43 +0000 (23:51 -0400)]
Rollup merge of #41050 - jseyfried:fix_derive_parsing, r=petrochenkov

macros: fix bug parsing `#[derive]` invocations

Fixes #40962 (introduced in #40346).
r? @nrc

7 years agoRollup merge of #41037 - stjepang:move-libxtest, r=alexcrichton
Corey Farwell [Thu, 6 Apr 2017 03:51:42 +0000 (23:51 -0400)]
Rollup merge of #41037 - stjepang:move-libxtest, r=alexcrichton

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.

r? @alexcrichton

7 years agoRollup merge of #41026 - CleanCut:rust-40860, r=alexcrichton
Corey Farwell [Thu, 6 Apr 2017 03:51:41 +0000 (23:51 -0400)]
Rollup merge of #41026 - CleanCut:rust-40860, r=alexcrichton

Handle symlinks in src/bootstrap/clean.rs (mostly) -- resolves #40860.

In response to #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 agoRollup merge of #41011 - CleanCut:bootstrap-help, r=alexcrichton
Corey Farwell [Thu, 6 Apr 2017 03:51:40 +0000 (23:51 -0400)]
Rollup merge of #41011 - CleanCut:bootstrap-help, r=alexcrichton

Overhaul Bootstrap (x.py) Command-Line-Parsing & Help Output

While working on #40417, I got frustrated with the behavior of x.py and the bootstrap binary it wraps, so I decided to do something about it.  This PR should improve documentation, make the command-line-parsing more flexible, and clean up some of the internals.  No command that worked before should stop working.  At least that's the theory. :-)

This should resolve at least #40920 and #38373.

Changes:

- No more manual args manipulation -- getopts used everywhere except the one place it's not possible.  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` or explicitly passing `-h` or `--help`
- Logic is now much more linear.  We build strings up, and then print them.
- Refer to subcommands as subcommands everywhere (some places we were saying "command")
- Other minor stuff.

@alexcrichton This is my first PR. Do I need to do something specific to request reviewers or anything?

7 years agoRollup merge of #40908 - dotdash:pers_lt, r=arielb1
Corey Farwell [Thu, 6 Apr 2017 03:51:39 +0000 (23:51 -0400)]
Rollup merge of #40908 - dotdash:pers_lt, r=arielb1

Emit proper lifetime start intrinsics for personality slots

We currently only emit a single call to the lifetime start intrinsic
for the personality slot alloca. This happens because we create that
call at the time that we create the alloca, instead of creating it each
time we start using it. Because LLVM usually removes the alloca before
the lifetime intrinsics are even considered, this didn't cause any
problems yet, but we should fix this anyway.

7 years agoAuto merge of #40805 - vadimcn:msys-mingw, r=alexcrichton
bors [Thu, 6 Apr 2017 03:42:31 +0000 (03:42 +0000)]
Auto merge of #40805 - vadimcn:msys-mingw, r=alexcrichton

[Windows] Enable building rustc with "pthreads" flavor of mingw.

Tested on mingw-w64 packaged with msys2.

r? @alexcrichton

cc #40123

7 years agoAuto merge of #41098 - arielb1:rollup, r=arielb1
bors [Thu, 6 Apr 2017 01:00:15 +0000 (01:00 +0000)]
Auto merge of #41098 - arielb1:rollup, r=arielb1

Rollup of 12 pull requests

- Successful merges: #40479, #40561, #40709, #40815, #40909, #40927, #40943, #41015, #41028, #41052, #41054, #41065
- Failed merges:

7 years agoRollup merge of #41065 - jorendorff:slice-rsplit-41020, r=alexcrichton
Ariel Ben-Yehuda [Wed, 5 Apr 2017 23:01:13 +0000 (23:01 +0000)]
Rollup merge of #41065 - jorendorff:slice-rsplit-41020, r=alexcrichton

[T]::rsplit() and rsplit_mut(), #41020

7 years agoRollup merge of #41054 - anatol:master, r=alexcrichton
Ariel Ben-Yehuda [Wed, 5 Apr 2017 23:01:12 +0000 (23:01 +0000)]
Rollup merge of #41054 - anatol:master, r=alexcrichton

Replace magic number with readable sig constant

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

7 years agoRollup merge of #41052 - topecongiro:overlapping_inherent_impls, r=estebank
Ariel Ben-Yehuda [Wed, 5 Apr 2017 23:01:11 +0000 (23:01 +0000)]
Rollup merge of #41052 - topecongiro:overlapping_inherent_impls, r=estebank

Make 'overlapping_inherent_impls' lint a hard error

This is ought to be implemented in PR #40728. Unfortunately, when I rebased the PR to resolve merge conflict, the "hard error" code disappeared. This PR complements the initial PR.

Now the following rust code gives the following error:
```rust
struct Foo;

impl Foo {
    fn id() {}
}

impl Foo {
    fn id() {}
}

fn main() {}
```
```
error[E0592]: duplicate definitions with name `id`
 --> /home/topecongiro/test.rs:4:5
  |
4 |     fn id() {}
  |     ^^^^^^^^^^ duplicate definitions for `id`
...
8 |     fn id() {}
  |     ---------- other definition for `id`

error: aborting due to previous error
```

7 years agoRollup merge of #41028 - bluss:rev-rfind, r=alexcrichton
Ariel Ben-Yehuda [Wed, 5 Apr 2017 23:01:10 +0000 (23:01 +0000)]
Rollup merge of #41028 - bluss:rev-rfind, r=alexcrichton

Let .rev()'s find use the underlying rfind and vice versa

- Connect the plumbing in an obvious way from Rev's find → underlying rfind and vice versa
- A style change in the provided implementation for Iterator::rfind, using simple next_back when it is enough

7 years agoRollup merge of #41015 - arielb1:new-block-stack, r=alexcrichton
Ariel Ben-Yehuda [Wed, 5 Apr 2017 23:01:09 +0000 (23:01 +0000)]
Rollup merge of #41015 - arielb1:new-block-stack, r=alexcrichton

mark build::cfg::start_new_block as inline(never)

LLVM has a bug - [PR32488](https://bugs.llvm.org//show_bug.cgi?id=32488) - 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.

r? @eddyb

7 years agoRollup merge of #40943 - Amanieu:offset_to, r=alexcrichton
Ariel Ben-Yehuda [Wed, 5 Apr 2017 23:01:08 +0000 (23:01 +0000)]
Rollup merge of #40943 - Amanieu:offset_to, r=alexcrichton

Add ptr::offset_to

This PR adds a method to calculate the signed distance (in number of elements) between two pointers. The resulting value can then be passed to `offset` to get one pointer from the other. This is similar to pointer subtraction in C/C++.

There are 2 special cases:

- If the distance is not a multiple of the element size then the result is rounded towards zero. (in C/C++ this is UB)
-  ZST return `None`, while normal types return `Some(isize)`. This forces the user to handle the ZST case in unsafe code. (C/C++ doesn't have ZSTs)

7 years agoRollup merge of #40927 - stjepang:docs-atomic-overflow-note, r=alexcrichton
Ariel Ben-Yehuda [Wed, 5 Apr 2017 23:01:07 +0000 (23:01 +0000)]
Rollup merge of #40927 - stjepang:docs-atomic-overflow-note, r=alexcrichton

Add a note about overflow for fetch_add/fetch_sub

Fixes #40916
Fixes #34618

r? @steveklabnik

7 years agoRollup merge of #40909 - nagisa:fix-vec-placement, r=alexcrichton
Ariel Ben-Yehuda [Wed, 5 Apr 2017 23:01:06 +0000 (23:01 +0000)]
Rollup merge of #40909 - nagisa:fix-vec-placement, r=alexcrichton

Allow using Vec::<T>::place_back for T: !Clone

The place_back was likely put into block with `T: Clone` bound by mistake.

7 years agoRollup merge of #40815 - estebank:issue-40006, r=GuillaumeGomez
Ariel Ben-Yehuda [Wed, 5 Apr 2017 23:01:06 +0000 (23:01 +0000)]
Rollup merge of #40815 - estebank:issue-40006, r=GuillaumeGomez

Identify missing item category in `impl`s

```rust
struct S;
impl S {
    pub hello_method(&self) {
        println!("Hello");
    }
}
fn main() { S.hello_method(); }
```

```rust
error: missing `fn` for method declaration
 --> file.rs:3:4
  |
3 |     pub hello_method(&self) {
  |        ^ missing `fn`
```

Fix #40006. r? @pnkfelix CC @jonathandturner @GuillaumeGomez

7 years agoRollup merge of #40709 - lifthrasiir:leaner-unicode-debug-str, r=alexcrichton
Ariel Ben-Yehuda [Wed, 5 Apr 2017 23:01:05 +0000 (23:01 +0000)]
Rollup merge of #40709 - lifthrasiir:leaner-unicode-debug-str, r=alexcrichton

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.

In my x86-64 macOS laptop with `rustc 1.17.0-nightly (0aeb9c129 2017-03-15)`, `-C opt-level=3 -C lto` gives the following:

* The old routine compiles to 2,102 bytes of data and 416 bytes of code.
* The new routine compiles to 1,197 bytes of data and 448 bytes of code.

Counting a number of all printable Unicode scalar values (128,003, if you wonder) by filtering `0..0x110000` with `std::char::from_u32` and `is_printable` took 50±7ms for both. This can be surprising as the new routine *has* to do more calculations; this is partly explained by the fact that a linear search of `SINGLETONS` has been replaced by *two* linear searches for upper and lower bytes, which greatly reduces the iteration count.

7 years agoRollup merge of #40561 - arthurprs:hm-adapt2, r=pczarn
Ariel Ben-Yehuda [Wed, 5 Apr 2017 23:01:04 +0000 (23:01 +0000)]
Rollup merge of #40561 - arthurprs:hm-adapt2, r=pczarn

Simplify HashMap Bucket interface

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

The idea was to put idx in RawBucket instead of the other Bucket types and simplify next() and prev() as much as possible. The rest was a side-effect of that change, except maybe the last 2.

This change makes iteration and other next/prev() heavy operations noticeably faster. Clone is way faster.

```
➜  hashmap2 git:(adapt) ✗ cargo benchcmp pre:: adp:: bench.txt
 name                        pre:: ns/iter  adp:: ns/iter  diff ns/iter   diff %
 clone_10_000                74,364         39,736              -34,628  -46.57%
 grow_100_000                8,343,553      8,233,785          -109,768   -1.32%
 grow_10_000                 817,825        723,958             -93,867  -11.48%
 grow_big_value_100_000      18,418,979     17,906,186         -512,793   -2.78%
 grow_big_value_10_000       1,219,242      1,103,334          -115,908   -9.51%
 insert_1000                 74,546         58,343              -16,203  -21.74%
 insert_100_000              6,743,770      6,238,017          -505,753   -7.50%
 insert_10_000               798,079        719,123             -78,956   -9.89%
 insert_1_000_000            275,215,605    266,975,875      -8,239,730   -2.99%
 insert_int_bigvalue_10_000  1,517,387      1,419,838           -97,549   -6.43%
 insert_str_10_000           316,179        278,896             -37,283  -11.79%
 insert_string_10_000        770,927        747,449             -23,478   -3.05%
 iter_keys_100_000           386,099        333,104             -52,995  -13.73%
 iterate_100_000             387,320        355,707             -31,613   -8.16%
 lookup_100_000              206,757        193,063             -13,694   -6.62%
 lookup_100_000_unif         219,366        193,180             -26,186  -11.94%
 lookup_1_000_000            206,456        205,716                -740   -0.36%
 lookup_1_000_000_unif       659,934        629,659             -30,275   -4.59%
 lru_sim                     20,194,334     18,442,149       -1,752,185   -8.68%
 merge_shuffle               1,168,044      1,063,055          -104,989   -8.99%
```

Note 2: I may have messed up porting the diff, let's see what CI says.

7 years agoRollup merge of #40479 - sezaru:master, r=alexcrichton
Ariel Ben-Yehuda [Wed, 5 Apr 2017 23:01:03 +0000 (23:01 +0000)]
Rollup merge of #40479 - sezaru:master, r=alexcrichton

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 agoAuto merge of #40348 - nrc:save-extern-fn, r=eddyb
bors [Wed, 5 Apr 2017 20:06:00 +0000 (20:06 +0000)]
Auto merge of #40348 - nrc:save-extern-fn, r=eddyb

Handle extern functions and statics in save-analysis

r? @eddyb

7 years agoAuto merge of #41086 - frewsxcv:rollup, r=frewsxcv
bors [Wed, 5 Apr 2017 16:47:45 +0000 (16:47 +0000)]
Auto merge of #41086 - frewsxcv:rollup, r=frewsxcv

Rollup of 19 pull requests

- Successful merges: #40608, #40870, #40949, #40977, #40981, #40988, #40992, #40997, #40999, #41007, #41014, #41019, #41035, #41043, #41049, #41062, #41066, #41076, #41085
- Failed merges:

7 years agoRollup merge of #41085 - nagisa:fix-output-properg, r=alexcrichton
Corey Farwell [Wed, 5 Apr 2017 16:44:40 +0000 (12:44 -0400)]
Rollup merge of #41085 - nagisa:fix-output-properg, r=alexcrichton

Properly adjust filenames when multiple emissions

Fixes #40993

Should backport just fine to beta but not sure if we want to do this since this is quite old stable regression.

7 years agoRollup merge of #41076 - alexcrichton:update-sccache, r=frewsxcv
Corey Farwell [Wed, 5 Apr 2017 16:44:39 +0000 (12:44 -0400)]
Rollup merge of #41076 - alexcrichton:update-sccache, r=frewsxcv

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 agoRollup merge of #41066 - steveklabnik:fix-links, r=frewsxcv
Corey Farwell [Wed, 5 Apr 2017 16:44:38 +0000 (12:44 -0400)]
Rollup merge of #41066 - steveklabnik:fix-links, r=frewsxcv

Fix links

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

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

r? @frewsxcv @GuillaumeGomez

7 years agoRollup merge of #41062 - estebank:private-field, r=arielb1
Corey Farwell [Wed, 5 Apr 2017 16:44:38 +0000 (12:44 -0400)]
Rollup merge of #41062 - estebank:private-field, r=arielb1

Do not recommend private fields called as method

```rust
error: no method named `dog_age` found for type `animal::Dog` in the current scope
  --> $DIR/private-field.rs:26:23
   |
26 |     let dog_age = dog.dog_age();
   |                       ^^^^^^^ private field, not a method
```
Fix #27654.

7 years agoRollup merge of #41049 - GuillaumeGomez:rustdoc-ordered-list, r=frewsxcv
Corey Farwell [Wed, 5 Apr 2017 16:44:36 +0000 (12:44 -0400)]
Rollup merge of #41049 - GuillaumeGomez:rustdoc-ordered-list, r=frewsxcv

Handle ordered lists as well

Part of #40912.

r? @rust-lang/docs

7 years agoRollup merge of #41043 - GuillaumeGomez:sup_balise, r=steveklabnik
Corey Farwell [Wed, 5 Apr 2017 16:44:36 +0000 (12:44 -0400)]
Rollup merge of #41043 - GuillaumeGomez:sup_balise, r=steveklabnik

Replace ^ with <sup> html balise

r? @steveklabnik

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 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 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 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 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 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 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 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 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 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 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 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 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.