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

5 years agoFixed rebase fallout.
Alexander Regueiro [Sun, 19 May 2019 23:22:44 +0000 (00:22 +0100)]
Fixed rebase fallout.

5 years agoAddressed points raised in review.
Niko Matsakis [Wed, 8 May 2019 19:57:06 +0000 (15:57 -0400)]
Addressed points raised in review.

5 years agoFixed up some comments.
Alexander Regueiro [Fri, 10 May 2019 02:46:39 +0000 (03:46 +0100)]
Fixed up some comments.

5 years agoAdded some comments, made `add_bounds` private.
Niko Matsakis [Wed, 8 May 2019 19:58:20 +0000 (15:58 -0400)]
Added some comments, made `add_bounds` private.

5 years agoAdded some comments to lowering code.
Niko Matsakis [Wed, 8 May 2019 19:56:39 +0000 (15:56 -0400)]
Added some comments to lowering code.

5 years agoAddressed points raised in review.
Alexander Regueiro [Sat, 4 May 2019 15:09:28 +0000 (16:09 +0100)]
Addressed points raised in review.

5 years agoAdded test suite.
Alexander Regueiro [Sat, 16 Mar 2019 00:03:51 +0000 (00:03 +0000)]
Added test suite.

5 years agoAdded feature gate.
Alexander Regueiro [Thu, 21 Mar 2019 18:40:00 +0000 (18:40 +0000)]
Added feature gate.

5 years agoUse both existential-type desugaring and where-clause (predicate) desugaring dependin...
Alexander Regueiro [Thu, 21 Mar 2019 17:55:09 +0000 (17:55 +0000)]
Use both existential-type desugaring and where-clause (predicate) desugaring depending on context.

5 years agoImplemented for traits (associated type definitions).
Alexander Regueiro [Sat, 16 Mar 2019 00:04:02 +0000 (00:04 +0000)]
Implemented for traits (associated type definitions).

5 years agoImplemented for function bounds, type bounds, and named existential types.
Alexander Regueiro [Thu, 28 Feb 2019 22:43:53 +0000 (22:43 +0000)]
Implemented for function bounds, type bounds, and named existential types.

5 years agoEnabled `Self` in type aliases.
Alexander Regueiro [Sun, 17 Mar 2019 15:26:01 +0000 (15:26 +0000)]
Enabled `Self` in type aliases.

5 years agoAggregation of drive-by cosmetic changes.
Alexander Regueiro [Thu, 28 Feb 2019 22:43:53 +0000 (22:43 +0000)]
Aggregation of drive-by cosmetic changes.

5 years agolibrustc_errors: Rename AnnotateRs -> AnnotateSnippet
Philipp Hansch [Wed, 5 Jun 2019 19:13:56 +0000 (21:13 +0200)]
librustc_errors: Rename AnnotateRs -> AnnotateSnippet

The proper name of the library is `annotate-snippet`, not `annotate-rs`,
this commit 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 agorustbuild: Include `rustfmt` in deduplicated dependencies
Alex Crichton [Wed, 5 Jun 2019 19:38:05 +0000 (12:38 -0700)]
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 agoAuto merge of #61548 - Centril:rollup-5t6cvbk, r=Centril
bors [Wed, 5 Jun 2019 18:29:39 +0000 (18:29 +0000)]
Auto merge of #61548 - Centril:rollup-5t6cvbk, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #61503 (Fix cfg(test) build for x86_64-fortanix-unknown-sgx)
 - #61534 (Edit docs of ExitStatus)
 - #61536 (Don't allow using const fn arguments as "args_required_const")
 - #61538 (Don't use GNU noexec stack note)
 - #61546 (azure: Fix some minor issues which have broken our configuration )

Failed merges:

r? @ghost

5 years agoFix after rebase
varkor [Wed, 5 Jun 2019 16:19:01 +0000 (17:19 +0100)]
Fix after rebase

5 years agoRefactor `ConstVariableOrigin` into `ConstVariableOrigin` and `ConstVariableOriginKind`
varkor [Fri, 31 May 2019 21:52:35 +0000 (22:52 +0100)]
Refactor `ConstVariableOrigin` into `ConstVariableOrigin` and `ConstVariableOriginKind`

5 years agoRefactor `TypeVariableOrigin` into `TypeVariableOrigin` and `TypeVariableOriginKind`
varkor [Thu, 21 Mar 2019 00:00:24 +0000 (00:00 +0000)]
Refactor `TypeVariableOrigin` into `TypeVariableOrigin` and `TypeVariableOriginKind`

5 years agoRemove unused `TypeVariableOrigin` variants
varkor [Thu, 21 Mar 2019 00:00:06 +0000 (00:00 +0000)]
Remove unused `TypeVariableOrigin` variants

5 years agoRollup merge of #61546 - alexcrichton:fix-azure, r=pietroalbini
Mazdak Farrokhzad [Wed, 5 Jun 2019 15:43:34 +0000 (17:43 +0200)]
Rollup merge of #61546 - alexcrichton:fix-azure, r=pietroalbini

azure: Fix some minor issues which have broken our configuration

* Ensure that when we enable IPv6 for Docker on Linux that the various directories before writing a config file
* Delete a previously installed rustup if any since it seems to interfere with Cargo's test suite.

5 years agoRollup merge of #61538 - coypoop:patch-1, r=alexcrichton
Mazdak Farrokhzad [Wed, 5 Jun 2019 15:43:33 +0000 (17:43 +0200)]
Rollup merge of #61538 - coypoop:patch-1, r=alexcrichton

Don't use GNU noexec stack note

NetBSD ignores this note and marks the stack no-exec unconditionally

5 years agoRollup merge of #61536 - oli-obk:args_required_const_in_const_fn, r=eddyb
Mazdak Farrokhzad [Wed, 5 Jun 2019 15:43:31 +0000 (17:43 +0200)]
Rollup merge of #61536 - oli-obk:args_required_const_in_const_fn, r=eddyb

Don't allow using const fn arguments as "args_required_const"

r? @eddyb

5 years agoRollup merge of #61534 - ReinierMaas:patch-1, r=Centril
Mazdak Farrokhzad [Wed, 5 Jun 2019 15:43:30 +0000 (17:43 +0200)]
Rollup merge of #61534 - ReinierMaas:patch-1, r=Centril

Edit docs of ExitStatus

The documentation of [`ExitStatus`] are extended to be at the same depth as [`Output`].

5 years agoRollup merge of #61503 - jethrogb:jb/fix-sgx-test, r=alexcrichton
Mazdak Farrokhzad [Wed, 5 Jun 2019 15:43:28 +0000 (17:43 +0200)]
Rollup merge of #61503 - jethrogb:jb/fix-sgx-test, r=alexcrichton

Fix cfg(test) build for x86_64-fortanix-unknown-sgx

5 years agoAuto merge of #61498 - TankhouseAle:const-fn-type-name, r=oli-obk
bors [Wed, 5 Jun 2019 15:40:16 +0000 (15:40 +0000)]
Auto merge of #61498 - TankhouseAle:const-fn-type-name, r=oli-obk

Add "type_name" support in emulate_intrinsic()

I did some dumb Git things and deleted my original fork repo semi-accidentally (but probably for the best as I'd messed up the history.)

This is the same issue as #61399, which was obviously auto-closed, to be clear.

5 years agoazure: Uninstall previous rustc from builders if any
Alex Crichton [Wed, 5 Jun 2019 14:36:19 +0000 (07:36 -0700)]
azure: Uninstall previous rustc from builders if any

Looks like Azure has updated images recently to install Rust by default,
but that can interfere with our own compiler (for example Cargo's test
suite we think) so be sure to uninstall it before proceeding.

5 years agoazure: Make sure docker directory exists
Alex Crichton [Tue, 4 Jun 2019 14:30:33 +0000 (07:30 -0700)]
azure: Make sure docker directory exists

Looks like the Azure image changed recently so let's account for that!

5 years agoAuto merge of #61484 - nnethercote:avoid-more-hygiene-lookups, r=petrochenkov
bors [Wed, 5 Jun 2019 12:46:15 +0000 (12:46 +0000)]
Auto merge of #61484 - nnethercote:avoid-more-hygiene-lookups, r=petrochenkov

Avoid more hygiene lookups

Mostly by combining multiple `HygieneData::with` calls into a single call on hot paths.

r? @petrochenkov

5 years agoExplain the existience of the regression test
Oliver Scherer [Wed, 5 Jun 2019 11:25:17 +0000 (13:25 +0200)]
Explain the existience of the regression test

5 years agoDon't use GNU noexec stack note
coypoop [Wed, 5 Jun 2019 09:19:34 +0000 (12:19 +0300)]
Don't use GNU noexec stack note

NetBSD ignores this note and marks the stack no-exec unconditionally

5 years agoAuto merge of #61502 - alexcrichton:update-backtrace, r=estebank
bors [Wed, 5 Jun 2019 08:20:20 +0000 (08:20 +0000)]
Auto merge of #61502 - alexcrichton:update-backtrace, r=estebank

std: Update dependency on `backtrace`

Discovered in #61416 an accidental regression in libstd's backtrace
behavior is that it previously attempted to consult libbacktrace and
would then fall back to `dladdr` if libbacktrace didn't report anything.
The `backtrace` crate, however, did not do this, so that's now been
fixed!

Changes: https://github.com/rust-lang/backtrace-rs/compare/0.3.25...0.3.29

Closes #61416

5 years agoTidy: trailing whitespace
Reinier Maas [Wed, 5 Jun 2019 07:58:39 +0000 (09:58 +0200)]
Tidy: trailing whitespace

Removed trailing whitespace from documentation of ExitStatus.

5 years agoDon't allow using const fn arguments as "args_required_const"
Oliver Scherer [Wed, 5 Jun 2019 07:37:16 +0000 (09:37 +0200)]
Don't allow using const fn arguments as "args_required_const"

5 years agoEdit docs of ExitStatus
Reinier Maas [Wed, 5 Jun 2019 06:41:37 +0000 (08:41 +0200)]
Edit docs of ExitStatus

The documentation of [`ExitStatus`] are extended to be at the same depth as [`Output`].

5 years agostd: Update dependency on `backtrace`
Alex Crichton [Mon, 3 Jun 2019 19:29:53 +0000 (12:29 -0700)]
std: Update dependency on `backtrace`

Discovered in #61416 an accidental regression in libstd's backtrace
behavior is that it previously attempted to consult libbacktrace and
would then fall back to `dladdr` if libbacktrace didn't report anything.
The `backtrace` crate, however, did not do this, so that's now been
fixed!

Changes: https://github.com/rust-lang/backtrace-rs/compare/0.3.25...0.3.27

Closes #61416

5 years agoFix spelling
Tyler Mandry [Fri, 31 May 2019 18:01:07 +0000 (11:01 -0700)]
Fix spelling

Co-Authored-By: Ralf Jung <post@ralfj.de>
5 years agoAdd test for DropAndReplace bug
Tyler Mandry [Wed, 22 May 2019 22:17:38 +0000 (15:17 -0700)]
Add test for DropAndReplace bug

5 years agoMove cached_block out of DropKind
Tyler Mandry [Thu, 30 May 2019 20:21:17 +0000 (13:21 -0700)]
Move cached_block out of DropKind

5 years agoGenerate StorageDead along unwind paths for generators
Tyler Mandry [Wed, 22 May 2019 19:31:43 +0000 (12:31 -0700)]
Generate StorageDead along unwind paths for generators

5 years agoRevert "Make MaybeStorageLive drop-aware"
Tyler Mandry [Thu, 30 May 2019 20:28:31 +0000 (13:28 -0700)]
Revert "Make MaybeStorageLive drop-aware"

This reverts commit dd2eabc49d415dd30cea0953df5d7659d4d9440f.

5 years agoAdd `modernize_and_adjust` methods.
Nicholas Nethercote [Mon, 3 Jun 2019 06:10:03 +0000 (16:10 +1000)]
Add `modernize_and_adjust` methods.

These combine two `HygieneData::with` calls into one.

5 years agoAuto merge of #61527 - pietroalbini:rollup-vhxyqlk, r=pietroalbini
bors [Tue, 4 Jun 2019 23:05:05 +0000 (23:05 +0000)]
Auto merge of #61527 - pietroalbini:rollup-vhxyqlk, r=pietroalbini

Rollup of 5 pull requests

Successful merges:

 - #61069 (Make MIR drop terminators borrow the dropped location)
 - #61453 (Remove unneeded feature attr from atomic integers doctests)
 - #61488 (Fix NLL typeck ICEs)
 - #61500 (Fix regression 61475)
 - #61523 (Hide gen_future API from documentation)

Failed merges:

r? @ghost

5 years agoAvoid unnecessary `rust_2018` calls.
Nicholas Nethercote [Mon, 3 Jun 2019 05:34:54 +0000 (15:34 +1000)]
Avoid unnecessary `rust_2018` calls.

The commit combines two calls into one by saving the result in a local
variable. The commit also moves the check for `async` later, so that
when a different keyword is present the `rust_2018` call will be avoided
completely.

5 years agoAdd a useful comment about this file.
Nicholas Nethercote [Mon, 3 Jun 2019 03:08:15 +0000 (13:08 +1000)]
Add a useful comment about this file.

5 years agoAdd `walk_chain`.
Nicholas Nethercote [Mon, 3 Jun 2019 02:07:51 +0000 (12:07 +1000)]
Add `walk_chain`.

This combines multiple `HygieneData::with` calls on a hot path.

5 years agoAdd `SyntaxContext::hygienic_eq`.
Nicholas Nethercote [Sun, 2 Jun 2019 23:43:20 +0000 (09:43 +1000)]
Add `SyntaxContext::hygienic_eq`.

This combines multiple `HygieneData::with` calls into one, by combining
parts of `hygienic_eq` and `adjust_ident`.

5 years agoAdd and use `SyntaxContext::outer_and_expn_info`.
Nicholas Nethercote [Sun, 2 Jun 2019 23:21:27 +0000 (09:21 +1000)]
Add and use `SyntaxContext::outer_and_expn_info`.

This combines two `HygieneData::with` calls into one on a hot path.

5 years agoOptimize `glob_adjust` and `reverse_glob_adjust`.
Nicholas Nethercote [Fri, 31 May 2019 22:35:01 +0000 (08:35 +1000)]
Optimize `glob_adjust` and `reverse_glob_adjust`.

They can each now do a single `HygieneData::with` call by replacing the
`SyntaxContext` and `Mark` methods with the equivalent methods from
`HygieneData`.

5 years agoAdd `HygieneData::apply_mark`.
Nicholas Nethercote [Sat, 1 Jun 2019 22:35:37 +0000 (08:35 +1000)]
Add `HygieneData::apply_mark`.

This combines two `HygieneData::with` calls into one.

5 years agoAdd `HygieneData::apply_mark_with_transparency`.
Nicholas Nethercote [Sat, 1 Jun 2019 22:23:54 +0000 (08:23 +1000)]
Add `HygieneData::apply_mark_with_transparency`.

Also remove `HygieneData::apply_mark_internal`, which is no longer
needed.

5 years agoAdd `HygieneData::apply_mark_internal`.
Nicholas Nethercote [Sat, 1 Jun 2019 22:16:46 +0000 (08:16 +1000)]
Add `HygieneData::apply_mark_internal`.

5 years agoAdd `HygieneData::marks`.
Nicholas Nethercote [Sat, 1 Jun 2019 22:27:36 +0000 (08:27 +1000)]
Add `HygieneData::marks`.

5 years agoAdd `HygieneData::adjust`.
Nicholas Nethercote [Fri, 31 May 2019 21:44:14 +0000 (07:44 +1000)]
Add `HygieneData::adjust`.

5 years agoAdd `HygieneData::remove_mark`.
Nicholas Nethercote [Fri, 31 May 2019 21:28:15 +0000 (07:28 +1000)]
Add `HygieneData::remove_mark`.

5 years agoAdd `HygieneData::default_transparency`.
Nicholas Nethercote [Fri, 31 May 2019 21:24:51 +0000 (07:24 +1000)]
Add `HygieneData::default_transparency`.

Also use `HygieneData::expn_info` in an appropriate place.

5 years agoAdd some useful methods to `HygieneData`.
Nicholas Nethercote [Fri, 31 May 2019 21:19:58 +0000 (07:19 +1000)]
Add some useful methods to `HygieneData`.

5 years agoMove `modern` calls inside `glob_adjust` and `reverse_glob_adjust`.
Nicholas Nethercote [Fri, 31 May 2019 06:50:44 +0000 (16:50 +1000)]
Move `modern` calls inside `glob_adjust` and `reverse_glob_adjust`.

5 years agoRollup merge of #61523 - Nemo157:hide-gen-future, r=cramertj
Pietro Albini [Tue, 4 Jun 2019 20:39:41 +0000 (22:39 +0200)]
Rollup merge of #61523 - Nemo157:hide-gen-future, r=cramertj

Hide gen_future API from documentation

This is internal rustc only API which should never be used outside code created by the current `async` transform, if it is used then the panic messages don't make sense as they're written from the perspective of that meaning there is a bug in the `async` transform (e.g. #61482).

5 years agoRollup merge of #61500 - estebank:expregression, r=petrochenkov
Pietro Albini [Tue, 4 Jun 2019 20:39:39 +0000 (22:39 +0200)]
Rollup merge of #61500 - estebank:expregression, r=petrochenkov

Fix regression 61475

Addresses #61475.

5 years agoRollup merge of #61488 - matthewjasper:fix-nll-typeck-ices, r=pnkfelix
Pietro Albini [Tue, 4 Jun 2019 20:39:38 +0000 (22:39 +0200)]
Rollup merge of #61488 - matthewjasper:fix-nll-typeck-ices, r=pnkfelix

Fix NLL typeck ICEs

* Don't ICE when a type containing a region is constrained by nothing
* Don't ICE trying to normalize a type in a `ParamEnv` containing global bounds.

To explain what was happening in the `issue-61311-normalize.rs` case:

* When borrow checking the `the_fn` in the last `impl` we would try to normalize `Self::Proj` (`<Unit as HasProjFn>::Proj`).
* We would find the `impl` that we're checking and and check its `where` clause.
* This would need us to check `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound`
* We find two possible implementations, the blanket impl and the bound in our `ParamEnv`.
* The bound in our `ParamEnv` was canonicalized, so we don't see it as a global bound. As such we prefer it to the `impl`.
* This means that we cannot normalize `<Box<dyn Obj + 'static> as HasProj>::Proj` to `Unit`.
* The `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound` bound, which looks like it should be in our `ParamEnv` has been normalized to `Unit: Bound`.
* We fail to prove `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound`.
* We ICE, since we believe typeck have errored.

Closes #61311
Closes #61315
Closes #61320

r? @pnkfelix
cc @nikomatsakis

5 years agoRollup merge of #61453 - lzutao:nouse-featuregate-integer_atomics, r=sfackler
Pietro Albini [Tue, 4 Jun 2019 20:39:36 +0000 (22:39 +0200)]
Rollup merge of #61453 - lzutao:nouse-featuregate-integer_atomics, r=sfackler

Remove unneeded feature attr from atomic integers doctests

Closes #61448

r? @Centril

5 years agoRollup merge of #61069 - Zoxc:drop-borrow-fix, r=pnkfelix
Pietro Albini [Tue, 4 Jun 2019 20:39:35 +0000 (22:39 +0200)]
Rollup merge of #61069 - Zoxc:drop-borrow-fix, r=pnkfelix

Make MIR drop terminators borrow the dropped location

r? @eddyb
cc @tmandry

5 years agoAuto merge of #61407 - phansch:annotate_snippet_refactoring1, r=oli-obk
bors [Tue, 4 Jun 2019 20:10:54 +0000 (20:10 +0000)]
Auto merge of #61407 - phansch:annotate_snippet_refactoring1, r=oli-obk

Add new diagnostic writer using annotate-snippet library

This adds a new diagnostic writer `AnnotateRsEmitterWriter` that uses
the [`annotate-snippet`][as] library to print out the human readable
diagnostics.

The goal of #59346 is to eventually switch over to using the library instead of
maintaining our own diagnostics output.

This PR does **not** add all the required features to the new
diagnostics writer. It is only meant as a starting point so that other
people can start contributing as well.

There are some FIXMEs in `librustc_errors/annotate_rs_emitter.rs` that
point at yet to be implemented features of the new diagnostic emitter, however
those are most likely not exhaustive.

[as]: https://github.com/rust-lang/annotate-snippets-rs

5 years agoHide gen_future API from documentation
Wim Looman [Tue, 4 Jun 2019 17:22:30 +0000 (19:22 +0200)]
Hide gen_future API from documentation

5 years agoAuto merge of #61454 - lzutao:ice-rotate_left, r=RalfJung
bors [Tue, 4 Jun 2019 17:20:14 +0000 (17:20 +0000)]
Auto merge of #61454 - lzutao:ice-rotate_left, r=RalfJung

Fix integer overflow in rotate_left

Closes #61406
r? @RalfJung

5 years agoeprint -> eprintln to add trailing newline
Philipp Hansch [Mon, 3 Jun 2019 05:38:55 +0000 (07:38 +0200)]
eprint -> eprintln to add trailing newline

5 years agoSimplify source_string and block-format methods
Philipp Hansch [Mon, 3 Jun 2019 05:38:19 +0000 (07:38 +0200)]
Simplify source_string and block-format methods

5 years agoPrint to stderr and bless
Philipp Hansch [Sat, 1 Jun 2019 06:29:12 +0000 (08:29 +0200)]
Print to stderr and bless