Commit Graph

82138 Commits

Author SHA1 Message Date
kennytm
098d80d44a
Rollup merge of #53373 - estebank:unclosed, r=petrochenkov
Tweak unclosed delimiter parser error
2018-08-17 00:13:24 +08:00
kennytm
4968eea639
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)).
2018-08-17 00:13:23 +08:00
kennytm
1cda84bfdb
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.
2018-08-17 00:13:21 +08:00
kennytm
e6068828bd
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.
2018-08-17 00:13:20 +08:00
kennytm
07ce2a3518
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!
2018-08-17 00:13:19 +08:00
bors
5050349749 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
2018-08-16 13:29:40 +00:00
bors
b837f5be70 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`
2018-08-16 11:18:12 +00:00
bors
142bb27373 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?
2018-08-16 08:45:32 +00:00
bors
996e26c23f 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
2018-08-16 06:34:13 +00:00
ashtneoi
0023dd9ba1 Split tests more and bless them again 2018-08-15 22:36:19 -07:00
ashtneoi
f335fb08c2 Move tests into their own directory 2018-08-15 22:35:56 -07:00
bors
fc323ba160 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
2018-08-16 04:16:12 +00:00
Esteban Küber
c9274c73b2 fix broken test 2018-08-15 18:47:34 -07:00
bors
6c712b1492 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`"
2018-08-16 01:08:13 +00:00
Alex Crichton
fccc04d3e7 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`
2018-08-15 17:20:13 -07:00
ashtneoi
f4229b81b5 Re-bless test 2018-08-15 15:25:53 -07:00
ashtneoi
4c4e1ef2c5 Add files I forgot to commit earlier 2018-08-15 15:14:21 -07:00
ashtneoi
671d7e064f Change a method name and clarify a comment 2018-08-15 15:14:21 -07:00
ashtneoi
bd2b54c23c Bless tests 2018-08-15 15:14:21 -07:00
ashtneoi
a5b008c450 Test move-into-Fn/FnMut errors too 2018-08-15 15:14:21 -07:00
ashtneoi
6a24abbbc5 Fix compiletest JSON error message 2018-08-15 15:14:21 -07:00
ashtneoi
3c3a7bad49 Allocate fewer Strings at a time 2018-08-15 15:14:21 -07:00
ashtneoi
81c27c6af7 Add another FIXME about suggestions 2018-08-15 15:14:21 -07:00
ashtneoi
9a0020a879 Bless UI tests 2018-08-15 15:14:21 -07:00
ashtneoi
d6dbdee739 Remove incorrect space 2018-08-15 15:14:21 -07:00
ashtneoi
a583aa642e Remove unnecessary comment
Turns out I didn't read the original comment correctly and had some
confusion about how MIR uses temporaries.
2018-08-15 15:14:21 -07:00
ashtneoi
0a82abc47b Test patterns in tuples 2018-08-15 15:14:21 -07:00
ashtneoi
6cf4e14ac0 Coalesce var-is-not-Copy notes per move 2018-08-15 15:14:21 -07:00
ashtneoi
20ae08bda6 Dedup suggestions 2018-08-15 15:14:21 -07:00
ashtneoi
40b5118c8a Remove unnecessary underscore 2018-08-15 15:14:21 -07:00
ashtneoi
8135372ed1 Change TODOs to FIXMEs 2018-08-15 15:14:21 -07:00
ashtneoi
10aaba8dbe Make move errors more consistent with typeck errors 2018-08-15 15:14:21 -07:00
ashtneoi
701c74e067 Make move error suggestions clearer 2018-08-15 15:14:21 -07:00
ashtneoi
b05e9a7f77 Add backquotes around variable name 2018-08-15 15:14:21 -07:00
ashtneoi
8080bdf275 Fix move errors for index expressions
The suggestion logic gave up too early, which kept it from suggesting
borrowing index expressions.
2018-08-15 15:14:21 -07:00
ashtneoi
54ddb36ce7 Test move errors for index expressions 2018-08-15 15:14:21 -07:00
ashtneoi
1e87908c52 Accept whitespace between & and mut 2018-08-15 15:14:21 -07:00
ashtneoi
3a5812bdd9 Add more TODOs 2018-08-15 15:14:21 -07:00
ashtneoi
a05f82fd2d Suggest match ergonomics, not ref/ref mut 2018-08-15 15:14:21 -07:00
ashtneoi
7b10133297 Fix some random stuff 2018-08-15 15:10:43 -07:00
Esteban Küber
1b5e29ae6f Do not emit "incorrect close delimiter" twice in the same place 2018-08-15 14:26:03 -07:00
Esteban Küber
2a74d7924a Tweak unclosed delimiter parser error 2018-08-15 13:18:34 -07:00
bors
d767ee1161 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
2018-08-15 19:39:54 +00:00
Guillaume Gomez
b9a51ce2f6
Rollup merge of #53396 - matklad:fix-flatten-since, r=varkor
Fix since of Iterator::flatten to be a proper semver

r? @kennytm
2018-08-15 19:20:29 +02:00
Guillaume Gomez
7acfa8615a
Rollup merge of #53388 - GuillaumeGomez:fix-links-color, r=frewsxcv
Fix links' color

Fixes #53375.

Problem was coming from the minifier.

r? @frewsxcv
2018-08-15 19:20:28 +02:00
Guillaume Gomez
a9a67a3a76
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.
2018-08-15 19:20:26 +02:00
Guillaume Gomez
25839dd9c6
Rollup merge of #53344 - frewsxcv:frewsxcv-doc-ptr, r=ollie27
Add doc examples for std::alloc::{alloc,alloc_zeroed}.

None
2018-08-15 19:20:25 +02:00
Guillaume Gomez
6bea743d56
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.
2018-08-15 19:20:23 +02:00
Guillaume Gomez
8e4f2d115a
Rollup merge of #53279 - estebank:on-unimplemented-doc, r=GuillaumeGomez
Extend documentation of `rustc_on_unimplemented`
2018-08-15 19:20:22 +02:00
Guillaume Gomez
b941c8e7fb
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.
2018-08-15 19:20:21 +02:00