]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAuto merge of #42533 - Mark-Simulacrum:macro-parse-speed-small, r=jseyfried
bors [Sat, 10 Jun 2017 06:50:12 +0000 (06:50 +0000)]
Auto merge of #42533 - Mark-Simulacrum:macro-parse-speed-small, r=jseyfried

Speed up expansion

This reduces duplication, thereby increasing expansion speed. Based on tests with rust-uinput, this produces a 29x performance win (440 seconds to 15 seconds). I want to land this first, since it's a minimal patch, but with more changes to the macro parsing I can get down to 12 seconds locally.

There is one FIXME added to the code that I'll keep for now since changing it will spread outward and increase the patch size, I think.

Fixes #37074.

r? @jseyfried
cc @oberien

7 years agoAuto merge of #42573 - frewsxcv:rollup, r=frewsxcv
bors [Fri, 9 Jun 2017 23:19:49 +0000 (23:19 +0000)]
Auto merge of #42573 - frewsxcv:rollup, r=frewsxcv

Rollup of 5 pull requests

- Successful merges: #42307, #42385, #42531, #42551, #42558
- Failed merges:

7 years agoRollup merge of #42558 - xfq:patch-1, r=steveklabnik
Corey Farwell [Fri, 9 Jun 2017 22:29:29 +0000 (18:29 -0400)]
Rollup merge of #42558 - xfq:patch-1, r=steveklabnik

Update TRPL link in README.md

7 years agoRollup merge of #42551 - tshepang:better-cell-replace-docs, r=steveklabnik
Corey Farwell [Fri, 9 Jun 2017 22:29:28 +0000 (18:29 -0400)]
Rollup merge of #42551 - tshepang:better-cell-replace-docs, r=steveklabnik

doc: a more complete explanation, and a better example

7 years agoRollup merge of #42531 - mmatyas:aarch64_compile-test_fix, r=nagisa
Corey Farwell [Fri, 9 Jun 2017 22:29:27 +0000 (18:29 -0400)]
Rollup merge of #42531 - mmatyas:aarch64_compile-test_fix, r=nagisa

Ignore variadic FFI test on AArch64

I've cross compiled Rust to `aarch64-linux-gnu`, and tried to run the compile-fail tests, but `variadic-ffi.rs` fails with the following error:

```
The ABI `"stdcall"` is not supported for the current target [E0570]
```

The test seems to be ignored on (32-bit) ARM, so I turned it off for AArch64 too.

7 years agoRollup merge of #42385 - Manishearth:its-a-vec, r=steveklabnik
Corey Farwell [Fri, 9 Jun 2017 22:29:26 +0000 (18:29 -0400)]
Rollup merge of #42385 - Manishearth:its-a-vec, r=steveklabnik

Vec<T> is pronounced 'vec'

I've never heard it pronounced "vector". Is this an outdated recommendation?

(or have I been doing it wrong all this time)

r? @steveklabnik

7 years agoRollup merge of #42307 - clarcharr:js-license, r=frewsxcv
Corey Farwell [Fri, 9 Jun 2017 22:29:25 +0000 (18:29 -0400)]
Rollup merge of #42307 - clarcharr:js-license, r=frewsxcv

Make rustdoc.js use license comments.

This will ensure that JS minifiers and the like will preserve the license statement even after minimisation.

7 years agoAuto merge of #42278 - gentoo90:gdb-pretty-printers, r=michaelwoerister
bors [Fri, 9 Jun 2017 18:17:15 +0000 (18:17 +0000)]
Auto merge of #42278 - gentoo90:gdb-pretty-printers, r=michaelwoerister

Fix GDB pretty-printer for tuples and pointers

Names of children should not be the same, because GDB uses them to distinguish the children.

|Before|After|
|---|---|
|![tuples_before](https://cloud.githubusercontent.com/assets/1297574/26527639/5d6cf10e-43a0-11e7-9498-abfcddb08055.png)|![tuples_after](https://cloud.githubusercontent.com/assets/1297574/26527655/9699233a-43a0-11e7-83c6-f58f713b51a0.png)|

`main.rs`
```rust
enum Test {
    Zero,
    One(i32),
    Two(i32, String),
    Three(i32, String, Vec<String>),
}

fn main() {
    let tuple = (1, 2, "Asdfgh");
    let zero = Test::Zero;
    let one = Test::One(10);
    let two = Test::Two(42, "Qwerty".to_owned());
    let three = Test::Three(9000,
                            "Zxcvbn".to_owned(),
                            vec!["lorem".to_owned(), "ipsum".to_owned(), "dolor".to_owned()]);
    println!(""); // breakpoint here
}
```

`launch.json`
```json
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "gdb",
            "request": "launch",
            "gdbpath": "rust-gdb",
            "name": "Launch Program",
            "valuesFormatting": "prettyPrinters", //this requires plugin Native Debug >= 0.20.0
            "target": "./target/debug/test_pretty_printers",
            "cwd": "${workspaceRoot}"
        }
    ]
}
```

7 years agoAdd compat_str() which works with unicode in both Python 2 and 3
gentoo90 [Fri, 9 Jun 2017 16:09:02 +0000 (19:09 +0300)]
Add compat_str() which works with unicode in both Python 2 and 3

GDB can be built with Python 2 or with Python 3

7 years agoPretty-printers tests: gdbr -> gdb
gentoo90 [Fri, 9 Jun 2017 15:51:28 +0000 (18:51 +0300)]
Pretty-printers tests: gdbr -> gdb

7 years agoAuto merge of #42507 - ibabushkin:external-span-trans, r=eddyb
bors [Fri, 9 Jun 2017 12:49:49 +0000 (12:49 +0000)]
Auto merge of #42507 - ibabushkin:external-span-trans, r=eddyb

Fix translation of external spans

Previously, I noticed that spans from external crates don't generate any output. This limitation is problematic if analysis is performed on one or more external crates, as is the case with [rust-semverver](https://github.com/ibabushkin/rust-semverver). This change should address this behaviour, with the potential drawback that a minor performance hit is to be expected, as spans from potentially large crates have to be translated now.

7 years agoAuto merge of #42521 - alexcrichton:enosys, r=cuviper
bors [Fri, 9 Jun 2017 10:28:12 +0000 (10:28 +0000)]
Auto merge of #42521 - alexcrichton:enosys, r=cuviper

std: Handle ENOSYS when calling `pipe2`

Should help fix an accidental regression from #39386.

7 years agoAuto merge of #42504 - michaelwoerister:hash-dep-nodes-prep, r=nikomatsakis
bors [Fri, 9 Jun 2017 08:03:14 +0000 (08:03 +0000)]
Auto merge of #42504 - michaelwoerister:hash-dep-nodes-prep, r=nikomatsakis

Some preparatory refactorings for hash-based DepNodes

This PR collects some changes that turn out to be necessary for implementing `DepNodes` based on stable hashes (see #42294). The commits are self-contained and mostly straightforward.

The most interesting change here is the introduction of `DefIndices` for things that are not part of the AST: Some pieces of crate metadata now have a `DefIndex` too.

cc @eddyb
r? @nikomatsakis

7 years agoUpdate TRPL link in README.md
Fuqiao Xue [Fri, 9 Jun 2017 05:37:22 +0000 (13:37 +0800)]
Update TRPL link in README.md

7 years agoAuto merge of #42027 - mjkillough:typedef_assoc_items, r=QuietMisdreavus
bors [Fri, 9 Jun 2017 04:09:39 +0000 (04:09 +0000)]
Auto merge of #42027 - mjkillough:typedef_assoc_items, r=QuietMisdreavus

Document direct implementations on type aliases.

This improves #32077, but is not a complete fix.

For a type alias `type NewType = AliasedType`, it will include any `impl NewType` and `impl
Trait for NewType` blocks in the documentation for `NewType`.

A complete fix would include the implementations from the aliased type in the type alias' documentation, so that users have a complete picture of methods that are available on the alias. However, to do this properly would require a fix for #14072, as the alias may affect the type parameters of the type alias, making the documentation difficult to understand. (That is, for `type Result = std::result::Result<(), ()>` we would ideally show documentation for `impl Result<(), ()>`, rather than generic documentation for `impl<T, E> Result<T, E>`).

I think this improvement is worthwhile, as it exposes implementations which are not currently documented by rustdoc. The documentation for the implementations on the aliased type are still accessible by clicking through to the docs for that type. (Although perhaps it's now less obvious to the user that they should click-through to get there).

7 years agoDocument direct implementations on type aliases.
Michael Killough [Tue, 16 May 2017 06:16:44 +0000 (13:16 +0700)]
Document direct implementations on type aliases.

This improves #32077, but is not a complete fix. For a type alias `type
NewType = AliasedType`, it will include any `impl NewType` and `impl
Trait for NewType` blocks in the documentation for `NewType`.

A complete fix would include the implementations from the aliased type
in the type alias' documentation, so that users have a complete
picture of methods that are available on the alias. However, to do this
properly would require a fix for #14072, as the alias may affect the
type parameters of the type alias, making the documentation difficult to
understand. (That is, for `type Result = std::result::Result<(), ()>` we
would ideally show documentation for `impl Result<(), ()>`, rather than
generic documentation for `impl<T, E> Result<T, E>`).

I think this improvement is worthwhile, as it exposes implementations
which are not currently documented by rustdoc. The documentation for the
implementations on the aliased type are still accessible by clicking
through to the docs for that type. (Although perhaps it's now less
obvious to the user that they should click-through to get there).

7 years agoAuto merge of #42491 - RalfJung:bootstrap-help, r=alexcrichton
bors [Thu, 8 Jun 2017 22:21:29 +0000 (22:21 +0000)]
Auto merge of #42491 - RalfJung:bootstrap-help, r=alexcrichton

bootstrap: improve 'build --help' by explaining what exactly the last example does

I recently found myself confused about what exactly gets built how often when I run which command; I think this would have helped me.

One thing I did not touch, but I feel could also be improved, is the wording just above: "For a quick build with a usable compile, you can pass".  I am not a native speaker, but this sounds odd to me. Do you mean "For a quick build of a usable compiler" (but then it should say where the usable compiler is produced)? Or do you mean "For a quick build testing if the compiler is usable"? I can reword this, but I'd like to make sure I understand the intent of the message.

What about
```
    For a quick build of a usable compiler, you can pass:

        ./x.py build --stage 1 src/libtest

    This will first build everything once (like --stage 0 without further
    arguments would), and then use the compiler built in stage 0 to build
    src/libtest and its dependencies.
    Once this is done, build/$ARCH/stage1 contains a usable compiler.
```
However, I am not sure this is actually true. In particular, why even bother building the libstd in stage 1? AFAIK that ends up in `build/*/stage1-std`, not in `build/*/stage1` (which is filled from `build/*/stage0-*`).

7 years agodoc: a more complete explanation, and a better example
Tshepang Lekhonkhobe [Thu, 8 Jun 2017 20:46:11 +0000 (22:46 +0200)]
doc: a more complete explanation, and a better example

7 years agoAuto merge of #42487 - alexcrichton:smaller-personality, r=vadimcn
bors [Thu, 8 Jun 2017 19:52:53 +0000 (19:52 +0000)]
Auto merge of #42487 - alexcrichton:smaller-personality, r=vadimcn

std: Avoid panics in rust_eh_personality

This commit removes a few calls to panic and/or assert in `rust_eh_personality`.
This function definitely can't itself panic (that'd probably segfault or do
something else weird) and I was also noticing that a `pub extern fn foo() {}`
cdylib was abnormally large. Turns out all that size was the panicking machinery
brought in by the personality function!

The change here is to return a `Result` internally so we can bubble up the fatal
error, eventually translating to the appropriate error code for the libunwind
ABI.

7 years agoSpeed up expansion.
Mark Simulacrum [Thu, 8 Jun 2017 11:51:32 +0000 (05:51 -0600)]
Speed up expansion.

This reduces duplication, thereby increasing expansion speed.

7 years agostd: Handle ENOSYS when calling `pipe2`
Alex Crichton [Thu, 8 Jun 2017 01:31:35 +0000 (18:31 -0700)]
std: Handle ENOSYS when calling `pipe2`

Should help fix an accidental regression from #39386.

7 years agostd: Avoid panics in rust_eh_personality
Alex Crichton [Tue, 6 Jun 2017 18:34:10 +0000 (11:34 -0700)]
std: Avoid panics in rust_eh_personality

This commit removes a few calls to panic and/or assert in `rust_eh_personality`.
This function definitely can't itself panic (that'd probably segfault or do
something else weird) and I was also noticing that a `pub extern fn foo() {}`
cdylib was abnormally large. Turns out all that size was the panicking machinery
brought in by the personality function!

The change here is to return a `Result` internally so we can bubble up the fatal
error, eventually translating to the appropriate error code for the libunwind
ABI.

7 years agoAuto merge of #42500 - hsivonen:neon, r=japaric
bors [Thu, 8 Jun 2017 13:52:13 +0000 (13:52 +0000)]
Auto merge of #42500 - hsivonen:neon, r=japaric

Change `llvm.neon.*` to `llvm.arm.neon.*` in the mapping for platform intrinsics

This avoids linker errors when using platform intrinsics on 32-bit ARM with
NEON.

Fixes rust-lang-nursery/simd#10.

I don't have an explanation why the old code might have worked when the `simd` crate was written, since the new LLVM intrinsic naming seems to have existed as early as 2012. Maybe LLVM accepted two naming schemes for a few years and dropped the `llvm.neon.*` version recently? I don't know.

Also, I don't know how to write a unit test for this.

7 years agoAuto merge of #42489 - eddyb:untyped-stmts, r=nikomatsakis
bors [Thu, 8 Jun 2017 11:18:45 +0000 (11:18 +0000)]
Auto merge of #42489 - eddyb:untyped-stmts, r=nikomatsakis

Statements do not have types.

Past refactors accidentally left in some dead type-checking code - nothing reads the always-`()` types.

r? @nikomatsakis

7 years agoIgnore variadic FFI test on AArch64
Mátyás Mustoha [Thu, 8 Jun 2017 10:03:08 +0000 (12:03 +0200)]
Ignore variadic FFI test on AArch64

7 years agoAuto merge of #42443 - tommyip:better_closure_msg, r=nikomatsakis
bors [Thu, 8 Jun 2017 08:37:48 +0000 (08:37 +0000)]
Auto merge of #42443 - tommyip:better_closure_msg, r=nikomatsakis

Better closure error message

Use tracked data introduced in #42196 to provide a better closure
error message by showing why a closure implements `FnOnce`.

```
error[E0525]: expected a closure that implements the `Fn` trait, but
this closure only implements `FnOnce`
 --> $DIR/issue_26046.rs:4:19
  |
4 |       let closure = move || {
  |  ___________________^
5 | |         vec
6 | |     };
  | |_____^
  |
note: closure is `FnOnce` because it moves the variable `vec` out of
its environment
 --> $DIR/issue_26046.rs:5:9
  |
5 |         vec
  |         ^^^

error: aborting due to previous error(s)
```

Fixes #26046

r? @nikomatsakis
cc @doomrobo

7 years agoAuto merge of #42481 - brson:wingnu, r=alexcrichton
bors [Thu, 8 Jun 2017 06:02:04 +0000 (06:02 +0000)]
Auto merge of #42481 - brson:wingnu, r=alexcrichton

Fix setting PATH during linkage on windows-gnu

This makes the behavior almost exactly the same as before the VS2017 patch, except that on MSVC builds the host bin path is no longer added to PATH. I am not sure that's actually necessary on any platform.

r? @alexcrichton

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

7 years agobootstrap: further clarify build --help
Ralf Jung [Thu, 8 Jun 2017 05:08:48 +0000 (22:08 -0700)]
bootstrap: further clarify build --help

7 years agoAuto merge of #42522 - frewsxcv:rollup, r=frewsxcv
bors [Thu, 8 Jun 2017 03:46:16 +0000 (03:46 +0000)]
Auto merge of #42522 - frewsxcv:rollup, r=frewsxcv

Rollup of 5 pull requests

- Successful merges: #42470, #42490, #42497, #42510, #42512
- Failed merges:

7 years agoMake rustdoc.js use license comments.
Clar Charr [Tue, 30 May 2017 04:17:11 +0000 (00:17 -0400)]
Make rustdoc.js use license comments.

7 years agoRollup merge of #42512 - Keruspe:master, r=alexcrichton
Corey Farwell [Thu, 8 Jun 2017 01:58:46 +0000 (21:58 -0400)]
Rollup merge of #42512 - Keruspe:master, r=alexcrichton

update git2

Fixes build with libressl

7 years agoRollup merge of #42510 - mbrubeck:docs, r=QuietMisdreavus
Corey Farwell [Thu, 8 Jun 2017 01:58:45 +0000 (21:58 -0400)]
Rollup merge of #42510 - mbrubeck:docs, r=QuietMisdreavus

Update step_by docs to say iterator instead of range

None

7 years agoRollup merge of #42497 - qnighy:just-use-try-in-three-places, r=eddyb
Corey Farwell [Thu, 8 Jun 2017 01:58:45 +0000 (21:58 -0400)]
Rollup merge of #42497 - qnighy:just-use-try-in-three-places, r=eddyb

Replace some matches with try.

This patch just replaces `match`es with `?` in the compiler, which I came across when I'm reading the parser.

7 years agoRollup merge of #42490 - gaurikholkar:master, r=eddyb
Corey Farwell [Thu, 8 Jun 2017 01:58:44 +0000 (21:58 -0400)]
Rollup merge of #42490 - gaurikholkar:master, r=eddyb

Changing error message from `contains interior mutability` to `may contain interior mutability`

Fixes #40313 . I have changed the message from `contains interior mutability` to `may contain interior mutability` for the following example
```
use std::cell::Cell;
use std::panic::catch_unwind;
fn main() {
    let mut x = Cell::new(22);
    catch_unwind(|| { x.set(23); });
}
```
which has been added as a ui test.

Also, the message [here](https://github.com/gaurikholkar/rust/blob/master/src/librustc_mir/transform/qualify_consts.rs#L666) and it's respective `compile-fail` test have been modified.

cc @nikomatsakis  @Mark-Simulacrum  @eddyb

7 years agoRollup merge of #42470 - frewsxcv:frewsxcv/ffi-cstr-doc-examples, r=QuietMisdreavus
Corey Farwell [Thu, 8 Jun 2017 01:58:43 +0000 (21:58 -0400)]
Rollup merge of #42470 - frewsxcv:frewsxcv/ffi-cstr-doc-examples, r=QuietMisdreavus

Add doc examples for `CString` methods.

None

7 years agoAuto merge of #40706 - irfanhudda:doc-next-power-of-two, r=alexcrichton
bors [Thu, 8 Jun 2017 01:07:08 +0000 (01:07 +0000)]
Auto merge of #40706 - irfanhudda:doc-next-power-of-two, r=alexcrichton

Improve documentation of next_power_of_two

Clarify overflow behavior of `next_power_of_two`.

Related Issue: #18604

7 years agoAuto merge of #42447 - alexcrichton:update-cargo, r=petrochenkov
bors [Wed, 7 Jun 2017 22:48:15 +0000 (22:48 +0000)]
Auto merge of #42447 - alexcrichton:update-cargo, r=petrochenkov

Update Cargo

Brings in some perf improvements!

7 years agoCover all cases in closure errors
Tommy Ip [Wed, 7 Jun 2017 20:26:28 +0000 (21:26 +0100)]
Cover all cases in closure errors

7 years agoupdate git2
Marc-Antoine Perennou [Wed, 7 Jun 2017 19:42:17 +0000 (21:42 +0200)]
update git2

Fixes build with libressl

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
7 years agoUpdate docs to say iterator instead of range
Matt Brubeck [Wed, 7 Jun 2017 16:24:35 +0000 (09:24 -0700)]
Update  docs to say iterator instead of range

7 years agoAuto merge of #42378 - steveklabnik:rustdoc-docs, r=frewsxcv
bors [Wed, 7 Jun 2017 15:16:46 +0000 (15:16 +0000)]
Auto merge of #42378 - steveklabnik:rustdoc-docs, r=frewsxcv

The Rustdoc book

A work-in-progress start for docs for rustdoc.

This doesn't actually generate the docs yet; I wanted to open this PR to get feedback on this approach, the chapters headings themselves, and to see if anyone wanted to help fill in the ones that aren't done yet.

Start of #42322.

/cc @rust-lang/dev-tools @rust-lang/docs

7 years agoUpdate Cargo
Alex Crichton [Mon, 5 Jun 2017 16:36:48 +0000 (09:36 -0700)]
Update Cargo

Brings in some perf improvements!

7 years agoFix translation of external spans.
Inokentiy Babushkin [Wed, 7 Jun 2017 14:17:11 +0000 (16:17 +0200)]
Fix translation of external spans.

7 years agoAuto merge of #42486 - eddyb:issue-39882, r=nikomatsakis
bors [Wed, 7 Jun 2017 12:34:13 +0000 (12:34 +0000)]
Auto merge of #42486 - eddyb:issue-39882, r=nikomatsakis

rustc_trans: do not store pair fields if they are ZSTs.

Should help with #39882 even if it's not a complete fix AFAICT.

7 years agoAllocate DefIndices for global crate metadata.
Michael Woerister [Wed, 7 Jun 2017 08:45:20 +0000 (10:45 +0200)]
Allocate DefIndices for global crate metadata.

This allows for treating global crate metadata the same as regular metadata with regard to incr. comp.

7 years agoAuto merge of #42482 - eddyb:issue-42467, r=nikomatsakis
bors [Wed, 7 Jun 2017 10:09:11 +0000 (10:09 +0000)]
Auto merge of #42482 - eddyb:issue-42467, r=nikomatsakis

rustc: T: 'empty always holds for all types.

Fixes #42467 by special-casing `ReEmpty` to always hold, even for parameters.
The reason this is the case is that `ReEmpty` is the result of inferring a region variable with no constraints attached to it, so there is no lifetime a type would contain which would be strictly shorter.

r? @nikomatsakis

7 years agoindentation fixes
gaurikholkar [Wed, 7 Jun 2017 09:22:21 +0000 (02:22 -0700)]
indentation fixes

7 years agoChange `llvm.neon.*` to `llvm.arm.neon.*` in the mapping for platform intrinsics
Henri Sivonen [Wed, 7 Jun 2017 08:17:16 +0000 (11:17 +0300)]
Change `llvm.neon.*` to `llvm.arm.neon.*` in the mapping for platform intrinsics

This avoids linker errors when using platform intrinsics on 32-bit ARM with
NEON.

Fixes rust-lang-nursery/simd#10.

7 years agoAuto merge of #42480 - eddyb:issue-42463, r=nikomatsakis
bors [Wed, 7 Jun 2017 07:52:12 +0000 (07:52 +0000)]
Auto merge of #42480 - eddyb:issue-42463, r=nikomatsakis

rustc_typeck: do not overlap a borrow of TypeckTables with method lookup.

If trait selection is reached, it could potentially request a closure signature, which will have to borrow the `TypeckTables` of the current function, and so those tables *should not* be mutably borrowed.

Fixes #42463.
r? @nikomatsakis

7 years agoAuto merge of #42494 - frewsxcv:rollup, r=frewsxcv
bors [Wed, 7 Jun 2017 04:24:15 +0000 (04:24 +0000)]
Auto merge of #42494 - frewsxcv:rollup, r=frewsxcv

Rollup of 7 pull requests

- Successful merges: #42409, #42415, #42429, #42438, #42466, #42469, #42485
- Failed merges:

7 years agoReplace some matches with try.
Masaki Hara [Sun, 4 Jun 2017 05:10:14 +0000 (14:10 +0900)]
Replace some matches with try.

7 years agoRollup merge of #42485 - Mark-Simulacrum:skip-no-doc, r=alexcrichton
Corey Farwell [Wed, 7 Jun 2017 02:36:37 +0000 (22:36 -0400)]
Rollup merge of #42485 - Mark-Simulacrum:skip-no-doc, r=alexcrichton

Skip printing for skipped doc tests.

Followup to https://github.com/rust-lang/rust/pull/42437 to further reduce noise.

r? @alexcrichton

7 years agoRollup merge of #42469 - citizen428:document-assert-macros, r=steveklabnik
Corey Farwell [Wed, 7 Jun 2017 02:36:36 +0000 (22:36 -0400)]
Rollup merge of #42469 - citizen428:document-assert-macros, r=steveklabnik

Doc changes for assert macros

See #29381

7 years agoRollup merge of #42466 - wesleywiser:fix_42407, r=arielb1
Corey Farwell [Wed, 7 Jun 2017 02:36:35 +0000 (22:36 -0400)]
Rollup merge of #42466 - wesleywiser:fix_42407, r=arielb1

syntax_pos::Symbol should not implement Sync

Fixes #42407

7 years agoRollup merge of #42438 - king6cong:master, r=alexcrichton
Corey Farwell [Wed, 7 Jun 2017 02:36:34 +0000 (22:36 -0400)]
Rollup merge of #42438 - king6cong:master, r=alexcrichton

doc rewording

7 years agoRollup merge of #42429 - venkatagiri:llvm_config, r=alexcrichton
Corey Farwell [Wed, 7 Jun 2017 02:36:34 +0000 (22:36 -0400)]
Rollup merge of #42429 - venkatagiri:llvm_config, r=alexcrichton

rustc_llvm: re-run build script if config.toml changes

closes #35199

7 years agoRollup merge of #42415 - stephen-lazaro:Issue29094, r=arielb1
Corey Farwell [Wed, 7 Jun 2017 02:36:33 +0000 (22:36 -0400)]
Rollup merge of #42415 - stephen-lazaro:Issue29094, r=arielb1

Remove 'elided' from lifetime resolution error

Removes 'elided' from lifetime resolution errors
Removes 'elided' from relevant error messaging tests

This PR resolves https://github.com/rust-lang/rust/issues/29094

r? @Mark-Simulacrum

7 years agoRollup merge of #42409 - bjorn3:patch-3, r=frewsxcv
Corey Farwell [Wed, 7 Jun 2017 02:36:32 +0000 (22:36 -0400)]
Rollup merge of #42409 - bjorn3:patch-3, r=frewsxcv

Better docs

Working on more doc improvements

Edit: done for today

7 years agoAuto merge of #42133 - cuviper:stdio-from, r=alexcrichton
bors [Wed, 7 Jun 2017 02:11:20 +0000 (02:11 +0000)]
Auto merge of #42133 - cuviper:stdio-from, r=alexcrichton

Add conversions from File and Child* handles to Stdio

`Stdio` now implements `From<ChildStdin>`, `From<ChildStdout>`,
`From<ChildStderr>`, and `From<File>`.

The `Command::stdin`/`stdout`/`stderr` methods now take any type that
implements `Into<Stdio>`.

This makes it much easier to write shell-like command chains, piping to
one another and redirecting to and from files.  Otherwise one would need
to use the unsafe and OS-specific `from_raw_fd` or `from_raw_handle`.

7 years agoAdd conversions from File and Child* handles to Stdio
Josh Stone [Tue, 6 Jun 2017 22:42:55 +0000 (15:42 -0700)]
Add conversions from File and Child* handles to Stdio

`Stdio` now implements `From<ChildStdin>`, `From<ChildStdout>`,
`From<ChildStderr>`, and `From<File>`.

The `Command::stdin`/`stdout`/`stderr` methods now take any type that
implements `Into<Stdio>`.

This makes it much easier to write shell-like command chains, piping to
one another and redirecting to and from files.  Otherwise one would need
to use the unsafe and OS-specific `from_raw_fd` or `from_raw_handle`.

7 years agoFix setting PATH during linkage on windows-gnu
Brian Anderson [Tue, 6 Jun 2017 02:07:43 +0000 (19:07 -0700)]
Fix setting PATH during linkage on windows-gnu

7 years agobootstrap: improve 'build --help' by explaining what exactly the last example does
Ralf Jung [Tue, 6 Jun 2017 21:26:56 +0000 (14:26 -0700)]
bootstrap: improve 'build --help' by explaining what exactly the last example does

7 years agoAuto merge of #42361 - GuillaumeGomez:error-codes, r=arielb1
bors [Tue, 6 Jun 2017 20:46:10 +0000 (20:46 +0000)]
Auto merge of #42361 - GuillaumeGomez:error-codes, r=arielb1

Add E0602

Part of #42229.

cc @Susurrus

7 years agoChanging error message for interior mutability, adding ui test
gaurikholkar [Thu, 1 Jun 2017 10:16:26 +0000 (15:46 +0530)]
Changing error message for interior mutability, adding ui test

7 years agoStatements do not have types.
Eduard-Mihai Burtescu [Tue, 6 Jun 2017 19:43:59 +0000 (22:43 +0300)]
Statements do not have types.

7 years agorustc_typeck: do not overlap a borrow of TypeckTables with method lookup.
Eduard-Mihai Burtescu [Tue, 6 Jun 2017 15:50:21 +0000 (18:50 +0300)]
rustc_typeck: do not overlap a borrow of TypeckTables with method lookup.

7 years agorustc_trans: do not store pair fields if they are ZSTs.
Eduard-Mihai Burtescu [Tue, 6 Jun 2017 18:13:13 +0000 (21:13 +0300)]
rustc_trans: do not store pair fields if they are ZSTs.

7 years agoSkip printing for skipped doc tests.
Mark Simulacrum [Tue, 6 Jun 2017 18:00:22 +0000 (12:00 -0600)]
Skip printing for skipped doc tests.

7 years agorustc: T: 'empty always holds forall T.
Eduard-Mihai Burtescu [Tue, 6 Jun 2017 16:50:01 +0000 (19:50 +0300)]
rustc: T: 'empty always holds forall T.

7 years agoAuto merge of #42247 - durka:patch-41, r=arielb1
bors [Tue, 6 Jun 2017 14:46:26 +0000 (14:46 +0000)]
Auto merge of #42247 - durka:patch-41, r=arielb1

add playbot jokes to run-pass test

Some funny expressions that people pull out on IRC, that might actually be useful to test pathological parser behavior.

7 years agoincr.comp.: Make WorkProductId opaque so we don't accidentally rely on being able...
Michael Woerister [Tue, 6 Jun 2017 13:09:21 +0000 (15:09 +0200)]
incr.comp.: Make WorkProductId opaque so we don't accidentally rely on being able to reconstruct obj-file names from one.

7 years agoICH: Add some HashStable implementations.
Michael Woerister [Fri, 2 Jun 2017 15:34:24 +0000 (17:34 +0200)]
ICH: Add some HashStable implementations.

7 years agoICH: Make StableHashingContext work with any TyCtxt, not just the global one.
Michael Woerister [Fri, 2 Jun 2017 13:45:56 +0000 (15:45 +0200)]
ICH: Make StableHashingContext work with any TyCtxt, not just the global one.

7 years agoAuto merge of #42437 - Mark-Simulacrum:skip-no-doc, r=alexcrichton
bors [Tue, 6 Jun 2017 11:10:37 +0000 (11:10 +0000)]
Auto merge of #42437 - Mark-Simulacrum:skip-no-doc, r=alexcrichton

Skip documentation files without ``` when running markdown tests.

This should reduce the 'running 0 tests' noise in builds, and I believe this is a good heuristic for us to use.

cc @rust-lang/docs -- do we use the indented format for code blocks anywhere? Will we? If so, we shouldn't do this.

r? @alexcrichton

7 years agoAuto merge of #42436 - ollie27:win_spawn_name, r=alexcrichton
bors [Tue, 6 Jun 2017 08:38:50 +0000 (08:38 +0000)]
Auto merge of #42436 - ollie27:win_spawn_name, r=alexcrichton

Always quote program name in Command::spawn on Windows

[`CreateProcess`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425.aspx) will interpret args as part of the binary name if it
doesn't find the binary using just the unquoted name. For example if
`foo.exe` doesn't exist, `Command::new("foo").arg("bar").spawn()` will
try to launch `foo bar.exe` which is clearly not desired.

7 years agoGroup closure context ui tests
Tommy Ip [Tue, 6 Jun 2017 08:29:06 +0000 (09:29 +0100)]
Group closure context ui tests

7 years agoAdd additional ui tests for issue 26046
Tommy Ip [Tue, 6 Jun 2017 08:17:06 +0000 (09:17 +0100)]
Add additional ui tests for issue 26046

This tests the FnMut case.

7 years agoUpdate closure errors to emit context for FnMut
Tommy Ip [Tue, 6 Jun 2017 08:06:56 +0000 (09:06 +0100)]
Update closure errors to emit context for FnMut

It now handles both FnMut and FnOnce case.

7 years agoAuto merge of #42394 - ollie27:rustdoc_deref_box, r=QuietMisdreavus
bors [Tue, 6 Jun 2017 06:18:17 +0000 (06:18 +0000)]
Auto merge of #42394 - ollie27:rustdoc_deref_box, r=QuietMisdreavus

rustdoc: Hide `self: Box<Self>` in list of deref methods

These methods can never be called through deref so there is no point including them. For example you can't call [`into_boxed_bytes`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.into_boxed_bytes) or [`into_string`](https://doc.rust-lang.org/nightly/std/string/struct.String.html#method.into_string) on `String`.

7 years agoAdd doc example for `CString::as_bytes`.
Corey Farwell [Tue, 6 Jun 2017 03:50:49 +0000 (23:50 -0400)]
Add doc example for `CString::as_bytes`.

7 years agoAdd doc example for `CString::as_bytes_with_nul`.
Corey Farwell [Tue, 6 Jun 2017 03:49:52 +0000 (23:49 -0400)]
Add doc example for `CString::as_bytes_with_nul`.

7 years agoAdd doc example for `CString::into_bytes_with_nul`.
Corey Farwell [Tue, 6 Jun 2017 03:48:13 +0000 (23:48 -0400)]
Add doc example for `CString::into_bytes_with_nul`.

7 years agoAdd doc example for `CString::into_bytes`.
Corey Farwell [Tue, 6 Jun 2017 03:46:44 +0000 (23:46 -0400)]
Add doc example for `CString::into_bytes`.

7 years agoAdd doc example for `CString::into_raw`.
Corey Farwell [Tue, 6 Jun 2017 03:42:13 +0000 (23:42 -0400)]
Add doc example for `CString::into_raw`.

7 years agoAuto merge of #41990 - qnighy:disallow-underscore-suffix-for-string-like-literals...
bors [Tue, 6 Jun 2017 02:56:17 +0000 (02:56 +0000)]
Auto merge of #41990 - qnighy:disallow-underscore-suffix-for-string-like-literals, r=nikomatsakis

Disallow underscore suffix for string-like literals.

This patch turns string/bytestring/char/byte literals followed by an underscore, like `"Foo"_`, to an error.

`scan_optional_raw_name` will parse `_` as a valid raw name, but it will be rejected by the parser. I also considered just stopping parsing when the suffix is `_`, but in that case `"Foo"_` will be lexed as two valid tokens.

Fixes the latter half of #41723.

7 years agosyntax_pos::Symbol should not implement Sync
Wesley Wiser [Tue, 6 Jun 2017 01:52:34 +0000 (21:52 -0400)]
syntax_pos::Symbol should not implement Sync

Fixes #42407

7 years agoAuto merge of #42452 - raphlinus:mx_job_default, r=alexcrichton
bors [Mon, 5 Jun 2017 21:42:19 +0000 (21:42 +0000)]
Auto merge of #42452 - raphlinus:mx_job_default, r=alexcrichton

[fuchsia] Track change of mx_job_default

The implementation of mx_job_default changed from a macro which
accessed the __magenta_job_default global variable to a proper
function call. This patch tracks that change.

7 years agotidy is an unnecessary roadblock to contributions
Alex Burka [Mon, 5 Jun 2017 21:02:55 +0000 (21:02 +0000)]
tidy is an unnecessary roadblock to contributions

7 years ago[fuchsia] Track change of mx_job_default
Raph Levien [Mon, 5 Jun 2017 18:27:31 +0000 (11:27 -0700)]
[fuchsia] Track change of mx_job_default

The implementation of mx_job_default changed from a macro which
accessed the __magenta_job_default global variable to a proper
function call. This patch tracks that change.

7 years agofix tests
steveklabnik [Mon, 5 Jun 2017 17:14:31 +0000 (13:14 -0400)]
fix tests

7 years agoaddress review feedback
steveklabnik [Mon, 5 Jun 2017 17:09:19 +0000 (13:09 -0400)]
address review feedback

7 years agoAdd run-make test for Command::spawn on Windows
Oliver Middleton [Mon, 5 Jun 2017 16:57:32 +0000 (17:57 +0100)]
Add run-make test for Command::spawn on Windows

Make sure args aren't interpreted as part of the program name.

7 years agoAuto merge of #42414 - frewsxcv:frewsxcv/improve-cow-docs, r=QuietMisdreavus
bors [Mon, 5 Jun 2017 15:38:24 +0000 (15:38 +0000)]
Auto merge of #42414 - frewsxcv:frewsxcv/improve-cow-docs, r=QuietMisdreavus

Improve `Cow` method doc examples.

None

7 years agoAuto merge of #42383 - estebank:candidate-newline, r=arielb1
bors [Mon, 5 Jun 2017 13:07:38 +0000 (13:07 +0000)]
Auto merge of #42383 - estebank:candidate-newline, r=arielb1

Use multiline note for trait suggestion

7 years agoAdd ui tests for issue 26046
Tommy Ip [Mon, 5 Jun 2017 10:35:17 +0000 (11:35 +0100)]
Add ui tests for issue 26046

7 years agoBetter closure error message
Tommy Ip [Mon, 5 Jun 2017 10:14:48 +0000 (11:14 +0100)]
Better closure error message

Use tracked data introduced in #42196 to provide a better closure
error message by showing why a closure implements `FnOnce`.

```
error[E0525]: expected a closure that implements the `Fn` trait, but
this closure only implements `FnOnce`
 --> $DIR/issue_26046.rs:4:19
  |
4 |       let closure = move || {
  |  ___________________^
5 | |         vec
6 | |     };
  | |_____^
  |
note: closure is `FnOnce` because it moves the variable `vec` out of
its environment
 --> $DIR/issue_26046.rs:5:9
  |
5 |         vec
  |         ^^^

error: aborting due to previous error(s)
```

Fixes #26046

7 years agoDoc changes for assert macros
Michael Kohl [Mon, 5 Jun 2017 09:46:12 +0000 (16:46 +0700)]
Doc changes for assert macros

See #29381

7 years agodoc rewording
king6cong [Mon, 5 Jun 2017 02:56:16 +0000 (10:56 +0800)]
doc rewording

7 years agoSkip documentation files without ``` when running markdown tests.
Mark Simulacrum [Sun, 4 Jun 2017 23:55:50 +0000 (17:55 -0600)]
Skip documentation files without ``` when running markdown tests.

This should reduce the 'running 0 tests' noise in builds, and is a good
heuristic for us to use.

7 years agoAuto merge of #42426 - arthurprs:io_error, r=sfackler
bors [Sun, 4 Jun 2017 23:35:21 +0000 (23:35 +0000)]
Auto merge of #42426 - arthurprs:io_error, r=sfackler

Inline io::Error creation from ErrorKind

Faster and smaller code for mio and tokio (PRs on those to follow)