]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #59600 - tobia:master, r=pnkfelix
Mazdak Farrokhzad [Mon, 10 Jun 2019 11:14:26 +0000 (13:14 +0200)]
Rollup merge of #59600 - tobia:master, r=pnkfelix

Replaced linear token counting macros with optimized implementation

There are currently two distinct token-counting macros in the source. Both implement the trivial algorithm, with linear complexity. They may or may not be adequate for their use case, but considering that other people are probably going to copy and paste them whenever they need a token-counting macro, I replaced them with an optimized implementation with logarithmic complexity.

5 years agoAuto merge of #61506 - imbrem:mir_body_renaming, r=eddyb
bors [Mon, 10 Jun 2019 08:07:22 +0000 (08:07 +0000)]
Auto merge of #61506 - imbrem:mir_body_renaming, r=eddyb

Changed usages of `mir` in librustc::mir and librustc_mir to `body`

Work on part 2 of #60229

5 years agoAuto merge of #61608 - Aaron1011:feature/weird-expr-yield, r=Centril
bors [Mon, 10 Jun 2019 05:17:12 +0000 (05:17 +0000)]
Auto merge of #61608 - Aaron1011:feature/weird-expr-yield, r=Centril

Add nested 'yield' expression to weird expressions test

5 years agoAuto merge of #61706 - petrhosek:bootstrap-cp-r, r=Mark-Simulacrum
bors [Mon, 10 Jun 2019 02:35:29 +0000 (02:35 +0000)]
Auto merge of #61706 - petrhosek:bootstrap-cp-r, r=Mark-Simulacrum

Use Build::read_dir instead of fs::read_dir in Build::cp_r

Build::read_dir does better error handling when the directory doesn't
exist; it actually prints the name of the directory rather than just
printing the underlying error "No such file or directory" which on
its own isn't very useful.

5 years agoUse Build::read_dir instead of fs::read_dir in Build::cp_r
Petr Hosek [Sun, 9 Jun 2019 23:57:17 +0000 (16:57 -0700)]
Use Build::read_dir instead of fs::read_dir in Build::cp_r

Build::read_dir does better error handling when the directory doesn't
exist; it actually prints the name of the directory rather than just
printing the underlying error "No such file or directory" which on
its own isn't very useful.

5 years agoAuto merge of #61229 - Centril:stabilize-repr_align_enum, r=nagisa
bors [Sun, 9 Jun 2019 23:50:04 +0000 (23:50 +0000)]
Auto merge of #61229 - Centril:stabilize-repr_align_enum, r=nagisa

Stabilize #![feature(repr_align_enum)] in Rust 1.37.0

On an `enum` item, you may now write:

```rust
#[repr(align(X))]
enum Foo {
    // ...
}
```

This has equivalent effects to first defining:

```rust
#[repr(align(X))]
struct AlignX<T>(T);
```

and then using `AlignX<Foo>` in `Foo`'s stead.

r? @nagisa

5 years agoChanged usages of `mir` in librustc::mir and librustc_mir to `body`
Jad Ghalayini [Mon, 3 Jun 2019 22:26:48 +0000 (18:26 -0400)]
Changed usages of `mir` in librustc::mir and librustc_mir to `body`

5 years agoAuto merge of #61691 - RalfJung:miri-slow, r=Centril
bors [Sun, 9 Jun 2019 17:47:48 +0000 (17:47 +0000)]
Auto merge of #61691 - RalfJung:miri-slow, r=Centril

Miri: disable a slow test

5 years agoMiri: disable a slow test
Ralf Jung [Sun, 9 Jun 2019 11:58:32 +0000 (13:58 +0200)]
Miri: disable a slow test

5 years agoAuto merge of #61677 - napen123:string-examples, r=sfackler
bors [Sun, 9 Jun 2019 07:48:10 +0000 (07:48 +0000)]
Auto merge of #61677 - napen123:string-examples, r=sfackler

Add examples for make_ascii_{uppercase, lowercase}

As the title says, this adds simple usage examples for make_ascii_uppercase and make_ascii_lowercase.

5 years agoAuto merge of #60932 - Centril:macro-at-most-once-2015, r=mark-i-m
bors [Sun, 9 Jun 2019 05:00:22 +0000 (05:00 +0000)]
Auto merge of #60932 - Centril:macro-at-most-once-2015, r=mark-i-m

Support ? Kleene macro operator in 2015

Closes https://github.com/rust-lang/rust/issues/56668.

See that issue for rationale and discussion.

Crater will be needed (done in https://github.com/rust-lang/rust/pull/60932#issuecomment-494188577, zero regressions) and then, if all goes well, FCP (in https://github.com/rust-lang/rust/pull/60932#issuecomment-494189802).

5 years agopacify tidy.
Mazdak Farrokhzad [Fri, 7 Jun 2019 23:39:29 +0000 (01:39 +0200)]
pacify tidy.

5 years agoFix typo in comment.
Mazdak Farrokhzad [Wed, 22 May 2019 03:58:29 +0000 (05:58 +0200)]
Fix typo in comment.

5 years agoFix inaccurate comments in '?' Kleene operator tests.
Mazdak Farrokhzad [Wed, 22 May 2019 03:52:47 +0000 (05:52 +0200)]
Fix inaccurate comments in '?' Kleene operator tests.

5 years agoSome more cleanup in libsyntax::ext::tt::quoted
Mazdak Farrokhzad [Wed, 22 May 2019 00:43:46 +0000 (02:43 +0200)]
Some more cleanup in libsyntax::ext::tt::quoted

5 years agoCleanups in parse_sep_and_kleene_op.
Mazdak Farrokhzad [Wed, 22 May 2019 00:38:19 +0000 (02:38 +0200)]
Cleanups in parse_sep_and_kleene_op.

5 years agoUpdate tests since ? macro op is supported on 2015.
Mazdak Farrokhzad [Sat, 18 May 2019 06:24:56 +0000 (08:24 +0200)]
Update tests since ? macro op is supported on 2015.

5 years agoSupport ? Kleene operator in 2015.
Mazdak Farrokhzad [Sat, 18 May 2019 06:23:52 +0000 (08:23 +0200)]
Support ? Kleene operator in 2015.

5 years agoAuto merge of #61653 - oli-obk:visit_place_recursion, r=spastorino
bors [Sun, 9 Jun 2019 02:07:44 +0000 (02:07 +0000)]
Auto merge of #61653 - oli-obk:visit_place_recursion, r=spastorino

get rid of visit_place recursion

r? @spastorino

this is groundwork for https://github.com/rust-lang/rust/pull/60913, since after that PR we won't be able to implement `visit_place` in a recursive manner without heavy cloning everywhere.

cc @eddyb this touches const qualif

5 years agoAdd examples for make_ascii_{uppercase, lowercase}
Napen123 [Sun, 9 Jun 2019 00:28:29 +0000 (18:28 -0600)]
Add examples for make_ascii_{uppercase, lowercase}

5 years agoAuto merge of #61672 - Centril:rollup-jxo89ir, r=Centril
bors [Sat, 8 Jun 2019 23:17:06 +0000 (23:17 +0000)]
Auto merge of #61672 - Centril:rollup-jxo89ir, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #61646 (Remove useless allocations in macro_rules follow logic.)
 - #61658 (remove useless ident() functions in const tests)
 - #61660 (Minimize use of `#![feature(custom_attribute)]`)
 - #61666 (Add test for trait ICE)
 - #61669 ( syntax: Remove `Deref` impl from `Token`)
 - #61670 (Update RLS)

Failed merges:

r? @ghost

5 years agoRollup merge of #61670 - Xanewok:update-rls, r=oli-obk
Mazdak Farrokhzad [Sat, 8 Jun 2019 22:20:39 +0000 (00:20 +0200)]
Rollup merge of #61670 - Xanewok:update-rls, r=oli-obk

Update RLS

This bumps the version to 1.37 and also doesn't build clippy by default (should reduce toolstate breakages, see https://github.com/rust-lang/rust/issues/59761#issuecomment-498616465 for more details)

r? @oli-obk

5 years agoRollup merge of #61669 - petrochenkov:tokderef2, r=oli-obk
Mazdak Farrokhzad [Sat, 8 Jun 2019 22:20:38 +0000 (00:20 +0200)]
Rollup merge of #61669 - petrochenkov:tokderef2, r=oli-obk

 syntax: Remove `Deref` impl from `Token`

Follow up to https://github.com/rust-lang/rust/pull/61541

r? @oli-obk

5 years agoRollup merge of #61666 - JohnTitor:add-test-for-ice, r=Centril
Mazdak Farrokhzad [Sat, 8 Jun 2019 22:20:36 +0000 (00:20 +0200)]
Rollup merge of #61666 - JohnTitor:add-test-for-ice, r=Centril

Add test for trait ICE

Closes #55266

5 years agoRollup merge of #61660 - petrochenkov:nocusta, r=Centril
Mazdak Farrokhzad [Sat, 8 Jun 2019 22:20:35 +0000 (00:20 +0200)]
Rollup merge of #61660 - petrochenkov:nocusta, r=Centril

Minimize use of `#![feature(custom_attribute)]`

Some preparations before resurrecting https://github.com/rust-lang/rust/pull/57921.

5 years agoRollup merge of #61658 - RalfJung:const-tests, r=oli-obk
Mazdak Farrokhzad [Sat, 8 Jun 2019 22:20:34 +0000 (00:20 +0200)]
Rollup merge of #61658 - RalfJung:const-tests, r=oli-obk

remove useless ident() functions in const tests

and replace the useful ones by black_box (with a comment)

r? @oli-obk

5 years agoRollup merge of #61646 - L117:master, r=Centril
Mazdak Farrokhzad [Sat, 8 Jun 2019 22:20:32 +0000 (00:20 +0200)]
Rollup merge of #61646 - L117:master, r=Centril

Remove useless allocations in macro_rules follow logic.

Closes  #61543

5 years agoDon't use "base place" for different concepts
Oliver Scherer [Sat, 8 Jun 2019 21:24:37 +0000 (23:24 +0200)]
Don't use "base place" for different concepts

5 years agoDeduplicate some code
Oliver Scherer [Sat, 8 Jun 2019 21:23:10 +0000 (23:23 +0200)]
Deduplicate some code

5 years agoAddress review comments
Vadim Petrochenkov [Sat, 8 Jun 2019 20:55:09 +0000 (23:55 +0300)]
Address review comments

5 years agoMove some run-pass attribute tests to ui
Vadim Petrochenkov [Sat, 8 Jun 2019 14:42:58 +0000 (17:42 +0300)]
Move some run-pass attribute tests to ui

5 years agoRemove some more `#![feature(custom_attribute)]`s
Vadim Petrochenkov [Sat, 8 Jun 2019 14:35:54 +0000 (17:35 +0300)]
Remove some more `#![feature(custom_attribute)]`s

5 years agoIntroduce `#[rustc_dummy]` attribute and use it in tests
Vadim Petrochenkov [Sat, 8 Jun 2019 08:36:43 +0000 (11:36 +0300)]
Introduce `#[rustc_dummy]` attribute and use it in tests

Unlike other built-in attributes, this attribute accepts any input

5 years agoTurn `#[allocator]` into a built-in attribute and rename it to `#[rustc_allocator]`
Vadim Petrochenkov [Sat, 8 Jun 2019 08:36:30 +0000 (11:36 +0300)]
Turn `#[allocator]` into a built-in attribute and rename it to `#[rustc_allocator]`

5 years agoRemove unused `#![feature(custom_attribute)]`s
Vadim Petrochenkov [Sat, 8 Jun 2019 08:35:30 +0000 (11:35 +0300)]
Remove unused `#![feature(custom_attribute)]`s

5 years agoAuto merge of #61529 - ehuss:update-books, r=GuillaumeGomez
bors [Sat, 8 Jun 2019 20:25:09 +0000 (20:25 +0000)]
Auto merge of #61529 - ehuss:update-books, r=GuillaumeGomez

Update books

## reference

2 commits in 862b669c395822bb0938781d74f860e5762ad4fb..f8ae436d936f6f4891d3c1bbb1af5865eb8aeadb
2019-05-04 23:41:35 -0700 to 2019-05-31 14:59:12 +0200
- Document that literals with any suffixes are valid as tokens (rust-lang-nursery/reference#612)
- Fix example code of derive macro (rust-lang-nursery/reference#611)

## book

2 commits in 29fe982990e43b9367be0ff47abc82fb2123fd03..62a8c6f25fbd981c80a046f3b04be9684749af3b
2019-05-15 17:48:40 -0400 to 2019-05-28 15:48:23 -0400
- Remove snapshots checked in layout
- Remove snapshots that I've approved in layout

## rust-by-example

5 commits in 811c697b232c611ed754d279ed20643a0c4096f6..18566f4dedc3ef5bf61f5f85685d5966db99cc11
2019-04-28 18:56:42 -0300 to 2019-05-30 19:23:24 -0300
- Fixed wording in the `Seconds` struct description. (rust-lang/rust-by-example#1195)
- Fix usage of the word "elision" (rust-lang/rust-by-example#1191)
- Reword "Flow Control" to "Flow of Control" (rust-lang/rust-by-example#1190)
- Copy edits to chapter 1 (rust-lang/rust-by-example#1189)
- Fix typo in a mod/visibility.md (rust-lang/rust-by-example#1188)

## rustc-guide

9 commits in 3cb727b62b953d59b4360d39aa68b6dc8f157655..3ac9cfc9c9ab2e366feebf18718112737f572352
2019-05-07 09:53:32 -0500 to 2019-06-02 19:36:58 -0500
- Update information about debuginfo configuration
- fix long line
- Fixed misspelling
- Add more info subsection with links to forge and rustc api docs (rust-lang/rustc-guide#324)
- Renamed the file and title of the diagnostics chapter.
- Added rustc phases diagram and explanation
- Mention running tests for subdirectories
- Fixed links broken by merging chalks rules and solve
- Add documentation about profile-guided optimization.

## embedded-book

1 commits in 9858872bd1b7dbba5ec27dc30d34eba00acd7ef9..f0c75b75f9c18537b78f5d17c1015247e9a49c86
2019-05-02 18:56:54 +0000 to 2019-06-03 10:49:02 +0000
- Qemu md changes  (rust-embedded/book#193)

5 years agoUpdate RLS
Igor Matuszewski [Sat, 8 Jun 2019 20:15:22 +0000 (22:15 +0200)]
Update RLS

5 years agosyntax: Move some `Token` methods around
Vadim Petrochenkov [Sat, 8 Jun 2019 19:38:39 +0000 (22:38 +0300)]
syntax: Move some `Token` methods around

5 years agosyntax: Remove `Deref` impl from `Token`
Vadim Petrochenkov [Sat, 8 Jun 2019 19:38:23 +0000 (22:38 +0300)]
syntax: Remove `Deref` impl from `Token`

5 years agosyntax: Move most of the `TokenKind` methods to `Token`
Vadim Petrochenkov [Sat, 8 Jun 2019 16:45:12 +0000 (19:45 +0300)]
syntax: Move most of the `TokenKind` methods to `Token`

5 years agoextra paranoid mode
Ralf Jung [Sat, 8 Jun 2019 18:35:59 +0000 (20:35 +0200)]
extra paranoid mode

5 years agoAdd test for ICE
Yuki Okushi [Sat, 8 Jun 2019 18:04:56 +0000 (03:04 +0900)]
Add test for ICE

5 years agoAuto merge of #61655 - RalfJung:checktools, r=kennytm
bors [Sat, 8 Jun 2019 17:44:12 +0000 (17:44 +0000)]
Auto merge of #61655 - RalfJung:checktools, r=kennytm

checktools: unify grepping the TOOLSTATE file

The file was grepped twice but in a different way. This unifies the code to make sure it is consistent. Or were these deliberately not doing the same thing? That seems strange though.

I wouldn't know how to test these changes.

5 years agosyntax: Keep full `Token`s for `macro_rules` separators
Vadim Petrochenkov [Sat, 8 Jun 2019 17:20:00 +0000 (20:20 +0300)]
syntax: Keep full `Token`s for `macro_rules` separators

5 years agoblack-box the fn ptr, not the result
Ralf Jung [Sat, 8 Jun 2019 16:13:16 +0000 (18:13 +0200)]
black-box the fn ptr, not the result

5 years agoAuto merge of #61625 - RalfJung:eval-interp, r=oli-obk
bors [Sat, 8 Jun 2019 13:02:49 +0000 (13:02 +0000)]
Auto merge of #61625 - RalfJung:eval-interp, r=oli-obk

Rename remaining "Eval" to "Interp"

Renaming done by sed.

r? @oli-obk

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

5 years agoremove useless ident() functions in const tests and replace the useful ones by black_...
Ralf Jung [Sat, 8 Jun 2019 10:30:52 +0000 (12:30 +0200)]
remove useless ident() functions in const tests and replace the useful ones by black_box (with a comment)

5 years agoAuto merge of #61620 - SimonSapin:as_cell, r=RalfJung
bors [Sat, 8 Jun 2019 10:15:31 +0000 (10:15 +0000)]
Auto merge of #61620 - SimonSapin:as_cell, r=RalfJung

Stabilize Cell::from_mut and as_slice_of_cells

FCP: https://github.com/rust-lang/rust/issues/43038#issuecomment-499900463

5 years agofix rebase fallout
Ralf Jung [Sat, 8 Jun 2019 09:40:55 +0000 (11:40 +0200)]
fix rebase fallout

5 years agorename EvalSnapshot -> InterpSnapshot
Ralf Jung [Fri, 7 Jun 2019 17:01:49 +0000 (19:01 +0200)]
rename EvalSnapshot -> InterpSnapshot

5 years agorename EvalResult -> InterpResult and EvalError -> InterpErrorInfo
Ralf Jung [Fri, 7 Jun 2019 16:56:27 +0000 (18:56 +0200)]
rename EvalResult -> InterpResult and EvalError -> InterpErrorInfo

5 years agochecktools: unify grepping the TOOLSTATE file
Ralf Jung [Sat, 8 Jun 2019 09:32:25 +0000 (11:32 +0200)]
checktools: unify grepping the TOOLSTATE file

5 years agoDo not recursively visit `visit_place`
Oliver Scherer [Sat, 8 Jun 2019 08:24:53 +0000 (10:24 +0200)]
Do not recursively visit `visit_place`

5 years agoAuto merge of #61635 - ecstatic-morse:const-signum, r=oli-obk
bors [Sat, 8 Jun 2019 07:20:57 +0000 (07:20 +0000)]
Auto merge of #61635 - ecstatic-morse:const-signum, r=oli-obk

Make `i*::signum` a `const fn`.

Ticks a box in #53718.

This uses a well-known branchless implementation of `signum`: `(n > 0) as i32 - (n < 0) as i32`.

Here's a [playground](https://play.rust-lang.org/?version=nightly&mode=release&edition=2018&gist=747cf191c4974bf66c9d75e509ae6e6e) comparing the two techniques. On x86 in release mode, the branchless implementation is able to replace a `mov` and `cmov` with a `sar` and `add`, so this should be a bit faster as well.

~~This is marked as a draft since I think I'll need to add `#[rustc_const_unstable]` somewhere. Perhaps the reviewer can point me in the right direction.~~

5 years agoAuto merge of #61649 - Centril:rollup-b4nx9k9, r=Centril
bors [Sat, 8 Jun 2019 01:34:53 +0000 (01:34 +0000)]
Auto merge of #61649 - Centril:rollup-b4nx9k9, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #61223 (Document tuple's Ord behavior as sequential)
 - #61615 (syntax: Treat error literals in more principled way)
 - #61616 (parser: Remove `Deref` impl from `Parser`)
 - #61621 (Clarify when we run steps with ONLY_HOSTS)
 - #61627 (Add regression test for #61452.)
 - #61641 (Revert "Make LocalAnalizer visitor iterate instead of recurse")
 - #61647 (Use stable wrappers in f32/f64::signum)

Failed merges:

r? @ghost

5 years agoRollup merge of #61647 - JohnTitor:use-stable-func, r=Centril
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:34:02 +0000 (03:34 +0200)]
Rollup merge of #61647 - JohnTitor:use-stable-func, r=Centril

Use stable wrappers in f32/f64::signum

Fixes #61638

r? @Centril

5 years agoRollup merge of #61641 - spastorino:revert-to-recursion-on-local-analyzer, r=oli-obk
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:34:00 +0000 (03:34 +0200)]
Rollup merge of #61641 - spastorino:revert-to-recursion-on-local-analyzer, r=oli-obk

Revert "Make LocalAnalizer visitor iterate instead of recurse"

This reverts commit 0cfaa28bc5edda198571fca9410cbc9f71b8d17a.

r? @oli-obk

5 years agoRollup merge of #61627 - davidtwco:ice-async-fn-lint, r=alexcrichton
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:33:59 +0000 (03:33 +0200)]
Rollup merge of #61627 - davidtwco:ice-async-fn-lint, r=alexcrichton

Add regression test for #61452.

Fixes #61452.

Turns out this ICE had already been fixed, so this PR only adds a regression test.

5 years agoRollup merge of #61621 - Mark-Simulacrum:bootstrap-run-only-hosts, r=alexcrichton
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:33:58 +0000 (03:33 +0200)]
Rollup merge of #61621 - Mark-Simulacrum:bootstrap-run-only-hosts, r=alexcrichton

Clarify when we run steps with ONLY_HOSTS

Just some simple cleanup, no behavior changes.

r? @alexcrichton

5 years agoRollup merge of #61616 - petrochenkov:parsderef, r=oli-obk
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:33:57 +0000 (03:33 +0200)]
Rollup merge of #61616 - petrochenkov:parsderef, r=oli-obk

parser: Remove `Deref` impl from `Parser`

Follow up to https://github.com/rust-lang/rust/pull/61541

You have to write `self.token.span` instead of `self.span` in the parser now, which is not nice, but not too bad either, I guess.
Not sure.
Probably still better than people using both and being confused about the definition point of `span`.

r? @oli-obk @estebank

5 years agoRollup merge of #61615 - petrochenkov:errlit, r=matklad
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:33:55 +0000 (03:33 +0200)]
Rollup merge of #61615 - petrochenkov:errlit, r=matklad

syntax: Treat error literals in more principled way

Free them from their character literal origins.

I actually tried to remove `LitKind::Err` entirely (by converting it into `ExprKind::Err` immediately), and it caused no diagnostic regressions in the test suite.
However, I'd still want to use error literals as general purpose error tokens some day, so I kept them.

The downside of having `LitKind::Err` in addition to `ExprKind::Err` is that every time you want to do something with `ExprKind::Err` you need to make sure that `ExprKind::Lit(LitKind::Err)` is treated in the same way.
Fortunately, this usually happens automatically because both literals and errors are "leaf" expressions, however this PR does fix a couple of inconsistencies between them.

Addresses https://github.com/rust-lang/rust/pull/60679#discussion_r282640663 in a way

5 years agoRollup merge of #61223 - czipperz:tuple-ord-document-ordering, r=oli-obk
Mazdak Farrokhzad [Sat, 8 Jun 2019 01:33:54 +0000 (03:33 +0200)]
Rollup merge of #61223 - czipperz:tuple-ord-document-ordering, r=oli-obk

Document tuple's Ord behavior as sequential

Partially closing #50727

5 years agoAdd `const`-ness tests for `i32::signum`
Dylan MacKenzie [Fri, 7 Jun 2019 23:23:33 +0000 (16:23 -0700)]
Add `const`-ness tests for `i32::signum`

5 years agoUse stable wrappers
Yuki Okushi [Sat, 8 Jun 2019 00:02:00 +0000 (09:02 +0900)]
Use stable wrappers

5 years agoRemove useless allocations in macro_rules follow logic.
L117 [Fri, 7 Jun 2019 23:02:15 +0000 (09:02 +1000)]
Remove useless allocations in macro_rules follow logic.

5 years agoMake `i*::signum` a `const fn`.
Dylan MacKenzie [Fri, 7 Jun 2019 21:12:54 +0000 (14:12 -0700)]
Make `i*::signum` a `const fn`.

This uses a well-known branchless implementation of `signum`.
Its `const`-ness is unstable and requires `#![feature(const_int_sign)]`.

5 years agoRevert "Make LocalAnalizer visitor iterate instead of recurse"
Santiago Pastorino [Fri, 7 Jun 2019 21:43:19 +0000 (23:43 +0200)]
Revert "Make LocalAnalizer visitor iterate instead of recurse"

This reverts commit 0cfaa28bc5edda198571fca9410cbc9f71b8d17a.

5 years agoAuto merge of #61130 - jonhoo:mem-take, r=SimonSapin
bors [Fri, 7 Jun 2019 18:26:15 +0000 (18:26 +0000)]
Auto merge of #61130 - jonhoo:mem-take, r=SimonSapin

Add std::mem::take as suggested in #61129

This PR implements #61129 by adding `std::mem::take`.

The added function is equivalent to:
```rust
std::mem::replace(dest, Default::default())
```

This particular pattern is fairly common, especially when implementing `Future::poll`, where you often need to yield an owned value in `Async::Ready`. This change allows you to write
```rust
return Async::Ready(std::mem::take(self.result));
```
instead of
```rust
return Async::Ready(std::mem::replace(self.result, Vec::new()));
```

EDIT: Changed name from `take` to `swap_default`.
EDIT: Changed name back to `take`.

5 years agotests: Add regression test for #61452.
David Wood [Fri, 7 Jun 2019 17:35:06 +0000 (18:35 +0100)]
tests: Add regression test for #61452.

5 years agosyntax: Treat error literals in more principled way
Vadim Petrochenkov [Fri, 7 Jun 2019 09:53:33 +0000 (12:53 +0300)]
syntax: Treat error literals in more principled way

5 years agoAuto merge of #61622 - Centril:rollup-6ivvmul, r=Centril
bors [Fri, 7 Jun 2019 14:50:22 +0000 (14:50 +0000)]
Auto merge of #61622 - Centril:rollup-6ivvmul, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #61332 (Remove asterisk suggestion for move errors in borrowck)
 - #61532 ([const-prop] Support Rvalue::{Ref,Len} and Deref)
 - #61586 (ci: Disable LLVM/debug assertions for asmjs builder)
 - #61599 (libcore/pin: Minor grammar corrections for module documentation)
 - #61603 (Increases heap size available during testing for SGX)
 - #61605 (Fix slice const generic length display)
 - #61618 (make the backtrace field of EvalError private)

Failed merges:

r? @ghost

5 years agoRollup merge of #61618 - RalfJung:error, r=oli-obk
Mazdak Farrokhzad [Fri, 7 Jun 2019 14:48:10 +0000 (16:48 +0200)]
Rollup merge of #61618 - RalfJung:error, r=oli-obk

make the backtrace field of EvalError private

This also makes sure people don't contruct these the wrong way (i.e., not through the `From` instance).

r? @oli-obk

5 years agoRollup merge of #61605 - GuillaumeGomez:const-generic-display, r=varkor
Mazdak Farrokhzad [Fri, 7 Jun 2019 14:48:09 +0000 (16:48 +0200)]
Rollup merge of #61605 - GuillaumeGomez:const-generic-display, r=varkor

Fix slice const generic length display

Fixes #61487.

r? @varkor

5 years agoRollup merge of #61603 - Goirad:increase-sgx-heapsize, r=alexcrichton
Mazdak Farrokhzad [Fri, 7 Jun 2019 14:48:08 +0000 (16:48 +0200)]
Rollup merge of #61603 - Goirad:increase-sgx-heapsize, r=alexcrichton

Increases heap size available during testing for SGX

PR [61540](https://github.com/rust-lang/rust/pull/61540) causes at least one test to fail when run for the SGX platform due to lack of memory. This PR increases the heapsize available during tests, which is a good thing regardless of the status of that PR.

5 years agoRollup merge of #61599 - laumann:pin-docs-minor-edits, r=Centril
Mazdak Farrokhzad [Fri, 7 Jun 2019 14:48:06 +0000 (16:48 +0200)]
Rollup merge of #61599 - laumann:pin-docs-minor-edits, r=Centril

libcore/pin: Minor grammar corrections for module documentation

This is by no means exhaustive, but I noticed a few grammatical errors
when reading the documentation, and decided just to push these.

Some standard rules/guidelines I followed:

 * Do not split infinitives, ie "not to move" instead of "to not move"

 * Do not use "since" when you want to say "because" or "as" - the word
   "since" has a temporal meaning

In addition:

 * Fix a small typo: "Similarily" should be "Similarly"

 * Delete double-spaces after full stop

5 years agoRollup merge of #61586 - alexcrichton:asmjs-no-assertions, r=pietroalbini
Mazdak Farrokhzad [Fri, 7 Jun 2019 14:48:05 +0000 (16:48 +0200)]
Rollup merge of #61586 - alexcrichton:asmjs-no-assertions, r=pietroalbini

ci: Disable LLVM/debug assertions for asmjs builder

This shaves of 50 minutes of cycle time on Azure and will likely also
save a significant chunk of time on Travis. The assertions here aren't
really buying us much over other builders with assertions already
enabled, so let's disable them for this builder.

cc #61185

5 years agoRollup merge of #61532 - wesleywiser:const_prop_more, r=oli-obk
Mazdak Farrokhzad [Fri, 7 Jun 2019 14:48:03 +0000 (16:48 +0200)]
Rollup merge of #61532 - wesleywiser:const_prop_more, r=oli-obk

[const-prop] Support Rvalue::{Ref,Len} and Deref

Also fixes an ICE I found in testing.

r? @oli-obk

~~The final commit is just for a perf run. I'll remove it after that is completed.~~

5 years agoRollup merge of #61332 - kennethbgoodin:borrowck-remove-asterisk-suggestion, r=matthe...
Mazdak Farrokhzad [Fri, 7 Jun 2019 14:48:02 +0000 (16:48 +0200)]
Rollup merge of #61332 - kennethbgoodin:borrowck-remove-asterisk-suggestion, r=matthewjasper

Remove asterisk suggestion for move errors in borrowck

As per the decision in #54985 completely removes the suggestion to add an asterisk when checking move errors. I believe I've preserved the correct behavior with the "consider borrowing here" branch of the original match arm, but I'm not positive on that.

This is my first PR to rustc so any feedback is greatly appreciated. Thanks.

5 years agoClarify when we run steps with ONLY_HOSTS
Mark Rousskov [Fri, 7 Jun 2019 14:38:29 +0000 (08:38 -0600)]
Clarify when we run steps with ONLY_HOSTS

5 years agoStabilize Cell::from_mut and as_slice_of_cells
Simon Sapin [Fri, 7 Jun 2019 14:25:41 +0000 (16:25 +0200)]
Stabilize Cell::from_mut and as_slice_of_cells

FCP: https://github.com/rust-lang/rust/issues/43038#issuecomment-499900463

5 years agoFix slice const generic length display
Guillaume Gomez [Thu, 6 Jun 2019 22:58:32 +0000 (00:58 +0200)]
Fix slice const generic length display

5 years agoadd doc comment for EvalError
Ralf Jung [Fri, 7 Jun 2019 13:51:29 +0000 (15:51 +0200)]
add doc comment for EvalError

5 years agomake the backtrace field of EvalError private
Ralf Jung [Fri, 7 Jun 2019 11:48:38 +0000 (13:48 +0200)]
make the backtrace field of EvalError private

This also makes sure people don't contruct these the wrong way

5 years agoparser: Remove `look_ahead_span`
Vadim Petrochenkov [Fri, 7 Jun 2019 10:57:57 +0000 (13:57 +0300)]
parser: Remove `look_ahead_span`

5 years agoparser: Remove `Deref` impl from `Parser`
Vadim Petrochenkov [Fri, 7 Jun 2019 10:52:03 +0000 (13:52 +0300)]
parser: Remove `Deref` impl from `Parser`

5 years agoparser: `self.span` -> `self.token.span`
Vadim Petrochenkov [Fri, 7 Jun 2019 10:31:13 +0000 (13:31 +0300)]
parser: `self.span` -> `self.token.span`

5 years agoAuto merge of #61209 - matthewjasper:const-tuple-constructors, r=oli-obk
bors [Fri, 7 Jun 2019 09:41:06 +0000 (09:41 +0000)]
Auto merge of #61209 - matthewjasper:const-tuple-constructors, r=oli-obk

Make tuple constructors real const fns

Mir construction special cases `Ctor(...)` to be lowered as `Ctor { 0: ... }`, which means this doesn't come up much in practice, but it seems inconsistent not to allow this.

r? @oli-obk

5 years agolibcore/pin: Minor grammar corrections for module documentation
Thomas Bracht Laumann Jespersen [Thu, 6 Jun 2019 19:42:15 +0000 (21:42 +0200)]
libcore/pin: Minor grammar corrections for module documentation

This is by no means exhaustive, but I noticed a few grammatical errors
when reading the documentation, and decided just to push these.

Some standard rules/guidelines I followed:

 * Do not split infinitives, ie "not to move" instead of "to not move"

 * Do not use "since" when you want to say "because" or "as" - the word
   "since" has a temporal meaning

In addition:

 * Fix a small typo: "Similarily" should be "Similarly"

 * Delete double-spaces after full stop

5 years agoAuto merge of #61541 - petrochenkov:tsp, r=oli-obk
bors [Fri, 7 Jun 2019 06:52:09 +0000 (06:52 +0000)]
Auto merge of #61541 - petrochenkov:tsp, r=oli-obk

syntax: Keep token span as a part of `Token`

In the world with proc macros and edition hygiene `Token` without a span is not self-contained.
In practice this means that tokens and spans are always stored and passed somewhere along with each other.
This PR combines them into a single struct by doing the next renaming/replacement:

- `Token` -> `TokenKind`
- `TokenAndSpan` -> `Token`
- `(Token, Span)` -> `Token`

Some later commits (https://github.com/rust-lang/rust/commit/fb6e2fe8fd6caed247857758c6c3549fe2b59527 and https://github.com/rust-lang/rust/commit/1cdee86940db892cd17239c26add5364335e895a) remove duplicate spans in `token::Ident` and `token::Lifetime`.
Those spans were supposed to be identical to token spans, but could easily go out of sync, as was noticed in https://github.com/rust-lang/rust/pull/60965#discussion_r285398523.
The `(Token, Span)` -> `Token` change is a soft pre-requisite for this de-duplication since it allows to avoid some larger churn (passing spans to most of functions classifying identifiers).

5 years agoAdd nested 'yield' expression to weird expressions test
Aaron Hill [Fri, 7 Jun 2019 03:01:54 +0000 (23:01 -0400)]
Add nested 'yield' expression to weird expressions test

5 years agoAuto merge of #61408 - varkor:fmin-fmax-llvm-intrinsics, r=alexcrichton
bors [Fri, 7 Jun 2019 01:42:15 +0000 (01:42 +0000)]
Auto merge of #61408 - varkor:fmin-fmax-llvm-intrinsics, r=alexcrichton

Use LLVM intrinsics for floating-point min/max

Resurrection of https://github.com/rust-lang/rust/pull/46926, now that the optimisation issues are fixed. I've confirmed locally that https://github.com/rust-lang/rust/pull/61384 solves the issues.

I'm not sure if we're allowed to move the `min`/`max` methods from libcore to libstd: I can't quite tell what the status is from https://github.com/rust-lang/rust/issues/50145. However, this is necessary to use the intrinsics.

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

r? @SimonSapin
cc @rkruppe @nikic

5 years agoBless test output
Wesley Wiser [Thu, 6 Jun 2019 21:52:17 +0000 (17:52 -0400)]
Bless test output

5 years agoincrease max heapsize available during sgx tests
Dario Gonzalez [Thu, 6 Jun 2019 21:06:49 +0000 (14:06 -0700)]
increase max heapsize available during sgx tests

5 years agoAuto merge of #61601 - Centril:rollup-uegbsns, r=Centril
bors [Thu, 6 Jun 2019 20:46:15 +0000 (20:46 +0000)]
Auto merge of #61601 - Centril:rollup-uegbsns, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #61376 (Add Bound::cloned())
 - #61554 (Change visit api)
 - #61559 (Make visitors iterate)
 - #61585 (Update .mailmap with my name)
 - #61591 (Update .mailmap)

Failed merges:

r? @ghost

5 years agoRollup merge of #61591 - christianpoveda:patch-1, r=jonas-schievink
Mazdak Farrokhzad [Thu, 6 Jun 2019 20:39:14 +0000 (22:39 +0200)]
Rollup merge of #61591 - christianpoveda:patch-1, r=jonas-schievink

Update .mailmap

5 years agoRollup merge of #61585 - lnicola:mailmap, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 6 Jun 2019 20:39:13 +0000 (22:39 +0200)]
Rollup merge of #61585 - lnicola:mailmap, r=Mark-Simulacrum

Update .mailmap with my name

5 years agoRollup merge of #61559 - spastorino:make-visitors-iterate, r=oli-obk
Mazdak Farrokhzad [Thu, 6 Jun 2019 20:39:12 +0000 (22:39 +0200)]
Rollup merge of #61559 - spastorino:make-visitors-iterate, r=oli-obk

Make visitors iterate

r? @oli-obk

The second commit is not completely equivalent, unsure if the code is wrong or not. Tests pass though, otherwise we would need to iterate in the opposite direction as it happened in other parts of the code.

5 years agoRollup merge of #61554 - spastorino:change_visit_api, r=oli-obk
Mazdak Farrokhzad [Thu, 6 Jun 2019 20:39:10 +0000 (22:39 +0200)]
Rollup merge of #61554 - spastorino:change_visit_api, r=oli-obk

Change visit api

r? @oli-obk

In the [first commit](https://github.com/rust-lang/rust/commit/37386d366a816bc2e63749c7b6045108a6167135) of this PR, I'm changing `visit_place` to be the function that traverses the `Place` and have only that responsibility. Then there are two other functions `visit_place_base` and `visit_projection` which are the ones in charge of visiting the base and the projection. Visitor implementors can implement any of those.

In the [second commit](https://github.com/rust-lang/rust/commit/e786f631b815d171051279e0d6cfe055c75bec2e) we can already see some things that confuses me, which I think this division will make more clear. The old code, first checked if the place was a base, did something with it and then called `super_place` [here](https://github.com/rust-lang/rust/commit/e786f631b815d171051279e0d6cfe055c75bec2e#diff-d583e4efe1a72516e274158e53223633L678). `super_place` checks again if it's a base [here](https://github.com/rust-lang/rust/blob/master/src/librustc/mir/visit.rs#L679-L684) and in case is a local, visits the local and stuff like that. That's not very obvious on the code, and if I'm not wrong it's not needed. In this PR or we have [this](https://github.com/rust-lang/rust/commit/e786f631b815d171051279e0d6cfe055c75bec2e#diff-d583e4efe1a72516e274158e53223633R673) as I did or we can just do `- => self.super_place_base(...)` and that will be obvious that I'm letting the default implementation process the base.

5 years agoRollup merge of #61376 - czipperz:bound-cloned, r=sfackler
Mazdak Farrokhzad [Thu, 6 Jun 2019 20:39:09 +0000 (22:39 +0200)]
Rollup merge of #61376 - czipperz:bound-cloned, r=sfackler

Add Bound::cloned()

Suggested by #61356

5 years agoAdd intrinsics for floating-point min and max
varkor [Thu, 6 Jun 2019 20:27:23 +0000 (21:27 +0100)]
Add intrinsics for floating-point min and max