]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #53434 - alexcrichton:remove-strip-debug, r=yurydelendik
Corey Farwell [Fri, 17 Aug 2018 15:23:45 +0000 (08:23 -0700)]
Rollup merge of #53434 - alexcrichton:remove-strip-debug, r=yurydelendik

wasm: Remove --strip-debug argument to LLD

Originally added in #52887 this commit disables passing `--strip-debug` to LLD
when optimized. This bring back the original bug of emitting broken debuginfo
but currently it *also* strips the `name` section which makes it very difficult
to inspect the final binary. A real fix is happening at
https://reviews.llvm.org/D50729 and we can reevaluate once we've updated LLD to
have that commit.

5 years agoRollup merge of #53413 - eddyb:featured-in-the-latest-edition, r=varkor
Corey Farwell [Fri, 17 Aug 2018 15:23:44 +0000 (08:23 -0700)]
Rollup merge of #53413 - eddyb:featured-in-the-latest-edition, r=varkor

Warn that `#![feature(rust_2018_preview)]` is implied when the edition is set to Rust 2018.

cc @varkor @petrochenkov @joshtriplett

5 years agoRollup merge of #53407 - pnkfelix:partial-53351-make-more-ported-compile-fail-tests...
Corey Farwell [Fri, 17 Aug 2018 15:23:43 +0000 (08:23 -0700)]
Rollup merge of #53407 - pnkfelix:partial-53351-make-more-ported-compile-fail-tests-more-robust-wrt-nll, r=nikomatsakis

make more ported compile fail tests more robust w.r.t. NLL

This is similar to PR #53369, except it covers a disjoint (and much smaller) set of tests that I needed to look at more carefully before being 100% certain they were the same kind of issue.

5 years agoRollup merge of #53406 - estebank:to_string-to_string, r=michaelwoerister
Corey Farwell [Fri, 17 Aug 2018 15:23:42 +0000 (08:23 -0700)]
Rollup merge of #53406 - estebank:to_string-to_string, r=michaelwoerister

Do not suggest conversion method that is already there

Fix #53348.

5 years agoRollup merge of #53358 - SimonSapin:int-bytes, r=shepmaster
Corey Farwell [Fri, 17 Aug 2018 15:23:40 +0000 (08:23 -0700)]
Rollup merge of #53358 - SimonSapin:int-bytes, r=shepmaster

`{to,from}_{ne,le,be}_bytes` for unsigned integer types

Same as https://github.com/rust-lang/rust/pull/51919 did for signed integers.

Tracking issue: https://github.com/rust-lang/rust/issues/52963

5 years agoRollup merge of #53357 - fukatani:pretty-print-btreemap, r=michaelwoerister
Corey Farwell [Fri, 17 Aug 2018 15:23:39 +0000 (08:23 -0700)]
Rollup merge of #53357 - fukatani:pretty-print-btreemap, r=michaelwoerister

Pretty print btreemap for GDB

Merge #53112 first, please.

5 years agoRollup merge of #53349 - memoryruins:nll-tests, r=nikomatsakis
Corey Farwell [Fri, 17 Aug 2018 15:23:38 +0000 (08:23 -0700)]
Rollup merge of #53349 - memoryruins:nll-tests, r=nikomatsakis

[nll] add tests for #48697 and #30104

Adds tests for the following issues:
- #48697 ``[NLL] ICE: unexpected region for local data with reference to closure``
- #30104 ``Destructuring boxes into multiple mutable references seems broken``

r? @nikomatsakis

5 years agoRollup merge of #53347 - eddyb:no-crate-in-root, r=petrochenkov
Corey Farwell [Fri, 17 Aug 2018 15:23:36 +0000 (08:23 -0700)]
Rollup merge of #53347 - eddyb:no-crate-in-root, r=petrochenkov

rustc_resolve: don't allow paths starting with `::crate`.

cc @aturon @joshtriplett
r? @petrochenkov

5 years agoRollup merge of #53326 - memoryruins:issue-27868-test, r=nikomatsakis
Corey Farwell [Fri, 17 Aug 2018 15:23:35 +0000 (08:23 -0700)]
Rollup merge of #53326 - memoryruins:issue-27868-test, r=nikomatsakis

[nll] add regression test for issue #27868

Adds a test for #27868 ``Inconsistent evaluation order for assignment operations``

apart of #47366 ``tracking issue for bugs fixed by the MIR borrow checker or NLL``

r? @nikomatsakis

5 years agoRollup merge of #53321 - alexcrichton:wasm-target-feature, r=nikomatsakis
Corey Farwell [Fri, 17 Aug 2018 15:23:34 +0000 (08:23 -0700)]
Rollup merge of #53321 - alexcrichton:wasm-target-feature, r=nikomatsakis

Fix usage of `wasm_target_feature`

Currently usage results in:

```
error: internal compiler error: librustc_typeck/collect.rs:1928: unknown target feature gate wasm_target_feature

thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:579:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.30.0-nightly (d5a448b3f 2018-08-13) running on x86_64-unknown-linux-gnu

note: compiler flags: -C debuginfo=2 -C linker=/tmp/lld-shim -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `coresimd`.

To learn more, run the command again with --verbose.
```

and hopefully this should fix the ICE!

5 years agoRollup merge of #52858 - frewsxcv:frewsxcv-elaborator, r=SimonSapin
Corey Farwell [Fri, 17 Aug 2018 15:23:33 +0000 (08:23 -0700)]
Rollup merge of #52858 - frewsxcv:frewsxcv-elaborator, r=SimonSapin

Implement Iterator::size_hint for Elaborator.

None

5 years agoGratuitous at byte boundaries in hex i32 literals in some doc-tests
Simon Sapin [Fri, 17 Aug 2018 12:01:57 +0000 (14:01 +0200)]
Gratuitous at byte boundaries in hex i32 literals in some doc-tests

5 years agoAuto merge of #53190 - sekineh:thumb-cortex-m, r=jamesmunns
bors [Fri, 17 Aug 2018 10:40:25 +0000 (10:40 +0000)]
Auto merge of #53190 - sekineh:thumb-cortex-m, r=jamesmunns

Add crate build test for `thumb*` targets. [IRR-2018-embedded]

## Summary

This PR adds `run-make` test that compiles `cortex-m` crate for all supported `thumb*-none-*` targets using `cargo` and stage2 `rustc`.

- Supported `thumb*-none-*` targets:
  - thumbv6m-none-eabi (Bare Cortex-M0, M0+, M1)
  - thumbv7em-none-eabi (Bare Cortex-M4, M7)
  - thumbv7em-none-eabihf (Bare Cortex-M4F, M7F, FPU, hardfloat)
  - thumbv7m-none-eabi (Bare Cortex-M3)

## How to run & Example output
I tested locally and all targets succeeded like below:
```
./x.py clean
./x.py test --target thumbv6m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf,thumbv7m-none-eabi src/test/run-make
```
```
Check compiletest suite=run-make mode=run-make (x86_64-unknown-linux-gnu -> thumbv6m-none-eabi)

running 5 tests
.....
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
```

## How to re-run

Remove `stamp` file for the test run.
```
rm build/x86_64-unknown-linux-gnu/test/run-make/thumb-none-cortex-m/stamp
```
Then run `test`
```
./x.py test --target thumbv6m-none-eabi,thumbv7em-none-eabi,thumbv7em-none-eabihf,thumbv7m-none-eabi src/test/run-make
(snip)
running 5 tests
iiii.
test result: ok. 1 passed; 0 failed; 4 ignored; 0 measured; 0 filtered out
```

## Artifacts

You can examine the artifacts under the directory below:
```
sekineh@sekineh-VirtualBox:~/rustme10$ ls -l build/x86_64-unknown-linux-gnu/test/run-make/thumb-none-cortex-m/thumb-none-cortex-m/
total 4
drwxrwxr-x 7 sekineh sekineh 4096  8月 14 22:40 cortex-m
```
where `build/x86_64-unknown-linux-gnu/test/run-make/thumb-none-cortex-m/thumb-none-cortex-m/` is came from TMPDIR variable.

## Other notes

For `test.rs` modification, I used the same logic as:
- https://github.com/rust-lang/rust/blame/d8b3c830fbcdd14d085209a8dcc3399151f3286a/src/bootstrap/dist.rs#L652-L657
```
            if builder.no_std(target) == Some(true) {
                // the `test` doesn't compile for no-std targets
                builder.ensure(compile::Std { compiler, target });
            } else {
                builder.ensure(compile::Test { compiler, target });
            }
```
It is a useful snippet when adding `no_std` support to `src/bootstrap` code.

CC @kennytm @jamesmunns @nerdyvaishali

5 years agorustc_resolve: don't allow paths starting with `::crate`.
Eduard-Mihai Burtescu [Tue, 14 Aug 2018 09:54:43 +0000 (12:54 +0300)]
rustc_resolve: don't allow paths starting with `::crate`.

5 years agoAuto merge of #53383 - nnethercote:HybridIdxSetBuf, r=nikomatsakis
bors [Fri, 17 Aug 2018 07:20:23 +0000 (07:20 +0000)]
Auto merge of #53383 - nnethercote:HybridIdxSetBuf, r=nikomatsakis

Speed up NLL with HybridIdxSetBuf.

It's a sparse-when-small but dense-when-large index set that is very
efficient for sets that (a) have few elements, (b) have large
universe_size values, and (c) are cleared frequently. Which makes it
perfect for the `gen_set` and `kill_set` sets used by the new borrow
checker.

This patch reduces `tuple-stress`'s NLL-check time by 40%, and up to 12%
for several other benchmarks. And it halves the max-rss for `keccak`,
and has smaller wins for `inflate` and `clap-rs`.

5 years agoImplement Iterator::size_hint for Elaborator.
Corey Farwell [Mon, 30 Jul 2018 13:07:51 +0000 (09:07 -0400)]
Implement Iterator::size_hint for Elaborator.

5 years agoAuto merge of #53427 - eddyb:uniform-paths-diagnostics, r=varkor
bors [Fri, 17 Aug 2018 00:28:16 +0000 (00:28 +0000)]
Auto merge of #53427 - eddyb:uniform-paths-diagnostics, r=varkor

rustc_resolve: overhaul `#![feature(uniform_paths)]` error reporting.

Fixes #53408 by only considering external crates to conflict within their (type/module) namespace, *not* with the value or macro namespaces, and also by adding a special-cased error for redundant `use crate_name;` imports (without actually allowing them).
Also, all canaries for a given import are grouped into one diagnostic per namespace, in order to make block-scoped ambiguities clearer.
See changed/added tests for more details.

r? @petrochenkov cc @aturon @joshtriplett

5 years agorustc_resolve: overhaul `#![feature(uniform_paths)]` error reporting.
Eduard-Mihai Burtescu [Thu, 16 Aug 2018 12:59:33 +0000 (15:59 +0300)]
rustc_resolve: overhaul `#![feature(uniform_paths)]` error reporting.

5 years agoAuto merge of #53397 - varkor:feature-collector-expand-visitor, r=nikomatsakis
bors [Thu, 16 Aug 2018 22:11:58 +0000 (22:11 +0000)]
Auto merge of #53397 - varkor:feature-collector-expand-visitor, r=nikomatsakis

Visit all attributes for feature collection

Previously feature attributes were just collected on item-like "things" as well as exported macros and crate attributes. This ignored some places feature attributes could be specified, such as on enum variants.

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

5 years agoAuto merge of #53433 - kennytm:rollup, r=kennytm
bors [Thu, 16 Aug 2018 17:53:29 +0000 (17:53 +0000)]
Auto merge of #53433 - kennytm:rollup, r=kennytm

Rollup of 10 pull requests

Successful merges:

 - #52946 (Documented impl From on line 367 of libserialize/json.rs)
 - #53234 (Remove Travis shutdown debug scripts, and remove CI-specific DNS settings)
 - #53313 (Two small improvements)
 - #53360 (Addressed #51602)
 - #53364 (Warn if the user tries to use GATs)
 - #53373 (Tweak unclosed delimiter parser error)
 - #53377 (std: Use target_pointer_width for BACKTRACE_ELF_SIZE)
 - #53395 (Use #[non_exhaustive] on internal enums)
 - #53399 (Tidy: ignore non-Markdown files when linting for the Unstable Book)
 - #53412 (syntax_ext: remove leftover span_err_if_not_stage0 macro.)

5 years agowasm: Remove --strip-debug argument to LLD
Alex Crichton [Thu, 16 Aug 2018 17:17:06 +0000 (10:17 -0700)]
wasm: Remove --strip-debug argument to LLD

Originally added in #52887 this commit disables passing `--strip-debug` to LLD
when optimized. This bring back the original bug of emitting broken debuginfo
but currently it *also* strips the `name` section which makes it very difficult
to inspect the final binary. A real fix is happening at
https://reviews.llvm.org/D50729 and we can reevaluate once we've updated LLD to
have that commit.

5 years agoRollup merge of #53234 - kennytm:debug-9696, r=alexcrichton
kennytm [Thu, 16 Aug 2018 16:54:45 +0000 (00:54 +0800)]
Rollup merge of #53234 - kennytm:debug-9696, r=alexcrichton

Remove Travis shutdown debug scripts, and remove CI-specific DNS settings

Since the cause of the host shutdown (travis-ci/travis-ci#4924) is found, we could revert the shutdown debug attempts to shorten the logs.

Additionally, we're pretty sure a custom DNS (added in  will not help travis-ci/travis-ci#9696, so reverting that part of #51420 to reduce CI-specific settings.

5 years agoRollup merge of #53412 - eddyb:stage-who, r=alexcrichton
kennytm [Thu, 16 Aug 2018 16:13:29 +0000 (00:13 +0800)]
Rollup merge of #53412 - eddyb:stage-who, r=alexcrichton

 syntax_ext: remove leftover span_err_if_not_stage0 macro.

I believe this is the right fix for #53380, although I'm not sure what happened.
My guess is this copy of the macro was accidentally missed when others were removed?

cc @matthewjasper @varkor (please do not put this in a rollup, in case it fails)

5 years agoRollup merge of #53399 - varkor:ignore-non-md-unstable_book, r=nikomatsakis
kennytm [Thu, 16 Aug 2018 16:13:27 +0000 (00:13 +0800)]
Rollup merge of #53399 - varkor:ignore-non-md-unstable_book, r=nikomatsakis

Tidy: ignore non-Markdown files when linting for the Unstable Book

Previously, any file would be assumed a `.md`, which is annoying when files like `.DS_STORE` slip in and then cause tidy errors.

5 years agoRollup merge of #53395 - varkor:__Nonexhaustive-to-non_exhaustive, r=shepmaster
kennytm [Thu, 16 Aug 2018 16:13:26 +0000 (00:13 +0800)]
Rollup merge of #53395 - varkor:__Nonexhaustive-to-non_exhaustive, r=shepmaster

Use #[non_exhaustive] on internal enums

This replaces `__Nonexhaustive` variants (and variants thereof)  with `#[non_exhaustive]`. These were mostly unstable previously, with the exception of the `cloudabi` enums and `Level` in proc_macro: these were `#[doc(hidden)]`, so clearly intended not to be used directly. It should be safe to replace all of these.

5 years agoRollup merge of #53377 - cuviper:pointer-elf_size, r=alexcrichton
kennytm [Thu, 16 Aug 2018 16:13:25 +0000 (00:13 +0800)]
Rollup merge of #53377 - cuviper:pointer-elf_size, r=alexcrichton

std: Use target_pointer_width for BACKTRACE_ELF_SIZE

The former code used `target.contains("64")` to detect Elf64 targets,
but this is inaccurate in a few cases:

- `s390x-unknown-linux-gnu` is 64-bit
- `sparcv9-sun-solaris` is 64-bit
- `x86_64-unknown-linux-gnux32` is 32-bit

Instead the `std` build script can use `CARGO_CFG_TARGET_POINTER_WIDTH`
to reliably detect 64-bit targets for libbacktrace.

Also update to backtrace-sys 0.1.24 for alexcrichton/backtrace-rs#122.

5 years agoRollup merge of #53373 - estebank:unclosed, r=petrochenkov
kennytm [Thu, 16 Aug 2018 16:13:24 +0000 (00:13 +0800)]
Rollup merge of #53373 - estebank:unclosed, r=petrochenkov

Tweak unclosed delimiter parser error

5 years agoRollup merge of #53364 - varkor:gat-warn-broken, r=pnkfelix
kennytm [Thu, 16 Aug 2018 16:13:23 +0000 (00:13 +0800)]
Rollup merge of #53364 - varkor:gat-warn-broken, r=pnkfelix

Warn if the user tries to use GATs

GATs are currently broken, but still accessible behind a feature gate. This leads to people attempting to use them and then immediately encountering ICEs (or other broken behaviour). Here, we emit a warning if the user tries to use any feature associated with GATs, hopefully making it obvious that ICEs and the like are expected. For the meantime, this seems better than continually getting reported errors (for example: [here](https://github.com/rust-lang/rust/issues?q=is%3Aissue+gat+is%3Aclosed) and [here](https://github.com/rust-lang/rust/issues?utf8=%E2%9C%93&q=is%3Aissue+generic_associated_types+is%3Aclosed)).

5 years agoRollup merge of #53360 - PramodBisht:issue/51602, r=estebank
kennytm [Thu, 16 Aug 2018 16:13:21 +0000 (00:13 +0800)]
Rollup merge of #53360 - PramodBisht:issue/51602, r=estebank

Addressed #51602

Fixed #51602
r? @estebank

here I have addressed the case where `in` was not expected right after `if` block. Speaking of `type ascription` I am not sure if this the best approach which I have implemented. Plus I think one more test case can be added to test `type-ascription` case, though I don't have any at this point of time. I will ping you again if all existing testcases pass.

5 years agoRollup merge of #53313 - llogiq:two-small-improvements, r=estebank
kennytm [Thu, 16 Aug 2018 16:13:20 +0000 (00:13 +0800)]
Rollup merge of #53313 - llogiq:two-small-improvements, r=estebank

Two small improvements

In `librustc_apfloat/ieee.rs`, use the iterator.[r]find methods to simplify the code. In `libserialize/json.rs`, make use of the fact that `Vec.last` on an empty `Vec` returns `None` to simplify the code to a single match.

5 years agoRollup merge of #52946 - Ajacmac:doc-impl-from, r=GuillaumeGomez
kennytm [Thu, 16 Aug 2018 16:13:19 +0000 (00:13 +0800)]
Rollup merge of #52946 - Ajacmac:doc-impl-from, r=GuillaumeGomez

Documented impl From on line 367 of libserialize/json.rs

This is for the impl From mentioned in #51430 assigned to @skade .

Hopefully I didn't miss anything/get anything wrong. I looked over another PR for another part of this same issue to see what the proper formatting was, etc.

Thanks!

5 years agoAuto merge of #53304 - dtolnay:extend, r=dtolnay
bors [Thu, 16 Aug 2018 15:44:30 +0000 (15:44 +0000)]
Auto merge of #53304 - dtolnay:extend, r=dtolnay

TokenStream::extend

Two new insta-stable impls in libproc_macro:

```rust
impl Extend<TokenTree> for TokenStream
impl Extend<TokenStream> for TokenStream
```

`proc_macro::TokenStream` already implements `FromIterator<TokenTree>` and `FromIterator<TokenStream>` so I elected to support the same input types for `Extend`.

**This commit reduces compile time of Serde derives by 60% (takes less than half as long to compile)** as measured by building our test suite:

```console
$ git clone https://github.com/serde-rs/serde
$ cd serde/test_suite
$ cargo check --tests --features proc-macro2/nightly
$ rm -f ../target/debug/deps/libtest_*.rmeta
$ time cargo check --tests --features proc-macro2/nightly
Before: 20.8 seconds
After: 8.6 seconds
```

r? @alexcrichton

5 years agoenable more tests on stage1 again
Ralf Jung [Thu, 16 Aug 2018 13:37:33 +0000 (15:37 +0200)]
enable more tests on stage1 again

5 years agoAuto merge of #53256 - ollie27:writeln, r=KodrAus
bors [Thu, 16 Aug 2018 13:29:40 +0000 (13:29 +0000)]
Auto merge of #53256 - ollie27:writeln, r=KodrAus

Don't accept non-string literals for the format string in writeln

This is to improve diagnostics.

`println` and `eprintln` were already fixed by #52394.

Fixes #30143

5 years agoRevert "Use public DNS server instead of 169.254.169.254 on CI."
kennytm [Thu, 16 Aug 2018 12:06:55 +0000 (20:06 +0800)]
Revert "Use public DNS server instead of 169.254.169.254 on CI."

This reverts commit 32e8bda4e35ada92beab7236d62520e6c6df8596.

5 years agoRevert "Auto merge of #53035 - alexcrichton:debug-travis, r=kennytm"
kennytm [Thu, 9 Aug 2018 18:13:15 +0000 (02:13 +0800)]
Revert "Auto merge of #53035 - alexcrichton:debug-travis, r=kennytm"

This reverts commit 579adf8c727861841b4819b4913385c2782977fb, reversing
changes made to c11f2d286c747b44f8e03ce10f6daa36f5d8331c.

5 years agoRevert "Auto merge of #53134 - alexcrichton:tweak-travis, r=Mark-Simulacrum"
kennytm [Thu, 9 Aug 2018 18:09:29 +0000 (02:09 +0800)]
Revert "Auto merge of #53134 - alexcrichton:tweak-travis, r=Mark-Simulacrum"

This reverts commit f9b9b6e078aa81c0faa064bf861e88001684765c, reversing
changes made to 45a9d410f934247256812eda55ca66dd6999b3de.

5 years agoAuto merge of #53173 - alexcrichton:win-arm64, r=sfackler
bors [Thu, 16 Aug 2018 11:18:12 +0000 (11:18 +0000)]
Auto merge of #53173 - alexcrichton:win-arm64, r=sfackler

Start adding an `aarch64-pc-windows-msvc` target

This commit adds the necessary definitions for target specs and such as well as
the necessary support in libstd to compile basic `aarch64-pc-windows-msvc`
binaries. The target is not currently built on CI, but it can be built locally
with:

    ./configure --target=aarch64-pc-windows-msvc --set rust.lld
    ./x.py build src/libstd --target aarch64-pc-windows-msvc

Currently this fails to build `libtest` due to a linker bug (seemingly in LLD?)
which hasn't been investigate yet. Otherwise though with libstd you can build a
hello world program (linked with LLD). I've not tried to execute it yet, but it
at least links!

Full support for this target is still a long road ahead, but this is hopefully a
good stepping stone to get started.

Points of note about this target are:

* Currently defaults to `panic=abort` as support is still landing in LLVM for
  SEH on AArch64.
* Currently defaults to LLD as a linker as I was able to get farther with it
  than I was with `link.exe`

5 years agoAuto merge of #53147 - ashtneoi:dont-suggest-ref, r=estebank
bors [Thu, 16 Aug 2018 08:45:32 +0000 (08:45 +0000)]
Auto merge of #53147 - ashtneoi:dont-suggest-ref, r=estebank

For move errors, suggest match ergonomics instead of `ref`

Partially fixes issue #52423. Also makes errors and suggestions more consistent between move-from-place and move-from-value errors.

Limitations:
- Only the first pattern in a match arm can have a "consider removing this borrow operator" suggestion.
- Suggestions don't always compile as-is (see the TODOs in the test for details).

Sorry for the really long test. I wanted to make sure I handled every case I could think of, and it turned out there were a lot of them.

Questions:
- Is there any particular applicability I should set on those suggestions?
- Are the notes about the `Copy` trait excessive?

5 years agoSpeed up NLL with `HybridIdxSetBuf`.
Nicholas Nethercote [Tue, 14 Aug 2018 00:21:24 +0000 (10:21 +1000)]
Speed up NLL with `HybridIdxSetBuf`.

`HybridIdxSetBuf` is a sparse-when-small but dense-when-large index set
that is very efficient for sets that (a) have few elements, (b) have
large `universe_size` values, and (c) are cleared frequently. Which
makes it perfect for the `gen_set` and `kill_set` sets used by the new
borrow checker.

This patch reduces the execution time of the five slowest NLL benchmarks
by 55%, 21%, 16%, 10% and 9%. It also reduces the max-rss of three
benchmarks by 53%, 33%, and 9%.

5 years agotests: prefer edition: directives to compile-flags:--edition.
Eduard-Mihai Burtescu [Thu, 16 Aug 2018 07:36:11 +0000 (10:36 +0300)]
tests: prefer edition: directives to compile-flags:--edition.

5 years agosyntax: also warn about edition "umbrella" features being implied by --edition.
Eduard-Mihai Burtescu [Wed, 15 Aug 2018 23:09:12 +0000 (02:09 +0300)]
syntax: also warn about edition "umbrella" features being implied by --edition.

5 years agoAuto merge of #53295 - estebank:on-unimplemented, r=michaelwoerister
bors [Thu, 16 Aug 2018 06:34:13 +0000 (06:34 +0000)]
Auto merge of #53295 - estebank:on-unimplemented, r=michaelwoerister

Various changes to `rustc_on_unimplemented`

- Add `from_method` and `from_desugaring` to formatting options
- Change wording of errors slightly

5 years agoSplit tests more and bless them again
ashtneoi [Thu, 16 Aug 2018 05:36:19 +0000 (22:36 -0700)]
Split tests more and bless them again

5 years agoMove tests into their own directory
ashtneoi [Thu, 16 Aug 2018 05:35:56 +0000 (22:35 -0700)]
Move tests into their own directory

5 years agoAuto merge of #53293 - petrochenkov:gramattr2, r=alexcrichton
bors [Thu, 16 Aug 2018 04:16:12 +0000 (04:16 +0000)]
Auto merge of #53293 - petrochenkov:gramattr2, r=alexcrichton

syntax: Enforce attribute grammar in the parser

Also fix feature-gating for `unrestricted_attribute_tokens` that was introduced in https://github.com/rust-lang/rust/pull/53270, but was actually broken.

cc https://github.com/rust-lang/rust/pull/50911

5 years agofix broken test
Esteban Küber [Thu, 16 Aug 2018 01:47:34 +0000 (18:47 -0700)]
fix broken test

5 years agoAuto merge of #53289 - ljedrz:improve_lexer, r=michaelwoerister
bors [Thu, 16 Aug 2018 01:08:13 +0000 (01:08 +0000)]
Auto merge of #53289 - ljedrz:improve_lexer, r=michaelwoerister

A few cleanups and minor improvements for the lexer

- improve readability by adjusting the formatting of some function signatures and adding some newlines
- reorder some functions for easier reading
- remove redundant `'static` in `const`s
- remove some explicit `return`s
- read directly to a `String` in `gather_comments_and_literals`
- change `unwrap_or!` (macro) to `unwrap_or` (function)
- move an `assert!`ion from `try_next_token` (called in a loop) to `try_real_token` after all calls to `try_next_token`
- `#[inline]` some one-liner functions
- assign directly from an `if-else` expression
- refactor a `match` to `map_or`
- add a `token::is_irrelevant` function to detect tokens that are not "`real`"

5 years agoStart adding an `aarch64-pc-windows-msvc` target
Alex Crichton [Mon, 16 Jul 2018 23:38:56 +0000 (16:38 -0700)]
Start adding an `aarch64-pc-windows-msvc` target

This commit adds the necessary definitions for target specs and such as well as
the necessary support in libstd to compile basic `aarch64-pc-windows-msvc`
binaries. The target is not currently built on CI, but it can be built locally
with:

    ./configure --target=aarch64-pc-windows-msvc --set rust.lld
    ./x.py build src/libstd --target aarch64-pc-windows-msvc

Currently this fails to build `libtest` due to a linker bug (seemingly in LLD?)
which hasn't been investigate yet. Otherwise though with libstd you can build a
hello world program (linked with LLD). I've not tried to execute it yet, but it
at least links!

Full support for this target is still a long road ahead, but this is hopefully a
good stepping stone to get started.

Points of note about this target are:

* Currently defaults to `panic=abort` as support is still landing in LLVM for
  SEH on AArch64.
* Currently defaults to LLD as a linker as I was able to get farther with it
  than I was with `link.exe`

5 years agosyntax: process all edition features before other features.
Eduard-Mihai Burtescu [Wed, 15 Aug 2018 23:06:26 +0000 (02:06 +0300)]
syntax: process all edition features before other features.

5 years agoRevert "Ignore test that fails on stage1"
Eduard-Mihai Burtescu [Wed, 15 Aug 2018 23:11:44 +0000 (02:11 +0300)]
Revert "Ignore test that fails on stage1"

This reverts commit 0e43e6fef251732f5268738eee9c258668ec7942.

5 years agosyntax_ext: remove leftover span_err_if_not_stage0 macro.
Eduard-Mihai Burtescu [Wed, 15 Aug 2018 23:10:54 +0000 (02:10 +0300)]
syntax_ext: remove leftover span_err_if_not_stage0 macro.

5 years agoRe-bless test
ashtneoi [Wed, 15 Aug 2018 22:25:53 +0000 (15:25 -0700)]
Re-bless test

5 years agoAdd files I forgot to commit earlier
ashtneoi [Wed, 15 Aug 2018 02:03:43 +0000 (19:03 -0700)]
Add files I forgot to commit earlier

5 years agoChange a method name and clarify a comment
ashtneoi [Tue, 14 Aug 2018 19:54:31 +0000 (12:54 -0700)]
Change a method name and clarify a comment

5 years agoBless tests
ashtneoi [Tue, 14 Aug 2018 19:38:37 +0000 (12:38 -0700)]
Bless tests

5 years agoTest move-into-Fn/FnMut errors too
ashtneoi [Tue, 14 Aug 2018 18:56:20 +0000 (11:56 -0700)]
Test move-into-Fn/FnMut errors too

5 years agoFix compiletest JSON error message
ashtneoi [Tue, 14 Aug 2018 06:49:21 +0000 (23:49 -0700)]
Fix compiletest JSON error message

5 years agoAllocate fewer Strings at a time
ashtneoi [Tue, 14 Aug 2018 05:01:54 +0000 (22:01 -0700)]
Allocate fewer Strings at a time

5 years agoAdd another FIXME about suggestions
ashtneoi [Tue, 14 Aug 2018 04:49:39 +0000 (21:49 -0700)]
Add another FIXME about suggestions

5 years agoBless UI tests
ashtneoi [Mon, 13 Aug 2018 23:45:40 +0000 (16:45 -0700)]
Bless UI tests

5 years agoRemove incorrect space
ashtneoi [Mon, 13 Aug 2018 23:12:35 +0000 (16:12 -0700)]
Remove incorrect space

5 years agoRemove unnecessary comment
ashtneoi [Mon, 13 Aug 2018 23:06:08 +0000 (16:06 -0700)]
Remove unnecessary comment

Turns out I didn't read the original comment correctly and had some
confusion about how MIR uses temporaries.

5 years agoTest patterns in tuples
ashtneoi [Mon, 13 Aug 2018 22:52:23 +0000 (15:52 -0700)]
Test patterns in tuples

5 years agoCoalesce var-is-not-Copy notes per move
ashtneoi [Mon, 13 Aug 2018 21:51:27 +0000 (14:51 -0700)]
Coalesce var-is-not-Copy notes per move

5 years agoDedup suggestions
ashtneoi [Mon, 13 Aug 2018 10:17:53 +0000 (03:17 -0700)]
Dedup suggestions

5 years agoRemove unnecessary underscore
ashtneoi [Sun, 12 Aug 2018 23:07:19 +0000 (16:07 -0700)]
Remove unnecessary underscore

5 years agoChange TODOs to FIXMEs
ashtneoi [Sun, 12 Aug 2018 21:42:33 +0000 (14:42 -0700)]
Change TODOs to FIXMEs

5 years agoMake move errors more consistent with typeck errors
ashtneoi [Sun, 12 Aug 2018 20:55:34 +0000 (13:55 -0700)]
Make move errors more consistent with typeck errors

5 years agoMake move error suggestions clearer
ashtneoi [Sun, 12 Aug 2018 20:27:14 +0000 (13:27 -0700)]
Make move error suggestions clearer

5 years agoAdd backquotes around variable name
ashtneoi [Sun, 12 Aug 2018 20:14:03 +0000 (13:14 -0700)]
Add backquotes around variable name

5 years agoFix move errors for index expressions
ashtneoi [Wed, 8 Aug 2018 06:44:35 +0000 (23:44 -0700)]
Fix move errors for index expressions

The suggestion logic gave up too early, which kept it from suggesting
borrowing index expressions.

5 years agoTest move errors for index expressions
ashtneoi [Wed, 8 Aug 2018 06:34:01 +0000 (23:34 -0700)]
Test move errors for index expressions

5 years agoAccept whitespace between `&` and `mut`
ashtneoi [Tue, 7 Aug 2018 23:16:37 +0000 (16:16 -0700)]
Accept whitespace between `&` and `mut`

5 years agoAdd more TODOs
ashtneoi [Tue, 7 Aug 2018 08:27:04 +0000 (01:27 -0700)]
Add more TODOs

5 years agoSuggest match ergonomics, not `ref`/`ref mut`
ashtneoi [Tue, 7 Aug 2018 08:02:39 +0000 (01:02 -0700)]
Suggest match ergonomics, not `ref`/`ref mut`

5 years agoFix some random stuff
ashtneoi [Thu, 2 Aug 2018 06:53:28 +0000 (23:53 -0700)]
Fix some random stuff

5 years agoRemoved `ignore-test-compare-mode-nll` from unboxed-closures tests
Felix S. Klock II [Wed, 15 Aug 2018 21:39:30 +0000 (23:39 +0200)]
Removed `ignore-test-compare-mode-nll` from unboxed-closures tests
by strengthening the tests (by adding no-op references to the
closures doing the borrows after the conflicting borrows, thus
forcing the lifetimes to resemble lexical scopes even under NLL).

5 years agoRemoved `ignore-test-compare-mode-nll` from hashmap-lifetimes.rs
Felix S. Klock II [Wed, 15 Aug 2018 21:33:14 +0000 (23:33 +0200)]
Removed `ignore-test-compare-mode-nll` from hashmap-lifetimes.rs
by strengthening the test there.

5 years agoRemoved `ignore-test-compare-mode-nll` from borrowck-closures-two-mut-fail.rs
Felix S. Klock II [Wed, 15 Aug 2018 21:31:00 +0000 (23:31 +0200)]
Removed `ignore-test-compare-mode-nll` from borrowck-closures-two-mut-fail.rs
by strengthening the tests there.

5 years agoRemoved `ignore-test-compare-mode-nll` from borrowck-closures-unique.rs
Felix S. Klock II [Wed, 15 Aug 2018 21:26:59 +0000 (23:26 +0200)]
Removed `ignore-test-compare-mode-nll` from borrowck-closures-unique.rs
by strengthening the tests there.

In almost all cases the strengthening amount to just encoding a use
that models the original lexical lifetime. A more invasive revision
was made in one case where it seems the actual issue is MIR-borrowck's
greater "knowledge" of unreachable code in the control flow...

5 years agoDo not emit "incorrect close delimiter" twice in the same place
Esteban Küber [Wed, 15 Aug 2018 21:26:03 +0000 (14:26 -0700)]
Do not emit "incorrect close delimiter" twice in the same place

5 years agoTweak unclosed delimiter parser error
Esteban Küber [Wed, 15 Aug 2018 01:04:20 +0000 (18:04 -0700)]
Tweak unclosed delimiter parser error

5 years agoDo not suggest conversion method that is already there
Esteban Küber [Wed, 15 Aug 2018 19:30:50 +0000 (12:30 -0700)]
Do not suggest conversion method that is already there

5 years agoAuto merge of #53400 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Wed, 15 Aug 2018 19:39:54 +0000 (19:39 +0000)]
Auto merge of #53400 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 8 pull requests

Successful merges:

 - #52453 (improve diagnostics for tests with custom return values)
 - #53271 (use ? to simplify `TransitiveRelation.maybe_map`)
 - #53279 (Extend documentation of `rustc_on_unimplemented`)
 - #53342 (fix error for unsized packed struct field)
 - #53344 (Add doc examples for std::alloc::{alloc,alloc_zeroed}.)
 - #53368 (Ignore test that fails on stage1)
 - #53388 (Fix links' color)
 - #53396 (Fix since of Iterator::flatten to be a proper semver)

Failed merges:

r? @ghost

5 years agoRollup merge of #53396 - matklad:fix-flatten-since, r=varkor
Guillaume Gomez [Wed, 15 Aug 2018 17:20:29 +0000 (19:20 +0200)]
Rollup merge of #53396 - matklad:fix-flatten-since, r=varkor

Fix since of Iterator::flatten to be a proper semver

r? @kennytm

5 years agoRollup merge of #53388 - GuillaumeGomez:fix-links-color, r=frewsxcv
Guillaume Gomez [Wed, 15 Aug 2018 17:20:28 +0000 (19:20 +0200)]
Rollup merge of #53388 - GuillaumeGomez:fix-links-color, r=frewsxcv

Fix links' color

Fixes #53375.

Problem was coming from the minifier.

r? @frewsxcv

5 years agoRollup merge of #53368 - matthewjasper:only-stage-2, r=varkor
Guillaume Gomez [Wed, 15 Aug 2018 17:20:26 +0000 (19:20 +0200)]
Rollup merge of #53368 - matthewjasper:only-stage-2, r=varkor

Ignore test that fails on stage1

The error code is not emitted on stage1, so ignore this test there.

5 years agoRollup merge of #53344 - frewsxcv:frewsxcv-doc-ptr, r=ollie27
Guillaume Gomez [Wed, 15 Aug 2018 17:20:25 +0000 (19:20 +0200)]
Rollup merge of #53344 - frewsxcv:frewsxcv-doc-ptr, r=ollie27

Add doc examples for std::alloc::{alloc,alloc_zeroed}.

None

5 years agoRollup merge of #53342 - RalfJung:unsized-packed, r=cramertj
Guillaume Gomez [Wed, 15 Aug 2018 17:20:23 +0000 (19:20 +0200)]
Rollup merge of #53342 - RalfJung:unsized-packed, r=cramertj

fix error for unsized packed struct field

It was really confusing to be told "only the last field of a struct may have a dynamically sized type" when only the last field *was* unsized.

5 years agoRollup merge of #53279 - estebank:on-unimplemented-doc, r=GuillaumeGomez
Guillaume Gomez [Wed, 15 Aug 2018 17:20:22 +0000 (19:20 +0200)]
Rollup merge of #53279 - estebank:on-unimplemented-doc, r=GuillaumeGomez

Extend documentation of `rustc_on_unimplemented`

5 years agoRollup merge of #53271 - llogiq:simplify-maybe-map, r=joshtriplett
Guillaume Gomez [Wed, 15 Aug 2018 17:20:21 +0000 (19:20 +0200)]
Rollup merge of #53271 - llogiq:simplify-maybe-map, r=joshtriplett

use ? to simplify `TransitiveRelation.maybe_map`

I think this looks much clearer than the original.

5 years agoRollup merge of #52453 - srijs:fix-52436, r=TimNN
Guillaume Gomez [Wed, 15 Aug 2018 17:20:19 +0000 (19:20 +0200)]
Rollup merge of #52453 - srijs:fix-52436, r=TimNN

improve diagnostics for tests with custom return values

This is an attempt at getting the ball rolling to improve the diagnostics for test functions that return custom `impl Termination` values (see #52436).

An alternative could be to use `eprintln!`, but including this in the panic message felt nicely consistent with how failing test assertions would be reported.

Let me know what you think!

5 years agoAuto merge of #53164 - davidtwco:issue-52663-span-decl-captured-variables, r=nikomatsakis
bors [Wed, 15 Aug 2018 17:03:39 +0000 (17:03 +0000)]
Auto merge of #53164 - davidtwco:issue-52663-span-decl-captured-variables, r=nikomatsakis

Provide span for declaration of captured variables

Part of #52663.

r? @nikomatsakis

5 years agoTidy: ignore non-Markdown files when linting for the Unstable Book
varkor [Wed, 15 Aug 2018 17:01:37 +0000 (18:01 +0100)]
Tidy: ignore non-Markdown files when linting for the Unstable Book

5 years agoRemove outdated Unstable Book sections
varkor [Wed, 15 Aug 2018 16:56:53 +0000 (17:56 +0100)]
Remove outdated Unstable Book sections

5 years agoVisit all attributes for feature collection
varkor [Wed, 15 Aug 2018 16:34:56 +0000 (17:34 +0100)]
Visit all attributes for feature collection

5 years agoFix since of Iterator::flatten to be a proper semver
Aleksey Kladov [Wed, 15 Aug 2018 16:28:42 +0000 (19:28 +0300)]
Fix since of Iterator::flatten to be a proper semver

5 years agoMake cloudapi enums #[non_exhaustive]
varkor [Wed, 15 Aug 2018 15:58:53 +0000 (16:58 +0100)]
Make cloudapi enums #[non_exhaustive]

5 years agoMake std::io::Error #[non_exhaustive]
varkor [Wed, 15 Aug 2018 15:57:06 +0000 (16:57 +0100)]
Make std::io::Error #[non_exhaustive]