]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAuto merge of #39633 - steveklabnik:vendor-mdbook, r=alexcrichton
bors [Wed, 15 Feb 2017 01:22:16 +0000 (01:22 +0000)]
Auto merge of #39633 - steveklabnik:vendor-mdbook, r=alexcrichton

Port books to mdbook

Part of https://github.com/rust-lang/rust/issues/39588

blocked on https://github.com/rust-lang/rust/pull/39431

As a first step towards the bookshelf, we ~vendor mdbook in-tree and~ port our books to it. Eventually, both of these books will be moved out-of-tree, but the nightly book will rely on doing the same thing. As such, this intermediate step is useful.

r? @alexcrichton @brson

/cc @azerupi

7 years agoAuto merge of #39818 - frewsxcv:rollup, r=frewsxcv
bors [Tue, 14 Feb 2017 22:46:10 +0000 (22:46 +0000)]
Auto merge of #39818 - frewsxcv:rollup, r=frewsxcv

Rollup of 8 pull requests

- Successful merges: #39659, #39730, #39754, #39772, #39785, #39788, #39790, #39813
- Failed merges:

7 years agoConversions between CStr/OsStr/Path and boxes.
Clar Charr [Wed, 1 Feb 2017 03:46:16 +0000 (22:46 -0500)]
Conversions between CStr/OsStr/Path and boxes.

7 years agoShow five traits implementation in help when there are exactly five
Sebastian Waisbrot [Tue, 14 Feb 2017 04:32:05 +0000 (01:32 -0300)]
Show five traits implementation in help when there are exactly five

7 years agoRollup merge of #39813 - sanxiyn:non-camel-case-variant, r=petrochenkov
Corey Farwell [Tue, 14 Feb 2017 15:07:37 +0000 (10:07 -0500)]
Rollup merge of #39813 - sanxiyn:non-camel-case-variant, r=petrochenkov

Use check_variant for non_camel_case_types lint

This way we automatically consider lint attributes.

Fix #38452.

7 years agoRollup merge of #39790 - zackw:tidy-linelen-exempt-urls, r=alexcrichton
Corey Farwell [Tue, 14 Feb 2017 15:07:36 +0000 (10:07 -0500)]
Rollup merge of #39790 - zackw:tidy-linelen-exempt-urls, r=alexcrichton

tidy: exempt URLs from the line length restriction

The length of a URL is usually not under our control, and Markdown
provides no way to split a URL in the middle.  Therefore, comment
lines consisting _solely_ of a URL (possibly with a Markdown link
label in front) should be exempt from the line-length restriction.

Inline hyperlink destinations ( `[foo](http://...)` notation ) are
_not_ exempt, because it is my arrogant opinion that long lines of
that type make the source text illegible.

The patch adds dependencies on the `regex` and `lazy_static` crates
to the tidy utility.  This _appears_ to Just Work, but if you would
rather not have that dependency I am willing to provide a hand-written
parser instead.

7 years agoRollup merge of #39788 - GuillaumeGomez:rustdoc-test-md-file, r=alexcrichton
Corey Farwell [Tue, 14 Feb 2017 15:07:35 +0000 (10:07 -0500)]
Rollup merge of #39788 - GuillaumeGomez:rustdoc-test-md-file, r=alexcrichton

Add filename when running rustdoc --test on a markdown file

r? @alexcrichton

7 years agoRollup merge of #39785 - alexcrichton:no-thread-sanitizer, r=japaric
Corey Farwell [Tue, 14 Feb 2017 15:07:34 +0000 (10:07 -0500)]
Rollup merge of #39785 - alexcrichton:no-thread-sanitizer, r=japaric

test: Remove sanitizer-thread test

Unfortunately it appears to spuriously fail so we can't gate on it

7 years agoRollup merge of #39772 - cseale:staged_api_whitelist_removal, r=est31
Corey Farwell [Tue, 14 Feb 2017 15:07:33 +0000 (10:07 -0500)]
Rollup merge of #39772 - cseale:staged_api_whitelist_removal, r=est31

Adding compile fail test for staged_api feature

Issue #39059
r? @est31

@est31 running the tests for this feature fails. Is that expected since this is the `compile-fail`suite?

I copied this test from the run-pass suite: `rust/src/test/run-pass/reachable-unnameable-type-alias.rs`. What are the differences between these suites in operation and why they are used?

7 years agoRollup merge of #39754 - alexcrichton:less-assertions, r=brson
Corey Farwell [Tue, 14 Feb 2017 15:07:31 +0000 (10:07 -0500)]
Rollup merge of #39754 - alexcrichton:less-assertions, r=brson

travis: Add builders without assertions

This commit adds three new builders, one OSX, one Linux, and one MSVC, which
will produce "nightlies" with LLVM assertions disabled. Currently all nightly
releases have LLVM assertions enabled to catch bugs before they reach the
beta/stable channels. The beta/stable channels, however, do not have LLVM
assertions enabled.

Unfortunately though projects like Servo are stuck on nightlies for the near
future at least and are also suffering very long compile times. The purpose of
this commit is to provide artifacts to these projects which are not distributed
through normal channels (e.g. rustup) but are provided for developers to use
locally if need be.

Logistically these builds will all be uploaded to `rustc-builds-alt` instead of
the `rustc-builds` folder of the `rust-lang-ci` bucket. These builds will stay
there forever (until cleaned out if necessary) and there are no plans to
integrate this with rustup and/or the official release process.

7 years agoRollup merge of #39730 - jseyfried:fix_empty_seq_rep_ice, r=nrc
Corey Farwell [Tue, 14 Feb 2017 15:07:30 +0000 (10:07 -0500)]
Rollup merge of #39730 - jseyfried:fix_empty_seq_rep_ice, r=nrc

macros: fix ICE on certain sequence repetitions

Fixes #39709.
r? @nrc

7 years agoRollup merge of #39659 - zackw:asciiext-ctype, r=alexcrichton
Corey Farwell [Tue, 14 Feb 2017 15:07:29 +0000 (10:07 -0500)]
Rollup merge of #39659 - zackw:asciiext-ctype, r=alexcrichton

Add equivalents of C's <ctype.h> functions to AsciiExt.

 * `is_ascii_alphabetic`
 * `is_ascii_uppercase`
 * `is_ascii_lowercase`
 * `is_ascii_alphanumeric`
 * `is_ascii_digit`
 * `is_ascii_hexdigit`
 * `is_ascii_punctuation`
 * `is_ascii_graphic`
 * `is_ascii_whitespace`
 * `is_ascii_control`

This addresses issue #39658.

Lightly tested on x86-64-linux.  tidy complains about the URLs in the documentation making lines too long, I don't know what to do about that.

7 years agoUse check_variant for non_camel_case_types lint
Seo Sanghyeon [Tue, 14 Feb 2017 10:46:48 +0000 (19:46 +0900)]
Use check_variant for non_camel_case_types lint

7 years agoRemove Copy bound from some Cell trait impls
Ralf Jung [Tue, 14 Feb 2017 08:46:03 +0000 (09:46 +0100)]
Remove Copy bound from some Cell trait impls

Contributes to #39264

7 years agoAuto merge of #39728 - eddyb:vendeur-tres-bien, r=alexcrichton
bors [Tue, 14 Feb 2017 07:06:25 +0000 (07:06 +0000)]
Auto merge of #39728 - eddyb:vendeur-tres-bien, r=alexcrichton

Automate vendoring by invoking cargo-vendor when building src dist tarballs.

This avoids #39633 bringing the `src/vendor` checked into git by #37524, past 200,000 lines of code.

I believe the strategy of having rustbuild run `cargo vendor` during the `dist src` step is sound.

However, the only way to be sure `cargo-vendor` exists is to run `cargo install --force cargo-vendor`, which will recompile it every time (not passing `--force` means you can't tell between "already exists" and "build error"). ~~This is quite suboptimal and I'd like to somehow do it in each `Dockerfile` that would need it.~~

* [ ] Cache `CARGO_HOME` (i.e. `~/.cargo`) between CI runs
  * `bin/cargo-vendor` and the actual caches are the relevant bits
* [x] Do not build `cargo-vendor` all the time
  * ~~Maybe detect `~/.cargo/bin/cargo-vendor` already exists?~~
  * ~~Could also try to build it in a `Dockerfile` but do we have `cargo`/`rustc` there?~~
  * Final solution: check `cargo install --list` for a line starting with `cargo-vendor `

cc @rust-lang/tools

7 years agoAuto merge of #38981 - sdleffler:patch-1, r=alexcrichton
bors [Tue, 14 Feb 2017 04:29:26 +0000 (04:29 +0000)]
Auto merge of #38981 - sdleffler:patch-1, r=alexcrichton

Add PartialOrd, Ord derivations to TypeId

I want to be able to sort a `Vec` of types which contain `TypeId`s, so an `Ord` derivation would be very useful to me. `Hash` and `PartialEq`/`Eq` already exist, so the missing `PartialOrd` and `Ord` derivations feel like an oversight to me.

7 years agoAuto merge of #38561 - nagisa:rdrandseed, r=alexcrichton
bors [Tue, 14 Feb 2017 01:26:10 +0000 (01:26 +0000)]
Auto merge of #38561 - nagisa:rdrandseed, r=alexcrichton

Add intrinsics & target features for rd{rand,seed}

One question is whether or not we want to map feature name `rdrnd` to `rdrand` instead.

EDIT: as for use case, I would like to port my rdrand crate from inline assembly to these intrinsics.

7 years agoAdding compile fail test for staged_api feature
Colm Seale [Sun, 12 Feb 2017 23:16:06 +0000 (23:16 +0000)]
Adding compile fail test for staged_api feature

Issue #39059
r? @est31

7 years agoAutomatically vendor Cargo deps when building the source tarballs.
Eduard-Mihai Burtescu [Fri, 10 Feb 2017 20:59:40 +0000 (22:59 +0200)]
Automatically vendor Cargo deps when building the source tarballs.

7 years agoAdd feature annotations to the doctests for ascii_ctype.
Zack Weinberg [Mon, 13 Feb 2017 23:44:43 +0000 (18:44 -0500)]
Add feature annotations to the doctests for ascii_ctype.

7 years agoAuto merge of #39787 - frewsxcv:rollup, r=frewsxcv
bors [Mon, 13 Feb 2017 20:45:26 +0000 (20:45 +0000)]
Auto merge of #39787 - frewsxcv:rollup, r=frewsxcv

Rollup of 5 pull requests

- Successful merges: #39716, #39758, #39759, #39774, #39784
- Failed merges:

7 years agoReplace regex-based parser for URL lines with open-coded one.
Zack Weinberg [Mon, 13 Feb 2017 20:44:51 +0000 (15:44 -0500)]
Replace regex-based parser for URL lines with open-coded one.

7 years agoAllow more Cell methods for non-Copy types
Ralf Jung [Mon, 13 Feb 2017 18:50:54 +0000 (19:50 +0100)]
Allow more Cell methods for non-Copy types

Contributes to #39264

7 years agofix up linkchecker
Steve Klabnik [Fri, 10 Feb 2017 21:38:20 +0000 (16:38 -0500)]
fix up linkchecker

1. skip png files
2. skip fragments for the book and nomicon, as these are added by JS
3. Actually print the filename for errors

7 years agoFix up links
Steve Klabnik [Fri, 10 Feb 2017 20:12:59 +0000 (15:12 -0500)]
Fix up links

mdbook and rustdoc generate links differently, so we need to change all
these links.

7 years agoAdd exceptions to tidy
Steve Klabnik [Thu, 9 Feb 2017 19:44:39 +0000 (14:44 -0500)]
Add exceptions to tidy

We've decided that these deps are okay.

7 years agoinclude everything in the vendor directory
Steve Klabnik [Fri, 10 Feb 2017 16:47:58 +0000 (11:47 -0500)]
include everything in the vendor directory

7 years agofix gitattributes for vendor
Steve Klabnik [Fri, 10 Feb 2017 16:27:34 +0000 (11:27 -0500)]
fix gitattributes for vendor

7 years agoPort Nomicon to mdbook
Steve Klabnik [Wed, 8 Feb 2017 00:08:12 +0000 (19:08 -0500)]
Port Nomicon to mdbook

1. move everything under a src directory
2. add README.md to the SUMMARY.md

7 years agoPort TRPL to mdbook
Steve Klabnik [Wed, 8 Feb 2017 00:07:28 +0000 (19:07 -0500)]
Port TRPL to mdbook

1. move everything under a src directory
2. add README.md to the SUMMARY.md

7 years agoRe-implement rustbook in terms of mdbook
Steve Klabnik [Tue, 7 Feb 2017 23:13:57 +0000 (18:13 -0500)]
Re-implement rustbook in terms of mdbook

mdbook has a lot of optional dependencies that we don't want, so instead
of using it directly, we re-build rustbook to use mdbook as a library.
For convenience' sake, we keep the same CLI interface as mdbook; the
only difference is that it only accepts build and test subcommands,
rather than the full range.

7 years agotidy: exempt URLs from the line length restriction
Zack Weinberg [Mon, 13 Feb 2017 17:33:35 +0000 (12:33 -0500)]
tidy: exempt URLs from the line length restriction

The length of a URL is usually not under our control, and Markdown
provides no way to split a URL in the middle.  Therefore, comment
lines consisting _solely_ of a URL (possibly with a Markdown link
label in front) should be exempt from the line-length restriction.

Inline hyperlink destinations ( `[foo](http://...)` notation ) are
_not_ exempt, because it is my arrogant opinion that long lines of
that type make the source text illegible.

The patch adds dependencies on the `regex` and `lazy_static` crates
to the tidy utility.  This _appears_ to Just Work, but if you would
rather not have that dependency I am willing to provide a hand-written
parser instead.

7 years agoAdd filename when running rustdoc --test on a markdown file
Guillaume Gomez [Mon, 13 Feb 2017 17:11:20 +0000 (18:11 +0100)]
Add filename when running rustdoc --test on a markdown file

7 years agoSqueeze URL lines under 100 chars wide to make tidy happy.
Zack Weinberg [Mon, 13 Feb 2017 16:46:29 +0000 (11:46 -0500)]
Squeeze URL lines under 100 chars wide to make tidy happy.

7 years agoRollup merge of #39784 - king6cong:master, r=GuillaumeGomez
Corey Farwell [Mon, 13 Feb 2017 15:58:53 +0000 (10:58 -0500)]
Rollup merge of #39784 - king6cong:master, r=GuillaumeGomez

typo fix

7 years agoRollup merge of #39774 - frewsxcv:no-rustbuild, r=alexcrichton
Corey Farwell [Mon, 13 Feb 2017 15:58:52 +0000 (10:58 -0500)]
Rollup merge of #39774 - frewsxcv:no-rustbuild, r=alexcrichton

Remove '--disable-rustbuild' option from configure script.

Fixes https://github.com/rust-lang/rust/issues/39762.

7 years agoRollup merge of #39759 - binarycrusader:master, r=alexcrichton
Corey Farwell [Mon, 13 Feb 2017 15:58:51 +0000 (10:58 -0500)]
Rollup merge of #39759 - binarycrusader:master, r=alexcrichton

add solaris rustbuild support

Add Solaris as recognized ostype
Add cputype recognition for Solaris

Fixes #39729

A future pull request will discriminate between the commercial release and older opensource derivatives to account for divergence, for now, this is compatible with both.

7 years agoRollup merge of #39758 - shepmaster:e0089-duplicate-text, r=GuillaumeGomez
Corey Farwell [Mon, 13 Feb 2017 15:58:50 +0000 (10:58 -0500)]
Rollup merge of #39758 - shepmaster:e0089-duplicate-text, r=GuillaumeGomez

Remove duplicated "parameter" in E0089 text

Closes #39732

7 years agoRollup merge of #39716 - F001:swapCell, r=alexcrichton
Corey Farwell [Mon, 13 Feb 2017 15:58:48 +0000 (10:58 -0500)]
Rollup merge of #39716 - F001:swapCell, r=alexcrichton

Add `swap` method for `Cell`

Addition to #39264

r? @alexcrichton

7 years agotest: Remove sanitizer-thread test
Alex Crichton [Mon, 13 Feb 2017 14:44:06 +0000 (06:44 -0800)]
test: Remove sanitizer-thread test

Unfortunately it appears to spuriously fail so we can't gate on it

7 years agoStandardize lifetime and type parameter count mismatch errors
Jake Goulding [Mon, 13 Feb 2017 01:29:51 +0000 (20:29 -0500)]
Standardize lifetime and type parameter count mismatch errors

They now always say how many lifetime / type parameters were expected
and are explicit about stating "lifetime" or "type" instead of just
"parameter".

7 years agoRemove duplicated "parameter" in E0089 text
Jake Goulding [Sat, 11 Feb 2017 02:09:54 +0000 (21:09 -0500)]
Remove duplicated "parameter" in E0089 text

Closes #39732

7 years agotypo fix
king6cong [Mon, 13 Feb 2017 10:41:45 +0000 (18:41 +0800)]
typo fix

7 years agoAuto merge of #39778 - ahmedcharles:docs, r=frewsxcv
bors [Mon, 13 Feb 2017 09:04:09 +0000 (09:04 +0000)]
Auto merge of #39778 - ahmedcharles:docs, r=frewsxcv

Fix some typos in the core::fmt docs.

7 years agosave-analysis: emit info about impls and super-traits in JSON
Nick Cameron [Mon, 13 Feb 2017 04:50:58 +0000 (17:50 +1300)]
save-analysis: emit info about impls and super-traits in JSON

7 years agoAuto merge of #39456 - nagisa:mir-switchint-everywhere, r=nikomatsakis
bors [Mon, 13 Feb 2017 02:32:09 +0000 (02:32 +0000)]
Auto merge of #39456 - nagisa:mir-switchint-everywhere, r=nikomatsakis

[MIR] SwitchInt Everywhere

Something I've been meaning to do for a very long while. This PR essentially gets rid of 3 kinds of conditional branching and only keeps the most general one - `SwitchInt`. Primary benefits are such that dealing with MIR now does not involve dealing with 3 different ways to do conditional control flow. On the other hand, constructing a `SwitchInt` currently requires more code than what previously was necessary to build an equivalent `If` terminator. Something trivially "fixable" with some constructor methods somewhere (MIR needs stuff like that badly in general).

Some timings (tl;dr: slightly faster^1 (unexpected), but also uses slightly more memory at peak (expected)):

^1: Not sure if the speed benefits are because of LLVM liking the generated code better or the compiler itself getting compiled better. Either way, its a net benefit. The CORE and SYNTAX timings done for compilation without optimisation.

```
AFTER:
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 31.50 secs
    Finished release [optimized] target(s) in 31.42 secs
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 439.56 secs
    Finished release [optimized] target(s) in 435.15 secs

CORE: 99% (24.81 real, 0.13 kernel, 24.57 user); 358536k resident
CORE: 99% (24.56 real, 0.15 kernel, 24.36 user); 359168k resident
SYNTAX: 99% (49.98 real, 0.48 kernel, 49.42 user); 653416k resident
SYNTAX: 99% (50.07 real, 0.58 kernel, 49.43 user); 653604k resident

BEFORE:
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 31.84 secs
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 451.17 secs

CORE: 99% (24.66 real, 0.20 kernel, 24.38 user); 351096k resident
CORE: 99% (24.36 real, 0.17 kernel, 24.18 user); 352284k resident
SYNTAX: 99% (52.24 real, 0.56 kernel, 51.66 user); 645544k resident
SYNTAX: 99% (51.55 real, 0.48 kernel, 50.99 user); 646428k resident
```

cc @nikomatsakis @eddyb

7 years agoFix some typos in the core::fmt docs.
Ahmed Charles [Mon, 13 Feb 2017 02:18:14 +0000 (18:18 -0800)]
Fix some typos in the core::fmt docs.

7 years agoRemove '--disable-rustbuild' option from configure script.
Corey Farwell [Mon, 13 Feb 2017 00:16:22 +0000 (19:16 -0500)]
Remove '--disable-rustbuild' option from configure script.

Fixes https://github.com/rust-lang/rust/issues/39762.

7 years agoAuto merge of #39572 - jseyfried:fix_inert_attributes, r=nrc
bors [Sun, 12 Feb 2017 23:21:15 +0000 (23:21 +0000)]
Auto merge of #39572 - jseyfried:fix_inert_attributes, r=nrc

macros: fix inert attributes from `proc_macro_derives` with `#![feature(proc_macro)]`

This PR refactors collection of `proc_macro_derive` invocations to fix #39347.

After this PR, the input to a `#[proc_macro_derive]` function no longer sees `#[derive]`s on the underlying item. For example, consider:
```rust
extern crate my_derives;
use my_derives::{Trait, Trait2};

#[derive(Copy, Clone)]
#[derive(Trait)]
#[derive(Trait2)]
struct S;
```

Today, the input to the `Trait` derive is `#[derive(Copy, Clone, Trait2)] struct S;`, and the input to the `Trait2` derive is `#[derive(Copy, Clone)] struct S;`. More generally, a `proc_macro_derive` sees all builtin derives, as well as all `proc_macro_derive`s listed *after* the one being invoked.

After this PR, both `Trait` and `Trait2` will see `struct S;`.
This is a [breaking-change], but I believe it is highly unlikely to cause breakage in practice.

r? @nrc

7 years agofix portability issue in error handling of build_triple
Shawn Walker-Salas [Sun, 12 Feb 2017 19:24:06 +0000 (11:24 -0800)]
fix portability issue in error handling of build_triple

7 years agoAuto merge of #39769 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 12 Feb 2017 18:16:54 +0000 (18:16 +0000)]
Auto merge of #39769 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 7 pull requests

- Successful merges: #39654, #39662, #39697, #39740, #39743, #39756, #39760
- Failed merges:

7 years agoRollup merge of #39760 - shepmaster:struct-init-doc, r=GuillaumeGomez
Guillaume Gomez [Sun, 12 Feb 2017 18:16:34 +0000 (19:16 +0100)]
Rollup merge of #39760 - shepmaster:struct-init-doc, r=GuillaumeGomez

Improve grammar on field init docs

7 years agoRollup merge of #39756 - JordiPolo:feature/try_to_question, r=steveklabnik
Guillaume Gomez [Sun, 12 Feb 2017 18:16:33 +0000 (19:16 +0100)]
Rollup merge of #39756 - JordiPolo:feature/try_to_question, r=steveklabnik

Sustitutes try! for ? in the Result documentation

Hopefully newcomers will go strait to use `?`

7 years agoRollup merge of #39743 - GuillaumeGomez:rustdoc-test-output, r=alexcrichton
Guillaume Gomez [Sun, 12 Feb 2017 18:16:32 +0000 (19:16 +0100)]
Rollup merge of #39743 - GuillaumeGomez:rustdoc-test-output, r=alexcrichton

Add tested item in the rustdoc --test output

r? @alexcrichton

cc @SergioBenitez

7 years agoRollup merge of #39740 - jimmycuadra:rustdoc-empty-stability, r=aturon
Guillaume Gomez [Sun, 12 Feb 2017 18:16:31 +0000 (19:16 +0100)]
Rollup merge of #39740 - jimmycuadra:rustdoc-empty-stability, r=aturon

rustdoc: Only include a stability span if needed.

This patch gets rid of the empty stability boxes in docs by only including the span that creates it when the item actually has a stability class.

Here are images of the issue on `std::process::Output`:

Before:

<img width="340" alt="before" src="https://cloud.githubusercontent.com/assets/122457/22853638/ff88d1b2-f010-11e6-90d6-bf3d10e2fffa.png">

After:

<img width="333" alt="after" src="https://cloud.githubusercontent.com/assets/122457/22853639/06bfe7cc-f011-11e6-9892-f0ea2cc6ec90.png">

This is my first non-trivial patch to Rust, so I'm sure some of my approach is not idiomatic. Let me know how you'd like me to adjust!

7 years agoRollup merge of #39697 - notriddle:rustdoc_tooltip, r=GuillaumeGomez
Guillaume Gomez [Sun, 12 Feb 2017 18:16:30 +0000 (19:16 +0100)]
Rollup merge of #39697 - notriddle:rustdoc_tooltip, r=GuillaumeGomez

Add the item type to the tooltip

See:
https://users.rust-lang.org/t/seeking-opinions-from-colorblind-rustaceans-coloring-in-rustdoc-code-blocks

7 years agoRollup merge of #39662 - Henning-K:patch-1, r=frewsxcv
Guillaume Gomez [Sun, 12 Feb 2017 18:16:29 +0000 (19:16 +0100)]
Rollup merge of #39662 - Henning-K:patch-1, r=frewsxcv

Fixes #39661

Clarifies the potential ambiguity.

7 years agoRollup merge of #39654 - ollie27:rustdoc_attributes, r=GuillaumeGomez
Guillaume Gomez [Sun, 12 Feb 2017 18:16:28 +0000 (19:16 +0100)]
Rollup merge of #39654 - ollie27:rustdoc_attributes, r=GuillaumeGomez

rustdoc: Show attributes on all item types

Currently attributes are only shown for structs, unions and enums but
they should be shown for all items. For example it is useful to know if a
function is `#[no_mangle]`.

7 years agoNuke src/vendor.
Eduard-Mihai Burtescu [Fri, 10 Feb 2017 20:57:09 +0000 (22:57 +0200)]
Nuke src/vendor.

7 years agoAuto merge of #39680 - canndrew:uninhabited_from-infinite-loop, r=arielb1
bors [Sun, 12 Feb 2017 07:20:31 +0000 (07:20 +0000)]
Auto merge of #39680 - canndrew:uninhabited_from-infinite-loop, r=arielb1

Add recursion limit to inhabitedness check

Fixes #39489.
Add test aswell.

7 years agoAllow using inert attributes from `proc_macro_derive`s with `#![feature(proc_macro)]`.
Jeffrey Seyfried [Thu, 2 Feb 2017 07:01:15 +0000 (07:01 +0000)]
Allow using inert attributes from `proc_macro_derive`s with `#![feature(proc_macro)]`.

7 years agofix exception handling for isainfo execution failure
Shawn Walker-Salas [Sun, 12 Feb 2017 06:55:25 +0000 (22:55 -0800)]
fix exception handling for isainfo execution failure
remove unnecessary gcc_s addition in libstd for Solaris

7 years agoImprove grammar on field init docs
Jake Goulding [Sun, 12 Feb 2017 04:42:39 +0000 (23:42 -0500)]
Improve grammar on field init docs

7 years agofix copy pasta
Shawn Walker-Salas [Sun, 12 Feb 2017 04:38:13 +0000 (20:38 -0800)]
fix copy pasta

Don't need to catch WindowsError.  That was very silly of me.

7 years agoAdd Solaris as recognized ostype
Shawn Walker-Salas [Sat, 11 Feb 2017 17:24:33 +0000 (09:24 -0800)]
Add Solaris as recognized ostype
Add cputype recognition for Solaris

Fixes #39729

7 years agoAuto merge of #39554 - zackmdavis:assert_eq_has_a_terrible_error_message_when_given_a...
bors [Sun, 12 Feb 2017 03:34:57 +0000 (03:34 +0000)]
Auto merge of #39554 - zackmdavis:assert_eq_has_a_terrible_error_message_when_given_a_trailing_comma, r=BurntSushi

improve error message when two-arg assert_eq! receives a trailing comma

Previously, `assert_eq!(left, right,)` (respectively, `assert_ne!(left,
right,)`; note the trailing comma) would result in a confusing "requires
at least a format string argument" error. In reality, a format string is
optional, but the trailing comma puts us into the "match a token tree of
zero or more tokens" branch of the macro (in order to support the
optional format string), and passing the empty token tree into
`format_args!` results in the confusing error. If instead we match a
token tree of one or more tokens, we get a much more sensible
"unexpected end of macro invocation" error.

While we're here, fix up a stray space before a comma in the match
guards.

Resolves #39369.

-----

**Before:**
```
$ rustc scratch.rs
error: requires at least a format string argument
 --> scratch.rs:2:5
  |
2 |     assert_eq!(1, 2,);
  |     ^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in a macro outside of the current crate

error: aborting due to previous error
```

**After:**
```
$ ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc scratch.rs
error: unexpected end of macro invocation
 --> scratch.rs:2:20
  |
2 |     assert_eq!(1, 2,);
  |                    ^
```

7 years agoMove legacy custom derives collection into `resolver.find_attr_invoc()`.
Jeffrey Seyfried [Thu, 2 Feb 2017 00:33:42 +0000 (00:33 +0000)]
Move legacy custom derives collection into `resolver.find_attr_invoc()`.

7 years agoSustitutes try! for ? in the Result documentation
Jordi Polo [Sun, 12 Feb 2017 02:02:55 +0000 (11:02 +0900)]
Sustitutes try! for ? in the Result documentation

7 years agotravis: Add builders without assertions
Alex Crichton [Sun, 12 Feb 2017 01:28:29 +0000 (17:28 -0800)]
travis: Add builders without assertions

This commit adds three new builders, one OSX, one Linux, and one MSVC, which
will produce "nightlies" with LLVM assertions disabled. Currently all nightly
releases have LLVM assertions enabled to catch bugs before they reach the
beta/stable channels. The beta/stable channels, however, do not have LLVM
assertions enabled.

Unfortunately though projects like Servo are stuck on nightlies for the near
future at least and are also suffering very long compile times. The purpose of
this commit is to provide artifacts to these projects which are not distributed
through normal channels (e.g. rustup) but are provided for developers to use
locally if need be.

Logistically these builds will all be uploaded to `rustc-builds-alt` instead of
the `rustc-builds` folder of the `rust-lang-ci` bucket. These builds will stay
there forever (until cleaned out if necessary) and there are no plans to
integrate this with rustup and/or the official release process.

7 years agoAuto merge of #38945 - battisti:fix_thread_num, r=alexcrichton
bors [Sun, 12 Feb 2017 00:54:57 +0000 (00:54 +0000)]
Auto merge of #38945 - battisti:fix_thread_num, r=alexcrichton

treat setting the number of test-threads to 0 as an error

It is currently possible to call `cargo test -- --test-threads=0` which will cause cargo to hang until aborted. This change will fix that and will report an appropriate error to the user.

7 years agoAuto merge of #39747 - mattico:fix-llvm4-createcompileunit, r=alexcrichton
bors [Sat, 11 Feb 2017 22:10:53 +0000 (22:10 +0000)]
Auto merge of #39747 - mattico:fix-llvm4-createcompileunit, r=alexcrichton

[LLVM 4.0] Fix CreateCompileUnit

This is largely identical to @dylanmckay's [patch](https://github.com/dylanmckay), except that it doesn't try to use `file_metadata()`. I don't think that is necessary because we don't want the compile unit to be added to  `debug_context.created_files`, though I'd like confirmation from someone who knows for sure. If that is needed, I can modify `file_metadata_()` so that it can be used from `compile_unit_metadata()`.

7 years agoFix as_ptr() drop problem
Matt Ickstadt [Sat, 11 Feb 2017 21:41:03 +0000 (15:41 -0600)]
Fix as_ptr() drop problem

7 years ago[LLVM 4.0] Fix CreateCompileUnit
Matt Ickstadt [Sat, 11 Feb 2017 21:01:25 +0000 (15:01 -0600)]
[LLVM 4.0] Fix CreateCompileUnit

7 years agoremoved trailing whitespace
Alexander Battisti [Sat, 11 Feb 2017 19:04:05 +0000 (20:04 +0100)]
removed trailing whitespace

7 years agoUse functional transformations on the option instead of matching.
Jimmy Cuadra [Sat, 11 Feb 2017 18:00:56 +0000 (10:00 -0800)]
Use functional transformations on the option instead of matching.

7 years agoAdd tested item in the rustdoc --test output
Guillaume Gomez [Sat, 11 Feb 2017 15:36:31 +0000 (16:36 +0100)]
Add tested item in the rustdoc --test output

7 years agoRemove extra closing span element.
Jimmy Cuadra [Sat, 11 Feb 2017 15:10:03 +0000 (07:10 -0800)]
Remove extra closing span element.

7 years agorustdoc: Only include a stability span if needed.
Jimmy Cuadra [Sat, 11 Feb 2017 12:16:13 +0000 (04:16 -0800)]
rustdoc: Only include a stability span if needed.

7 years agoChange test for being on nixos again
Andrew Cann [Sat, 11 Feb 2017 08:17:54 +0000 (16:17 +0800)]
Change test for being on nixos again

7 years agoAuto merge of #39736 - frewsxcv:rollup, r=frewsxcv
bors [Sat, 11 Feb 2017 07:18:21 +0000 (07:18 +0000)]
Auto merge of #39736 - frewsxcv:rollup, r=frewsxcv

Rollup of 9 pull requests

- Successful merges: #39174, #39660, #39676, #39692, #39701, #39710, #39721, #39724, #39725
- Failed merges:

7 years agoRebase fallout
Simonas Kazlauskas [Fri, 10 Feb 2017 18:19:32 +0000 (20:19 +0200)]
Rebase fallout

Because certain somebody sucks at resolving big conflicts

7 years agoAdd `swap` method for `Cell`
Charlie Fan [Fri, 10 Feb 2017 08:38:59 +0000 (16:38 +0800)]
Add `swap` method for `Cell`

7 years agoChange test for being on NixOS
Andrew Cann [Sat, 11 Feb 2017 05:01:37 +0000 (13:01 +0800)]
Change test for being on NixOS

7 years agoRollup merge of #39725 - Aaronepower:master, r=steveklabnik
Corey Farwell [Sat, 11 Feb 2017 04:41:40 +0000 (23:41 -0500)]
Rollup merge of #39725 - Aaronepower:master, r=steveklabnik

Updated nightly book with installing nightly instructions

7 years agoRollup merge of #39724 - malbarbo:android, r=alexcrichton
Corey Farwell [Sat, 11 Feb 2017 04:41:39 +0000 (23:41 -0500)]
Rollup merge of #39724 - malbarbo:android, r=alexcrichton

Allow rustc data structures compile to android

flock structure is defined in asm*/fcntl.h. This file on android is
generated from the linux kernel source, so they are the same.

7 years agoRollup merge of #39721 - whataloadofwhat:catch-unwind-bang, r=alexcrichton
Corey Farwell [Sat, 11 Feb 2017 04:41:38 +0000 (23:41 -0500)]
Rollup merge of #39721 - whataloadofwhat:catch-unwind-bang, r=alexcrichton

Change std::panicking::try::Data into a union

No longer potentially call `mem::uninitialized::<!>()`

Fixes #39432

7 years agoRollup merge of #39710 - brson:151notes, r=alexcrichton
Corey Farwell [Sat, 11 Feb 2017 04:41:37 +0000 (23:41 -0500)]
Rollup merge of #39710 - brson:151notes, r=alexcrichton

Update 1.15.1 relnotes

Matching what is on stable.

7 years agoRollup merge of #39701 - sgrif:sg-vec-reserve-docs, r=alexcrichton
Corey Farwell [Sat, 11 Feb 2017 04:41:36 +0000 (23:41 -0500)]
Rollup merge of #39701 - sgrif:sg-vec-reserve-docs, r=alexcrichton

Explicitly mention that `Vec::reserve` is based on len not capacity

I spent a good chunk of time tracking down a buffer overrun bug that
resulted from me mistakenly thinking that `reserve` was based on the
current capacity not the current length. It would be helpful if this
were called out explicitly in the docs.

7 years agoRollup merge of #39692 - oli-obk:patch-2, r=aturon
Corey Farwell [Sat, 11 Feb 2017 04:41:35 +0000 (23:41 -0500)]
Rollup merge of #39692 - oli-obk:patch-2, r=aturon

remove wrong packed struct test

This UB was found by running the test under [Miri](https://github.com/solson/miri) which rejects these unsafe unaligned loads. :smile:

7 years agoRollup merge of #39676 - alexcrichton:fix-again, r=brson
Corey Farwell [Sat, 11 Feb 2017 04:41:34 +0000 (23:41 -0500)]
Rollup merge of #39676 - alexcrichton:fix-again, r=brson

Actually fix manifest generation

The previous fix contained an error where `toml::encode` returned a runtime
error, so this version just constructs a literal `toml::Value`.

7 years agoRollup merge of #39660 - alexcrichton:shasum-dirs, r=brson
Corey Farwell [Sat, 11 Feb 2017 04:41:33 +0000 (23:41 -0500)]
Rollup merge of #39660 - alexcrichton:shasum-dirs, r=brson

Don't include directory names in shasums

Right now we just run `shasum` on an absolute path but right now the shasum
files only include filenames, so let's use `current_dir` and just the file name
to only have the file name emitted.

7 years agoRollup merge of #39174 - rspeer:iter-nth-doc-fix, r=alexcrichton
Corey Farwell [Sat, 11 Feb 2017 04:41:32 +0000 (23:41 -0500)]
Rollup merge of #39174 - rspeer:iter-nth-doc-fix, r=alexcrichton

Fix a misleading statement in `Iterator.nth()`

The `Iterator.nth()` documentation says "Note that all preceding elements will be consumed". I assumed from that that the preceding elements would be the *only* ones that were consumed, but in fact the returned element is consumed as well.

The way I read the documentation, I assumed that `nth(0)` would not discard anything (there are 0 preceding elements, and maybe it just peeks at the start of the iterator somehow), so I added a sentence clarifying that it does. I also rephrased it to avoid the stunted "i.e." phrasing.

7 years agoAuto merge of #39642 - stjepang:specialize-slice-partialord, r=alexcrichton
bors [Sat, 11 Feb 2017 04:37:27 +0000 (04:37 +0000)]
Auto merge of #39642 - stjepang:specialize-slice-partialord, r=alexcrichton

Specialize `PartialOrd<A> for [A] where A: Ord`

This way we can call `cmp` instead of `partial_cmp` in the loop, removing some burden of optimizing `Option`s away from the compiler.

PR #39538 introduced a regression where sorting slices suddenly became slower, since `slice1.lt(slice2)` was much slower than `slice1.cmp(slice2) == Less`. This problem is now fixed.

To verify, I benchmarked this simple program:
```rust
fn main() {
    let mut v = (0..2_000_000).map(|x| x * x * x * 18913515181).map(|x| vec![x, x ^ 3137831591]).collect::<Vec<_>>();
    v.sort();
}
```

Before this PR, it would take 0.95 sec, and now it takes 0.58 sec.
I also tried changing the `is_less` lambda to use `cmp` and `partial_cmp`. Now all three versions (`lt`, `cmp`, `partial_cmp`) are equally performant for sorting slices - all of them take 0.58 sec on the
benchmark.

Tangentially, as soon as we get `default impl`, it might be a good idea to implement a blanket default impl for `lt`, `gt`, `le`, `ge` in terms of `cmp` whenever possible. Today, those four functions by default are only implemented in terms of `partial_cmp`.

r? @alexcrichton

7 years agoFix ICE on certain sequence repetitions.
Jeffrey Seyfried [Fri, 10 Feb 2017 23:23:11 +0000 (23:23 +0000)]
Fix ICE on certain sequence repetitions.

7 years agoAuto merge of #39490 - RReverser:em-linker, r=alexcrichton
bors [Fri, 10 Feb 2017 23:50:46 +0000 (23:50 +0000)]
Auto merge of #39490 - RReverser:em-linker, r=alexcrichton

Add Emscripten-specific linker

Emscripten claims to accept most GNU linker options, but in fact most of `-Wl,...` are useless for it and instead it requires some additional special options which are easier to handle in a separate trait.

Currently added:
 - `export_symbols`: works on executables as special Emscripten case since staticlibs/dylibs aren't compiled to JS, while exports are required to be accessible from JS.
Fixes #39171.
 - `optimize` - translates Rust's optimization level to Emscripten optimization level (whether passed via `-C opt-level=...` or `-O...`).
Fixes #36899.
 - `debuginfo` - translates debug info; Emscripten has 5 debug levels while Rust has 3, so chose to translate `-C debuginfo=1` to `-g3` (preserves whitespace, variable and function names for easy debugging).
Fixes #36901.
 - `no_default_libraries` - tells Emscripten to exclude `memcpy` and co.

TODO (in future PR): dynamic linking via `SIDE_MODULE` / `MAIN_MODULE` mechanism.

7 years agoAuto merge of #39438 - clarcharr:box_from, r=alexcrichton
bors [Fri, 10 Feb 2017 21:11:29 +0000 (21:11 +0000)]
Auto merge of #39438 - clarcharr:box_from, r=alexcrichton

Conversions between slices and boxes

This allows conversion for `Copy` slices, `str`, and `CStr` into their boxed counterparts.

This also adds the method `CString::into_boxed_c_str`.

I would like to add similar implementations for `OsStr` as well, but I have not figured out how.

7 years agoChange std::panicking::try::Data into a union
whataloadofwhat [Fri, 10 Feb 2017 17:55:00 +0000 (17:55 +0000)]
Change std::panicking::try::Data into a union

No longer potentially call `mem::uninitialized::<!>()`

Fixes #39432

7 years agoUpdated installing nightly instructions
Aaron Power [Fri, 10 Feb 2017 18:44:32 +0000 (18:44 +0000)]
Updated installing nightly instructions

7 years agoAllow rustc data structures compile to android
Marco A L Barbosa [Fri, 10 Feb 2017 18:28:42 +0000 (16:28 -0200)]
Allow rustc data structures compile to android

flock structure is defined in asm*/fcntl.h. This file on android is
generated from the linux kernel source, so they are the same.

7 years agoFix intcast, use it where appropriate
Simonas Kazlauskas [Fri, 10 Feb 2017 17:29:39 +0000 (19:29 +0200)]
Fix intcast, use it where appropriate