Commit Graph

61418 Commits

Author SHA1 Message Date
Corey Farwell
c2ea734734 Rollup merge of #39730 - jseyfried:fix_empty_seq_rep_ice, r=nrc
macros: fix ICE on certain sequence repetitions

Fixes #39709.
r? @nrc
2017-02-14 10:07:30 -05:00
Corey Farwell
651a5be270 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.
2017-02-14 10:07:29 -05:00
bors
48bc08247a 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
2017-02-14 07:06:25 +00:00
bors
55013cddef 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.
2017-02-14 04:29:26 +00:00
bors
61b93bd811 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.
2017-02-14 01:26:10 +00:00
Eduard-Mihai Burtescu
d29f0bc8fa Automatically vendor Cargo deps when building the source tarballs. 2017-02-14 01:52:03 +02:00
Zack Weinberg
162240c744 Add feature annotations to the doctests for ascii_ctype. 2017-02-13 18:44:43 -05:00
bors
0af0b580c2 Auto merge of #39787 - frewsxcv:rollup, r=frewsxcv
Rollup of 5 pull requests

- Successful merges: #39716, #39758, #39759, #39774, #39784
- Failed merges:
2017-02-13 20:45:26 +00:00
Zack Weinberg
c2566f638a Squeeze URL lines under 100 chars wide to make tidy happy. 2017-02-13 11:46:29 -05:00
Corey Farwell
2a030bf6f1 Rollup merge of #39784 - king6cong:master, r=GuillaumeGomez
typo fix
2017-02-13 10:58:53 -05:00
Corey Farwell
e9abf4bbf3 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.
2017-02-13 10:58:52 -05:00
Corey Farwell
1871bff611 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.
2017-02-13 10:58:51 -05:00
Corey Farwell
41487111b1 Rollup merge of #39758 - shepmaster:e0089-duplicate-text, r=GuillaumeGomez
Remove duplicated "parameter" in E0089 text

Closes #39732
2017-02-13 10:58:50 -05:00
Corey Farwell
5b79f33c65 Rollup merge of #39716 - F001:swapCell, r=alexcrichton
Add `swap` method for `Cell`

Addition to #39264

r? @alexcrichton
2017-02-13 10:58:48 -05:00
Jake Goulding
1c998416ee 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".
2017-02-13 09:08:55 -05:00
Jake Goulding
79d32e9948 Remove duplicated "parameter" in E0089 text
Closes #39732
2017-02-13 09:08:55 -05:00
king6cong
8443c1e3b0 typo fix 2017-02-13 18:41:45 +08:00
bors
717ac960b5 Auto merge of #39778 - ahmedcharles:docs, r=frewsxcv
Fix some typos in the core::fmt docs.
2017-02-13 09:04:09 +00:00
bors
05a7f25cc4 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
2017-02-13 02:32:09 +00:00
Ahmed Charles
9cf4972c84 Fix some typos in the core::fmt docs. 2017-02-12 18:18:22 -08:00
Corey Farwell
6194a7643c Remove '--disable-rustbuild' option from configure script.
Fixes https://github.com/rust-lang/rust/issues/39762.
2017-02-12 19:16:22 -05:00
bors
956e2bcbaa 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
2017-02-12 23:21:15 +00:00
Shawn Walker-Salas
3807e1f393 fix portability issue in error handling of build_triple 2017-02-12 11:25:00 -08:00
bors
81bd2675ea Auto merge of #39769 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests

- Successful merges: #39654, #39662, #39697, #39740, #39743, #39756, #39760
- Failed merges:
2017-02-12 18:16:54 +00:00
Guillaume Gomez
2f3dc95778 Rollup merge of #39760 - shepmaster:struct-init-doc, r=GuillaumeGomez
Improve grammar on field init docs
2017-02-12 19:16:34 +01:00
Guillaume Gomez
fd006ad5a5 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 `?`
2017-02-12 19:16:33 +01:00
Guillaume Gomez
461efc734b Rollup merge of #39743 - GuillaumeGomez:rustdoc-test-output, r=alexcrichton
Add tested item in the rustdoc --test output

r? @alexcrichton

cc @SergioBenitez
2017-02-12 19:16:32 +01:00
Guillaume Gomez
74204a0ce7 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!
2017-02-12 19:16:31 +01:00
Guillaume Gomez
0095ec25cc 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
2017-02-12 19:16:30 +01:00
Guillaume Gomez
747b9e590f Rollup merge of #39662 - Henning-K:patch-1, r=frewsxcv
Fixes #39661

Clarifies the potential ambiguity.
2017-02-12 19:16:29 +01:00
Guillaume Gomez
be0e7498f0 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]`.
2017-02-12 19:16:28 +01:00
Eduard-Mihai Burtescu
42c1ea2915 Nuke src/vendor. 2017-02-12 17:50:54 +02:00
bors
282fa87b55 Auto merge of #39680 - canndrew:uninhabited_from-infinite-loop, r=arielb1
Add recursion limit to inhabitedness check

Fixes #39489.
Add test aswell.
2017-02-12 07:20:31 +00:00
Jeffrey Seyfried
2cc61eebb7 Allow using inert attributes from proc_macro_derives with #![feature(proc_macro)]. 2017-02-12 07:20:04 +00:00
Shawn Walker-Salas
4a618fee1e fix exception handling for isainfo execution failure
remove unnecessary gcc_s addition in libstd for Solaris
2017-02-11 22:56:23 -08:00
Jake Goulding
037ef0bbc8 Improve grammar on field init docs 2017-02-11 23:42:39 -05:00
Shawn Walker-Salas
33b655e6a8 fix copy pasta
Don't need to catch WindowsError.  That was very silly of me.
2017-02-11 20:38:13 -08:00
Shawn Walker-Salas
ee54be3c9a Add Solaris as recognized ostype
Add cputype recognition for Solaris

Fixes #39729
2017-02-11 20:28:44 -08:00
bors
410d807e46 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,);
  |                    ^
```
2017-02-12 03:34:57 +00:00
Jeffrey Seyfried
4b413bc393 Move legacy custom derives collection into resolver.find_attr_invoc(). 2017-02-12 03:22:52 +00:00
Jordi Polo
6b5c5f29ce Sustitutes try! for ? in the Result documentation 2017-02-12 11:02:55 +09:00
bors
912bc14a6b 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.
2017-02-12 00:54:57 +00:00
bors
ba7cf7cc5d 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()`.
2017-02-11 22:10:53 +00:00
Matt Ickstadt
aebce5bd2a Fix as_ptr() drop problem 2017-02-11 15:41:03 -06:00
Matt Ickstadt
68fff62542 [LLVM 4.0] Fix CreateCompileUnit 2017-02-11 15:15:28 -06:00
Alexander Battisti
0a4c268a6b removed trailing whitespace 2017-02-11 20:04:05 +01:00
Jimmy Cuadra
1fa9dbc00e Use functional transformations on the option instead of matching. 2017-02-11 10:00:56 -08:00
Guillaume Gomez
c951ed7fb6 Add tested item in the rustdoc --test output 2017-02-11 16:36:31 +01:00
Jimmy Cuadra
bd14c7f333 Remove extra closing span element. 2017-02-11 07:10:03 -08:00
Jimmy Cuadra
c603839d5f rustdoc: Only include a stability span if needed. 2017-02-11 04:16:13 -08:00