]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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

5 years agoUpdate compiler_builtins
varkor [Thu, 6 Jun 2019 20:27:07 +0000 (21:27 +0100)]
Update compiler_builtins

5 years agoUpdate .mailmap
Christian Poveda [Thu, 6 Jun 2019 16:52:07 +0000 (11:52 -0500)]
Update .mailmap

5 years agoMake sure constructors functions are type checked correctly
Matthew Jasper [Sun, 26 May 2019 09:43:30 +0000 (10:43 +0100)]
Make sure constructors functions are type checked correctly

5 years agoMake constructors actually be const functions
Matthew Jasper [Sun, 26 May 2019 08:58:06 +0000 (09:58 +0100)]
Make constructors actually be const functions

5 years agoDon't run MIR passes on constructor shims
Matthew Jasper [Sun, 26 May 2019 08:55:50 +0000 (09:55 +0100)]
Don't run MIR passes on constructor shims

5 years agoci: Disable LLVM/debug assertions for asmjs builder
Alex Crichton [Thu, 6 Jun 2019 14:57:37 +0000 (07:57 -0700)]
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 agoUpdate .mailmap with my name
Laurențiu Nicola [Thu, 6 Jun 2019 13:37:23 +0000 (16:37 +0300)]
Update .mailmap with my name

5 years ago[const-prop] Handle Rvalue::Len
Wesley Wiser [Mon, 20 May 2019 09:46:33 +0000 (05:46 -0400)]
[const-prop] Handle Rvalue::Len

5 years ago[const-prop] Handle ProjectionElem::Deref
Wesley Wiser [Tue, 4 Jun 2019 01:52:26 +0000 (21:52 -0400)]
[const-prop] Handle ProjectionElem::Deref

5 years ago[const-prop] Handle Rvalue::Ref
Wesley Wiser [Fri, 31 May 2019 08:35:57 +0000 (04:35 -0400)]
[const-prop] Handle Rvalue::Ref

5 years ago[const-prop] Fix ICE when casting function pointers
Wesley Wiser [Wed, 5 Jun 2019 01:51:30 +0000 (21:51 -0400)]
[const-prop] Fix ICE when casting function pointers

This fixes an ICE when building libcore with `-Z mir-opt-level=3`.

5 years agoAuto merge of #61583 - Centril:rollup-ug2cbfd, r=Centril
bors [Thu, 6 Jun 2019 12:13:54 +0000 (12:13 +0000)]
Auto merge of #61583 - Centril:rollup-ug2cbfd, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #61556 (librustc_errors: Rename AnnotateRs -> AnnotateSnippet)
 - #61557 (rustbuild: Include `rustfmt` in deduplicated dependencies)
 - #61571 (Escape HashMap with backticks in needs_drop docs)
 - #61582 (submodules: update clippy from 20da8f45 to 71be6f62)

Failed merges:

r? @ghost

5 years agoRollup merge of #61582 - matthiaskrgr:submodule_upd, r=oli-obk
Mazdak Farrokhzad [Thu, 6 Jun 2019 11:19:28 +0000 (13:19 +0200)]
Rollup merge of #61582 - matthiaskrgr:submodule_upd, r=oli-obk

submodules: update clippy from 20da8f45 to 71be6f62

Changes:
````
rustup https://github.com/rust-lang/rust/pull/57428/
Remove `to_string()`s from CompilerLintFunctions
Fix comment grammar
Fix .map(..).unwrap_or_else(..) bad suggestion
add suggestions for print/write with newline lint
````
Fixes https://github.com/rust-lang/rust/issues/61578
r? @oli-obk

5 years agoRollup merge of #61571 - czipperz:needs_drop-doc-escape-HashMap, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 6 Jun 2019 11:19:26 +0000 (13:19 +0200)]
Rollup merge of #61571 - czipperz:needs_drop-doc-escape-HashMap, r=Mark-Simulacrum

Escape HashMap with backticks in needs_drop docs

5 years agoRollup merge of #61557 - alexcrichton:build-less, r=pietroalbini
Mazdak Farrokhzad [Thu, 6 Jun 2019 11:19:25 +0000 (13:19 +0200)]
Rollup merge of #61557 - alexcrichton:build-less, r=pietroalbini

rustbuild: Include `rustfmt` in deduplicated dependencies

Currently `rustfmt` is excluded from the "don't build dependencies
twice" check but it's currently building dependencies twice! Namely big
dependencies like `rustc-ap-syntax` are built once for rustfmt and once
for the RLS. This commit includes `rustfmt` in these checks and then
fixes the resulting feature mismatches for winapi.

5 years agoRollup merge of #61556 - phansch:emitter_cleanup, r=estebank
Mazdak Farrokhzad [Thu, 6 Jun 2019 11:19:23 +0000 (13:19 +0200)]
Rollup merge of #61556 - phansch:emitter_cleanup, r=estebank

librustc_errors: Rename AnnotateRs -> AnnotateSnippet

The proper name of the library is `annotate-snippet`, not `annotate-rs`,
this PR should get rid of any confusing `AnnotateRs` names.

1. Renames `annotate_rs_emitter.rs` to
   `annotate_snippet_emitter_writer.rs` so that the difference between the
   `Emitter` trait and the implementers is more clear.
2. Renames `AnnotateRsEmitterWriter` to `AnnotateSnippetEmitterWriter`
3. Renames `HumanReadableErrorType::AnnotateRs` to `HumanReadableErrorType::AnnotateSnippet`

5 years agoAddress review comments
Vadim Petrochenkov [Wed, 5 Jun 2019 19:04:52 +0000 (22:04 +0300)]
Address review comments

5 years agoSome code cleanup and tidy/test fixes
Vadim Petrochenkov [Wed, 5 Jun 2019 11:17:56 +0000 (14:17 +0300)]
Some code cleanup and tidy/test fixes

5 years agosyntax: Use `Token` in visitors and fix a mut visitor test
Vadim Petrochenkov [Wed, 5 Jun 2019 10:54:54 +0000 (13:54 +0300)]
syntax: Use `Token` in visitors and fix a mut visitor test

5 years agosyntax: Switch function parameter order in `TokenTree::token`
Vadim Petrochenkov [Wed, 5 Jun 2019 10:25:26 +0000 (13:25 +0300)]
syntax: Switch function parameter order in `TokenTree::token`

5 years agosyntax: Use `Token` in some more places
Vadim Petrochenkov [Wed, 5 Jun 2019 10:24:54 +0000 (13:24 +0300)]
syntax: Use `Token` in some more places

5 years agosyntax: Remove duplicate span from `token::Ident`
Vadim Petrochenkov [Wed, 5 Jun 2019 08:56:06 +0000 (11:56 +0300)]
syntax: Remove duplicate span from `token::Ident`

5 years agosyntax: Remove duplicate span from `token::Lifetime`
Vadim Petrochenkov [Wed, 5 Jun 2019 08:00:22 +0000 (11:00 +0300)]
syntax: Remove duplicate span from `token::Lifetime`

5 years agosyntax: Add some helper methods to `Token`
Vadim Petrochenkov [Wed, 5 Jun 2019 06:39:34 +0000 (09:39 +0300)]
syntax: Add some helper methods to `Token`

5 years agosyntax: Use `Token` in `Parser`
Vadim Petrochenkov [Tue, 4 Jun 2019 22:17:07 +0000 (01:17 +0300)]
syntax: Use `Token` in `Parser`

5 years agosyntax: Use `Token` in `StringReader` and `TokenTreesReader`
Vadim Petrochenkov [Tue, 4 Jun 2019 21:02:59 +0000 (00:02 +0300)]
syntax: Use `Token` in `StringReader` and `TokenTreesReader`

5 years agosyntax: Use `Token` in `TokenTree::Token`
Vadim Petrochenkov [Tue, 4 Jun 2019 17:42:43 +0000 (20:42 +0300)]
syntax: Use `Token` in `TokenTree::Token`

5 years agosyntax: Rename `TokenAndSpan` into `Token`
Vadim Petrochenkov [Tue, 4 Jun 2019 15:48:40 +0000 (18:48 +0300)]
syntax: Rename `TokenAndSpan` into `Token`

5 years agosyntax: Rename `Token` into `TokenKind`
Vadim Petrochenkov [Tue, 4 Jun 2019 14:55:23 +0000 (17:55 +0300)]
syntax: Rename `Token` into `TokenKind`

5 years agoAlways use token kinds through `token` module rather than `Token` type
Vadim Petrochenkov [Thu, 23 May 2019 23:04:56 +0000 (02:04 +0300)]
Always use token kinds through `token` module rather than `Token` type

5 years agosubmodules: update clippy from 20da8f45 to 71be6f62
Matthias Krüger [Thu, 6 Jun 2019 10:56:26 +0000 (12:56 +0200)]
submodules: update clippy from 20da8f45 to 71be6f62

Changes:
````
rustup https://github.com/rust-lang/rust/pull/57428/
Remove `to_string()`s from CompilerLintFunctions
Fix comment grammar
Fix .map(..).unwrap_or_else(..) bad suggestion
add suggestions for print/write with newline lint
````

5 years agoImplement only visit_place_base for monomorphize/collector
Santiago Pastorino [Wed, 5 Jun 2019 18:09:26 +0000 (20:09 +0200)]
Implement only visit_place_base for monomorphize/collector

5 years agoMake visit_place traverse place and have visit_place_base and visit_projection doing...
Santiago Pastorino [Wed, 5 Jun 2019 17:56:11 +0000 (19:56 +0200)]
Make visit_place traverse place and have visit_place_base and visit_projection doing the real work

5 years agoAuto merge of #61494 - Mark-Simulacrum:move-to-cfg-bootstrap, r=alexcrichton
bors [Thu, 6 Jun 2019 09:27:47 +0000 (09:27 +0000)]
Auto merge of #61494 - Mark-Simulacrum:move-to-cfg-bootstrap, r=alexcrichton

Utilize cfg(bootstrap) over cfg(stage0)

Also removes stage1, stage2 cfgs being passed to rustc to ensure that
stage1 and stage2 are only differentiated as a group (i.e., only through
not bootstrap).

Fixes #53582

r? @alexcrichton

5 years agoAuto merge of #61373 - tmandry:emit-storagedead-along-unwind, r=eddyb
bors [Thu, 6 Jun 2019 06:36:12 +0000 (06:36 +0000)]
Auto merge of #61373 - tmandry:emit-storagedead-along-unwind, r=eddyb

Emit StorageDead along unwind paths for generators

Completion of the work done in #60840. That PR made a change to implicitly consider a local `StorageDead` after Drop, but that was incorrect for DropAndReplace (see also #61060 which tried to fix this in a different way).

This finally enables the optimization implemented in #60187.

r? @eddyb
cc @Zoxc @cramertj @RalfJung

5 years agoRemove dereference
Chris Gregory [Thu, 6 Jun 2019 04:23:45 +0000 (21:23 -0700)]
Remove dereference

Co-Authored-By: Steven Fackler <sfackler@gmail.com>
5 years agoTake self by value (Self is Copy here)
Chris Gregory [Thu, 6 Jun 2019 04:11:02 +0000 (21:11 -0700)]
Take self by value (Self is Copy here)

5 years agoAuto merge of #57428 - alexreg:associated_type_bounds, r=nikomatsakis,Centril
bors [Thu, 6 Jun 2019 03:56:22 +0000 (03:56 +0000)]
Auto merge of #57428 - alexreg:associated_type_bounds, r=nikomatsakis,Centril

Implementation of RFC 2289 (associated_type_bounds)

This PR implements the [`asociated_type_bounds` feature](https://github.com/rust-lang/rfcs/blob/master/text/2289-associated-type-bounds.md).

Associated type bounds are implemented in:
   - function/method arguments and return types
   - structs, enums, unions
   - associated items in traits
   - type aliases
   - type parameter defaults
   - trait objects
   - let bindings

CC @nikomatsakis @centril

5 years agoMake LocalAnalizer visitor iterate instead of recurse
Santiago Pastorino [Wed, 5 Jun 2019 19:25:09 +0000 (21:25 +0200)]
Make LocalAnalizer visitor iterate instead of recurse

5 years agoMake UnsafetyChecker visitor iterate instead of recurse
Santiago Pastorino [Wed, 5 Jun 2019 19:01:17 +0000 (21:01 +0200)]
Make UnsafetyChecker visitor iterate instead of recurse

5 years agoReblessed tests with NLL compare mode on.
Alexander Regueiro [Thu, 6 Jun 2019 02:28:53 +0000 (03:28 +0100)]
Reblessed tests with NLL compare mode on.

5 years agoEscape needs_drop in the needs_drop documentation
Chris Gregory [Thu, 6 Jun 2019 01:22:31 +0000 (18:22 -0700)]
Escape needs_drop in the needs_drop documentation

5 years agoEscape HashMap with backticks in needs_drop docs
Chris Gregory [Thu, 6 Jun 2019 01:21:17 +0000 (18:21 -0700)]
Escape HashMap with backticks in needs_drop docs

5 years agoAuto merge of #59331 - varkor:TypeVariableOrigin-refactor, r=eddyb
bors [Thu, 6 Jun 2019 01:04:14 +0000 (01:04 +0000)]
Auto merge of #59331 - varkor:TypeVariableOrigin-refactor, r=eddyb

Refactor `TypeVariableOrigin`

Removes some unused variants and extracts the common `Span` field.

As suggested in https://github.com/rust-lang/rust/pull/59008#discussion_r265031209.

r? @eddyb

5 years agoUtilize cfg(bootstrap) over cfg(stage0)
Mark Rousskov [Mon, 3 Jun 2019 17:14:45 +0000 (11:14 -0600)]
Utilize cfg(bootstrap) over cfg(stage0)

Also removes stage1, stage2 cfgs being passed to rustc to ensure that
stage1 and stage2 are only differentiated as a group (i.e., only through
not bootstrap).

5 years agoTest StorageDead statements explicitly
Tyler Mandry [Sat, 1 Jun 2019 01:49:22 +0000 (18:49 -0700)]
Test StorageDead statements explicitly

5 years agoadd an example to `create_substs_for_ast_path`
Alexander Regueiro [Wed, 5 Jun 2019 20:08:36 +0000 (21:08 +0100)]
add an example to `create_substs_for_ast_path`

5 years agoverified that skip-binder is ok
Niko Matsakis [Wed, 5 Jun 2019 19:27:19 +0000 (15:27 -0400)]
verified that skip-binder is ok

5 years agoanother comment
Niko Matsakis [Wed, 5 Jun 2019 19:20:40 +0000 (15:20 -0400)]
another comment

5 years agomore comments
Niko Matsakis [Fri, 31 May 2019 21:30:44 +0000 (17:30 -0400)]
more comments

5 years agocomment `instantiate_poly_trait_ref` and its binder behavior
Niko Matsakis [Fri, 31 May 2019 21:15:15 +0000 (17:15 -0400)]
comment `instantiate_poly_trait_ref` and its binder behavior

5 years agomake `instantiate_poly_trait_ref_inner` private to this module
Niko Matsakis [Fri, 31 May 2019 21:14:36 +0000 (17:14 -0400)]
make `instantiate_poly_trait_ref_inner` private to this module

5 years agodocument the `Bounds` struct a bit
Alexander Regueiro [Wed, 5 Jun 2019 19:57:44 +0000 (20:57 +0100)]
document the `Bounds` struct a bit

5 years agoadded a few comments
Niko Matsakis [Wed, 8 May 2019 19:58:42 +0000 (15:58 -0400)]
added a few comments

5 years agoRemoved unnecessary nested-lifetime-bounds test.
Alexander Regueiro [Sun, 2 Jun 2019 18:31:55 +0000 (19:31 +0100)]
Removed unnecessary nested-lifetime-bounds test.

5 years agoReblessed tests.
Alexander Regueiro [Mon, 20 May 2019 00:08:52 +0000 (01:08 +0100)]
Reblessed tests.