]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAuto merge of #64564 - jonas-schievink:cowardly-default, r=nikomatsakis
bors [Sun, 6 Oct 2019 16:32:46 +0000 (16:32 +0000)]
Auto merge of #64564 - jonas-schievink:cowardly-default, r=nikomatsakis

Deny specializing items not in the parent impl

Part of https://github.com/rust-lang/rust/issues/29661 (https://github.com/rust-lang/rfcs/pull/2532). At least sort of?

This was discussed in https://github.com/rust-lang/rust/pull/61812#discussion_r300504114 and is needed for that PR to make progress (fixing an unsoundness).

One annoyance with doing this is that it sometimes requires users to copy-paste a provided trait method into an impl just to mark it `default` (ie. there is no syntax to forward this impl method to the provided trait method).

cc @Centril and @arielb1

4 years agoAuto merge of #65089 - nnethercote:optimize-integral-pattern-matching, r=Mark-Simulacrum
bors [Sun, 6 Oct 2019 12:50:47 +0000 (12:50 +0000)]
Auto merge of #65089 - nnethercote:optimize-integral-pattern-matching, r=Mark-Simulacrum

Optimize integral pattern matching

Various improvements to integral pattern matching. Together they reduce instruction counts for `unicode_normalization-check-clean` by about 16%.

r? @Mark-Simulacrum

4 years agoAuto merge of #65043 - Aaron1011:fix/reexport-determinism, r=petrochenkov
bors [Sun, 6 Oct 2019 08:40:43 +0000 (08:40 +0000)]
Auto merge of #65043 - Aaron1011:fix/reexport-determinism, r=petrochenkov

Make re-export collection deterministic

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

Previously, we were using an `FxHashMap` to collect module re-exports.
However, re-exports end up getting serialized into crate metadata, which
means that metadata generation was non-deterministic. This resulted in
spurious error messages changes (e.g. PR #64906) due to pretty-printing
implicitly depending on the order of re-exports when computing the
proper path to show to the user.

See #65042 for a long-term strategy to detect this kind of issue

4 years agoAuto merge of #65152 - tmandry:rollup-btn4a01, r=tmandry
bors [Sun, 6 Oct 2019 04:59:16 +0000 (04:59 +0000)]
Auto merge of #65152 - tmandry:rollup-btn4a01, r=tmandry

Rollup of 18 pull requests

This contains changes from all the successful runs that bors marked as timed out, plus a revert of #63649 which appears to be the immediate cause of the timeouts.

Successful merges:

 - #64708 (Stabilize `Option::as_deref` and `Option::as_deref_mut`)
 - #64728 (Stabilize UdpSocket::peer_addr)
 - #64765 (std: Reduce checks for `feature = "backtrace"`)
 - #64909 (When encountering chained operators use heuristics to recover from bad turbofish)
 - #65011 (Do not ICE when dereferencing non-Copy raw pointer)
 - #65064 (permit asyncawait-ondeck to be added by anyone)
 - #65066 ([const-prop] Fix ICE when trying to eval polymorphic promoted MIR)
 - #65100 (Replace GeneratorSubsts with SubstsRef)
 - #65105 (Split out some passes from librustc)
 - #65106 (Allow unused attributes to avoid incremental bug)
 - #65113 (Fix lonely backtick)
 - #65116 (Remove unneeded visit_statement definition)
 - #65118 (Update the documented default of -Z mutable-noalias)
 - #65123 (Account for macro invocation in `let mut $pat` diagnostic.)
 - #65124 (Replace some instances of `as *[const | mut] _` with `.cast()`)
 - #65126 (Fix typo on `now()` comments)
 - #65130 (lint: extern non-exhaustive types are improper)
 - #65151 (Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend")

Failed merges:

r? @ghost

4 years agoRollup merge of #65151 - tmandry:revert-emscripten-upgrade, r=tmandry
Tyler Mandry [Sun, 6 Oct 2019 04:55:13 +0000 (21:55 -0700)]
Rollup merge of #65151 - tmandry:revert-emscripten-upgrade, r=tmandry

Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend"

This change caused the runtime of the linux-asmjs builder to nearly double from 2+ hours to about 4 hours, which happens to be the bors timeout. (It made it in barely under 4 hours when it was merged.) This is causing timeouts on all new changes.

This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing
changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.

4 years agoRollup merge of #65130 - davidtwco:rfc-2008-improper-ctypes, r=petrochenkov
Tyler Mandry [Sun, 6 Oct 2019 04:55:11 +0000 (21:55 -0700)]
Rollup merge of #65130 - davidtwco:rfc-2008-improper-ctypes, r=petrochenkov

lint: extern non-exhaustive types are improper

This PR makes the `improper_ctype` lint trigger for non-exhaustive types when those types aren't defined in the current crate, as per [this comment](https://github.com/rust-lang/rust/issues/44109#issuecomment-537583344).

cc @Centril

4 years agoRollup merge of #65126 - BO41:time_typo, r=kennytm
Tyler Mandry [Sun, 6 Oct 2019 04:55:10 +0000 (21:55 -0700)]
Rollup merge of #65126 - BO41:time_typo, r=kennytm

Fix typo on `now()` comments

Fix typo, update words, and remove some redundant word.
Also rustfmt on the rest of the file (hope this is okay :)

revival of #61433

r? @kennytm

4 years agoRollup merge of #65124 - memoryruins:castaway, r=petrochenkov
Tyler Mandry [Sun, 6 Oct 2019 04:55:08 +0000 (21:55 -0700)]
Rollup merge of #65124 - memoryruins:castaway, r=petrochenkov

Replace some instances of `as *[const | mut] _` with `.cast()`

While in `codegen_llvm`, noticed some places for the recent `pointer::cast` method.

4 years agoRollup merge of #65123 - Centril:mac-invoc-in-mut-pat, r=estebank
Tyler Mandry [Sun, 6 Oct 2019 04:55:07 +0000 (21:55 -0700)]
Rollup merge of #65123 - Centril:mac-invoc-in-mut-pat, r=estebank

Account for macro invocation in `let mut $pat` diagnostic.

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

r? @estebank

4 years agoRollup merge of #65118 - cuviper:Zmutable-noalias-default, r=rkruppe
Tyler Mandry [Sun, 6 Oct 2019 04:55:06 +0000 (21:55 -0700)]
Rollup merge of #65118 - cuviper:Zmutable-noalias-default, r=rkruppe

Update the documented default of -Z mutable-noalias

It has been fully disabled by default since #54639.

4 years agoRollup merge of #65116 - spastorino:remove-unneeded-fn, r=oli-obk
Tyler Mandry [Sun, 6 Oct 2019 04:55:04 +0000 (21:55 -0700)]
Rollup merge of #65116 - spastorino:remove-unneeded-fn, r=oli-obk

Remove unneeded visit_statement definition

r? @oli-obk

4 years agoRollup merge of #65113 - Qwaz:master, r=jonas-schievink
Tyler Mandry [Sun, 6 Oct 2019 04:55:03 +0000 (21:55 -0700)]
Rollup merge of #65113 - Qwaz:master, r=jonas-schievink

Fix lonely backtick

That backtick won't be sad anymore

4 years agoRollup merge of #65106 - Mark-Simulacrum:unused-attr-allow, r=Centril
Tyler Mandry [Sun, 6 Oct 2019 04:55:01 +0000 (21:55 -0700)]
Rollup merge of #65106 - Mark-Simulacrum:unused-attr-allow, r=Centril

Allow unused attributes to avoid incremental bug

cc #65023

This isn't labeled as fixing that issue because it's not really a fix, just a patch.

4 years agoRollup merge of #65105 - Mark-Simulacrum:split-librustc, r=nikomatsakis
Tyler Mandry [Sun, 6 Oct 2019 04:55:00 +0000 (21:55 -0700)]
Rollup merge of #65105 - Mark-Simulacrum:split-librustc, r=nikomatsakis

Split out some passes from librustc

This is just moving them out to librustc_passes -- I've not measured compile time or run time. I don't expect any significant impact, but this seems prudent regardless.

4 years agoRollup merge of #65100 - csmoe:generator, r=nikomatsakis
Tyler Mandry [Sun, 6 Oct 2019 04:54:59 +0000 (21:54 -0700)]
Rollup merge of #65100 - csmoe:generator, r=nikomatsakis

Replace GeneratorSubsts with SubstsRef

Closes #42340
r? @nikomatsakis

4 years agoRollup merge of #65066 - wesleywiser:fix_const_prop_ice_on_polymorphic_promoted_mir...
Tyler Mandry [Sun, 6 Oct 2019 04:54:57 +0000 (21:54 -0700)]
Rollup merge of #65066 - wesleywiser:fix_const_prop_ice_on_polymorphic_promoted_mir, r=oli-obk

[const-prop] Fix ICE when trying to eval polymorphic promoted MIR

Fixes #64908

r? @oli-obk
cc @nikomatsakis @pnkfelix

4 years agoRollup merge of #65064 - rust-lang:permit-asyncawait-ondeck-by-anyone, r=nikomatsakis
Tyler Mandry [Sun, 6 Oct 2019 04:54:56 +0000 (21:54 -0700)]
Rollup merge of #65064 - rust-lang:permit-asyncawait-ondeck-by-anyone, r=nikomatsakis

permit asyncawait-ondeck to be added by anyone

Still debating if this is the right approach

but r? @pietroalbini to check the format

4 years agoRollup merge of #65011 - estebank:ice-o-matic, r=zackmdavis
Tyler Mandry [Sun, 6 Oct 2019 04:54:54 +0000 (21:54 -0700)]
Rollup merge of #65011 - estebank:ice-o-matic, r=zackmdavis

Do not ICE when dereferencing non-Copy raw pointer

CC #52262. Confirmed to remove the unnecessary ICE, but without a repro case.

4 years agoRollup merge of #64909 - estebank:turbofish-reloaded, r=Centril
Tyler Mandry [Sun, 6 Oct 2019 04:54:52 +0000 (21:54 -0700)]
Rollup merge of #64909 - estebank:turbofish-reloaded, r=Centril

When encountering chained operators use heuristics to recover from bad turbofish

4 years agoRollup merge of #64765 - alexcrichton:less-check-backtrace, r=sfackler
Tyler Mandry [Sun, 6 Oct 2019 04:54:51 +0000 (21:54 -0700)]
Rollup merge of #64765 - alexcrichton:less-check-backtrace, r=sfackler

std: Reduce checks for `feature = "backtrace"`

This is a stylistic change to libstd to reduce the number of checks of
`feature = "backtrace"` now that we unconditionally depend on the
`backtrace` crate and rely on it having an empty implementation.
otherwise.

4 years agoRollup merge of #64728 - messense:udp-peer-addr, r=dtolnay
Tyler Mandry [Sun, 6 Oct 2019 04:54:49 +0000 (21:54 -0700)]
Rollup merge of #64728 - messense:udp-peer-addr, r=dtolnay

Stabilize UdpSocket::peer_addr

Fixes #59127

4 years agoRollup merge of #64708 - SimonSapin:option-deref, r=Centril
Tyler Mandry [Sun, 6 Oct 2019 04:54:47 +0000 (21:54 -0700)]
Rollup merge of #64708 - SimonSapin:option-deref, r=Centril

Stabilize `Option::as_deref` and `Option::as_deref_mut`

The tracking issue https://github.com/rust-lang/rust/issues/50264 still has unresolved question for the corresponding `Result` methods.

4 years agoRevert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, r=alexcrichton"
Tyler Mandry [Sun, 6 Oct 2019 04:38:45 +0000 (21:38 -0700)]
Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, r=alexcrichton"

This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing
changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.

4 years agoRemove `for_each_child_stable`
Aaron Hill [Sat, 5 Oct 2019 20:02:34 +0000 (16:02 -0400)]
Remove `for_each_child_stable`

Now that `Resolutions` has a deterministic iteration order, it's no
longer necessary to sort its entries before iterating over them

4 years agoMake re-export collection deterministic
Aaron Hill [Thu, 3 Oct 2019 04:31:21 +0000 (00:31 -0400)]
Make re-export collection deterministic

Previously, we were using an `FxHashMap` to collect module re-exports.
However, re-exports end up getting serialized into crate metadata, which
means that metadata generation was non-deterministic. This resulted in
spurious error messages changes (e.g. PR #64906) due to pretty-printing
implicitly depending on the order of re-exports when computing the
proper path to show to the user.

See #65042 for a long-term strategy to detect this kind of issue

4 years agoRename the test
Jonas Schievink [Wed, 18 Sep 2019 23:04:23 +0000 (01:04 +0200)]
Rename the test

4 years agoExtend test and fix nits
Jonas Schievink [Wed, 18 Sep 2019 22:54:47 +0000 (00:54 +0200)]
Extend test and fix nits

4 years agoPacify tidy
Jonas Schievink [Wed, 18 Sep 2019 22:42:50 +0000 (00:42 +0200)]
Pacify tidy

4 years agoTest that we get the proper errors
Jonas Schievink [Wed, 18 Sep 2019 22:37:28 +0000 (00:37 +0200)]
Test that we get the proper errors

4 years agoFix the bootstrap
Jonas Schievink [Wed, 18 Sep 2019 22:14:02 +0000 (00:14 +0200)]
Fix the bootstrap

4 years agoHide the `Iterator` specialization behind a trait
Jonas Schievink [Wed, 18 Sep 2019 21:41:57 +0000 (23:41 +0200)]
Hide the `Iterator` specialization behind a trait

4 years agoAdd comment to `Type` and `OpaqueTy` match
Jonas Schievink [Wed, 18 Sep 2019 21:00:59 +0000 (23:00 +0200)]
Add comment to `Type` and `OpaqueTy` match

4 years agoDeny specializing items not in the parent impl
Jonas Schievink [Tue, 17 Sep 2019 22:09:19 +0000 (00:09 +0200)]
Deny specializing items not in the parent impl

4 years agolint: extern non-exhaustive types are improper
David Wood [Sat, 5 Oct 2019 13:06:51 +0000 (14:06 +0100)]
lint: extern non-exhaustive types are improper

This commit makes the `improper_ctype` lint trigger for non-exhaustive
types when those types aren't defined in the current crate.

Signed-off-by: David Wood <david@davidtw.co>
4 years agoFix typo on `now()` comments
BO41 [Sat, 5 Oct 2019 10:23:10 +0000 (12:23 +0200)]
Fix typo on `now()` comments

4 years agoReplaces some instances of `as *[const | mut] _` with `.cast()`
memoryruins [Sat, 5 Oct 2019 07:48:14 +0000 (03:48 -0400)]
Replaces some instances of `as *[const | mut] _` with `.cast()`

4 years agoAccount for macro invocation in `let mut $pat` diagnostic.
Mazdak Farrokhzad [Sat, 5 Oct 2019 02:34:26 +0000 (04:34 +0200)]
Account for macro invocation in `let mut $pat` diagnostic.

4 years agoUpdate the documented default of -Z mutable-noalias
Josh Stone [Fri, 4 Oct 2019 23:53:18 +0000 (16:53 -0700)]
Update the documented default of -Z mutable-noalias

It has been fully disabled by default since #54639.

4 years agoRemove unneeded visit_statement definition
Santiago Pastorino [Fri, 4 Oct 2019 21:10:19 +0000 (18:10 -0300)]
Remove unneeded visit_statement definition

visit_statement default definition does just this, there's no need to
redefine it.

4 years agoAuto merge of #63649 - tlively:emscripten-upstream-upgrade, r=alexcrichton
bors [Fri, 4 Oct 2019 20:33:02 +0000 (20:33 +0000)]
Auto merge of #63649 - tlively:emscripten-upstream-upgrade, r=alexcrichton

Upgrade Emscripten targets to use upstream LLVM backend

 - Refactors the Emscripten target spec to share code with other wasm
   targets.
 - Replaces the incorrect wasm32 C call ABI with the old asmjs
   version, which is correct for both wasm32 and JS.
 - Updates the varargs ABI used by Emscripten and deletes the old one.
 - Removes the obsolete wasm32-experimental-emscripten target.
 - Temporarily makes Emscripten targets use panic=abort by default
   because supporting unwinding will require an LLVM patch.

4 years agoFix lonely backtick
Yechan Bae [Fri, 4 Oct 2019 20:31:38 +0000 (16:31 -0400)]
Fix lonely backtick

4 years agoAdd ignore-asmjs to new test
Thomas Lively [Fri, 4 Oct 2019 16:37:50 +0000 (09:37 -0700)]
Add ignore-asmjs to new test

4 years agoAllow unused attributes to avoid incremental bug
Mark Rousskov [Fri, 4 Oct 2019 14:43:15 +0000 (10:43 -0400)]
Allow unused attributes to avoid incremental bug

4 years agomiddle::intrinsicck -> rustc_passes
Mark Rousskov [Fri, 4 Oct 2019 14:46:57 +0000 (10:46 -0400)]
middle::intrinsicck -> rustc_passes

4 years agomiddle::entry -> rustc_passes
Mark Rousskov [Fri, 4 Oct 2019 14:37:40 +0000 (10:37 -0400)]
middle::entry -> rustc_passes

4 years agomiddle::dead -> rustc_passes
Mark Rousskov [Fri, 4 Oct 2019 14:33:11 +0000 (10:33 -0400)]
middle::dead -> rustc_passes

4 years agomove middle::liveness to rustc_passes
Mark Rousskov [Fri, 4 Oct 2019 14:31:28 +0000 (10:31 -0400)]
move middle::liveness to rustc_passes

4 years ago[const-prop] Fix ICE when trying to eval polymorphic promoted MIR
Wesley Wiser [Thu, 3 Oct 2019 17:43:07 +0000 (13:43 -0400)]
[const-prop] Fix ICE when trying to eval polymorphic promoted MIR

4 years agoclean up GeneratorSubsts
csmoe [Thu, 3 Oct 2019 13:51:30 +0000 (21:51 +0800)]
clean up GeneratorSubsts

4 years agoremove GeneratorSubsts visitors
csmoe [Thu, 3 Oct 2019 13:30:26 +0000 (21:30 +0800)]
remove GeneratorSubsts visitors

4 years agoreplace GeneratorSubsts inside related types
csmoe [Thu, 3 Oct 2019 13:28:04 +0000 (21:28 +0800)]
replace GeneratorSubsts inside related types

4 years agogenerate GeneratorSubsts from SubstsRef
csmoe [Thu, 3 Oct 2019 13:21:28 +0000 (21:21 +0800)]
generate GeneratorSubsts from SubstsRef

4 years agoreplace GeneratorSubsts with SubstsRef
csmoe [Thu, 3 Oct 2019 13:02:06 +0000 (21:02 +0800)]
replace GeneratorSubsts with SubstsRef

4 years agoAuto merge of #64994 - GuillaumeGomez:fix-rustdoc-display-js-disabled, r=Mark-Simulacrum
bors [Fri, 4 Oct 2019 12:17:13 +0000 (12:17 +0000)]
Auto merge of #64994 - GuillaumeGomez:fix-rustdoc-display-js-disabled, r=Mark-Simulacrum

Fix rustdoc display with js disabled

Fixes #64988.

Currently, all sections are collapsed when the page is loading, and then is displayed once done. However, if js is disabled, they never get expanded. Therefore, they need to be shown by default.

r? @Mark-Simulacrum

4 years agoAdd C ABI for wasm-bindgen compat
Thomas Lively [Thu, 3 Oct 2019 22:00:03 +0000 (15:00 -0700)]
Add C ABI for wasm-bindgen compat

4 years agoRemove asmjs and wasm32 from PR CI
Thomas Lively [Wed, 2 Oct 2019 22:20:19 +0000 (15:20 -0700)]
Remove asmjs and wasm32 from PR CI

4 years agoRevert "Temporarily enable wasm32 CI"
Thomas Lively [Wed, 2 Oct 2019 22:19:31 +0000 (15:19 -0700)]
Revert "Temporarily enable wasm32 CI"

4 years agoTemporarily enable wasm32 CI
Thomas Lively [Wed, 2 Oct 2019 18:12:20 +0000 (11:12 -0700)]
Temporarily enable wasm32 CI

4 years agoFix ABI, run and fix more tests, re-enable CI for PRs
Thomas Lively [Wed, 2 Oct 2019 18:02:25 +0000 (11:02 -0700)]
Fix ABI, run and fix more tests, re-enable CI for PRs

4 years agoUpgrade Emscripten targets to use upstream LLVM backend
Thomas Lively [Sat, 17 Aug 2019 05:08:01 +0000 (22:08 -0700)]
Upgrade Emscripten targets to use upstream LLVM backend

 - Refactors the Emscripten target spec to share code with other wasm
   targets.
 - Replaces the incorrect wasm32 C call ABI with the old asmjs
   version, which is correct for both wasm32 and JS.
 - Updates the varargs ABI used by Emscripten and deletes the old one.
 - Removes the obsolete wasm32-experimental-emscripten target.
 - Temporarily makes Emscripten targets use panic=abort by default
   because supporting unwinding will require an LLVM patch.

4 years agoAuto merge of #65087 - Centril:rollup-skxq0zr, r=Centril
bors [Fri, 4 Oct 2019 07:27:59 +0000 (07:27 +0000)]
Auto merge of #65087 - Centril:rollup-skxq0zr, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #64749 (Fix most remaining Polonius test differences)
 - #64817 (Replace ClosureSubsts with SubstsRef)
 - #64874 (Simplify ExprUseVisitor)
 - #65026 (metadata: Some crate loading cleanup)
 - #65073 (Remove `borrowck_graphviz_postflow` from test)

Failed merges:

r? @ghost

4 years agoReplace `flat_map()` with `filter_map()` in `is_useful_specialized()`.
Nicholas Nethercote [Fri, 4 Oct 2019 06:22:13 +0000 (16:22 +1000)]
Replace `flat_map()` with `filter_map()` in `is_useful_specialized()`.

`filter_map()` is less general, but more efficient, and has the same
effect in this case.

This commit reduces the instruction count for
`unicode_normalization-check-clean` by about 2%.

4 years agoIntroduce a special case in `IntRange::from_const`.
Nicholas Nethercote [Fri, 4 Oct 2019 04:29:20 +0000 (14:29 +1000)]
Introduce a special case in `IntRange::from_const`.

The `if let Some(val) = value.try_eval_bits(...)` branch in `from_const()` is
very hot for the `unicode_normalization` benchmark.

This commit introduces a special-case alternative for scalars that avoids
`try_eval_bits()` and all the functions it calls (`Const::eval()`,
`ConstValue::try_to_bits()`, `ConstValue::try_to_scalar()`, and
`Scalar::to_bits()`), instead extracting the result immediately.

The type and value checking done by `Scalar::to_bits()` is replicated by moving
it into a new function `Scalar::check_raw()` and using that new function in the
special case.

PR #64673 introduced some special-case handling of scalar types in
`Const::try_eval_bits()`. This handling is now moved out of that function into
the new `IntRange::integral_size_and_signed_bias` function.

This commit reduces the instruction count for
`unicode_normalization-check-clean` by about 10%.

4 years agoRearrange `IntRange::from_{ctor,pat}()`.
Nicholas Nethercote [Fri, 4 Oct 2019 03:16:37 +0000 (13:16 +1000)]
Rearrange `IntRange::from_{ctor,pat}()`.

This commit moves a lot of code around but doesn't change functionality
at all. The main goal was for `from_pat()` to no longer call
`from_ctor()`.

The increase in inlining resulted in less function call overhead, for a
3% instruction count win on `unicode_normalization-check-clean`.

4 years agoInline and remove `constructor_intersects_pattern()`.
Nicholas Nethercote [Fri, 4 Oct 2019 01:04:14 +0000 (11:04 +1000)]
Inline and remove `constructor_intersects_pattern()`.

This is a 2% instruction count win on `unicode_normalization-check-clean`.

4 years agoCombine two `match` arms in `specialize()`.
Nicholas Nethercote [Fri, 4 Oct 2019 01:02:04 +0000 (11:02 +1000)]
Combine two `match` arms in `specialize()`.

This reduces the number of call sites for
`constructor_intersects_pattern()` from two to one, which the next
commit will take advantage of.

4 years agoRollup merge of #65073 - ecstatic-morse:issue-65071, r=petrochenkov
Mazdak Farrokhzad [Fri, 4 Oct 2019 05:24:39 +0000 (07:24 +0200)]
Rollup merge of #65073 - ecstatic-morse:issue-65071, r=petrochenkov

Remove `borrowck_graphviz_postflow` from test

Resolves #65071.

r? @petrochenkov

4 years agoRollup merge of #65026 - petrochenkov:ice1, r=eddyb
Mazdak Farrokhzad [Fri, 4 Oct 2019 05:24:37 +0000 (07:24 +0200)]
Rollup merge of #65026 - petrochenkov:ice1, r=eddyb

metadata: Some crate loading cleanup

So, my goal was to fix caching of loaded crates which is broken and causes ICEs like #56935 or #64450.
While investigating I found that the code is pretty messy and likes to confuse various things that look similar but are actually different.
This PR does some initial cleanup in that area, I hope to get to the caching itself a bit later.

4 years agoRollup merge of #64874 - matthewjasper:simplify-euv, r=eddyb
Mazdak Farrokhzad [Fri, 4 Oct 2019 05:24:36 +0000 (07:24 +0200)]
Rollup merge of #64874 - matthewjasper:simplify-euv, r=eddyb

Simplify ExprUseVisitor

* Remove HIR const qualification
* Remove parts of ExprUseVisitor that aren't being used

r? @eddyb

4 years agoRollup merge of #64817 - csmoe:closure, r=nikomatsakis
Mazdak Farrokhzad [Fri, 4 Oct 2019 05:24:34 +0000 (07:24 +0200)]
Rollup merge of #64817 - csmoe:closure, r=nikomatsakis

Replace ClosureSubsts with SubstsRef

Addresses https://github.com/rust-lang/rust/issues/42340 part 3
https://github.com/rust-lang/rust/pull/59312 might benefit from this clean up.
r? @nikomatsakis

4 years agoRollup merge of #64749 - matthewjasper:liveness-opt, r=nikomatsakis
Mazdak Farrokhzad [Fri, 4 Oct 2019 05:24:33 +0000 (07:24 +0200)]
Rollup merge of #64749 - matthewjasper:liveness-opt, r=nikomatsakis

Fix most remaining Polonius test differences

This fixes most of the Polonius test differences and also avoids overflow in issue-38591.rs.

r? @nikomatsakis

4 years agoreview comments
Esteban Küber [Fri, 4 Oct 2019 02:32:56 +0000 (19:32 -0700)]
review comments

4 years agoAuto merge of #65076 - tmandry:rollup-ka7nzb6, r=tmandry
bors [Thu, 3 Oct 2019 23:29:48 +0000 (23:29 +0000)]
Auto merge of #65076 - tmandry:rollup-ka7nzb6, r=tmandry

Rollup of 11 pull requests

Successful merges:

 - #61879 (Stabilize todo macro)
 - #64675 (Deprecate `#![plugin]` & `#[plugin_registrar]`)
 - #64690 (proc_macro API: Expose `macro_rules` hygiene)
 - #64706 (add regression test for #60218)
 - #64741 (Prevent rustdoc feature doctests)
 - #64842 (Disallow Self in type param defaults of ADTs)
 - #65004 (Replace mentions of IRC with Discord)
 - #65018 (Set RUST_BACKTRACE=0 in tests that include a backtrace in stderr)
 - #65055 (Add long error explanation for E0556)
 - #65056 (Make visit projection iterative)
 - #65057 (typo: fix typo in E0392)

Failed merges:

r? @ghost

4 years agoRollup merge of #65057 - mathstuf:fix-warning-typo, r=Centril
Tyler Mandry [Thu, 3 Oct 2019 23:25:51 +0000 (16:25 -0700)]
Rollup merge of #65057 - mathstuf:fix-warning-typo, r=Centril

typo: fix typo in E0392

See #64931.

---
Cc: @Centril @estebank
4 years agoRollup merge of #65056 - spastorino:place-mut-visitor-adjusts, r=oli-obk
Tyler Mandry [Thu, 3 Oct 2019 23:25:49 +0000 (16:25 -0700)]
Rollup merge of #65056 - spastorino:place-mut-visitor-adjusts, r=oli-obk

Make visit projection iterative

r? @oli-obk

/cc @nikomatsakis

4 years agoRollup merge of #65055 - GuillaumeGomez:long-err-explanation-E0556, r=petrochenkov
Tyler Mandry [Thu, 3 Oct 2019 23:25:47 +0000 (16:25 -0700)]
Rollup merge of #65055 - GuillaumeGomez:long-err-explanation-E0556, r=petrochenkov

Add long error explanation for E0556

Part of #61137

4 years agoRollup merge of #65018 - Aaron1011:fix/backtrace-stderr, r=nikomatsakis
Tyler Mandry [Thu, 3 Oct 2019 23:25:46 +0000 (16:25 -0700)]
Rollup merge of #65018 - Aaron1011:fix/backtrace-stderr, r=nikomatsakis

Set RUST_BACKTRACE=0 in tests that include a backtrace in stderr

This removes the implicit dependency on the environment variables set
when running `./x.py test`

4 years agoRollup merge of #65004 - BO41:mentions, r=alexcrichton
Tyler Mandry [Thu, 3 Oct 2019 23:25:44 +0000 (16:25 -0700)]
Rollup merge of #65004 - BO41:mentions, r=alexcrichton

Replace mentions of IRC with Discord

Revival of #61531

closes #61524

what was the outcome of this? https://github.com/rust-lang/rust/pull/61531#issuecomment-500452638

should this be changed in this PR as well? https://github.com/rust-lang/rust/pull/61531#issuecomment-501473787

4 years agoRollup merge of #64842 - pnkfelix:fix-issue-61631-self-in-type-param-default, r=alexreg
Tyler Mandry [Thu, 3 Oct 2019 23:25:43 +0000 (16:25 -0700)]
Rollup merge of #64842 - pnkfelix:fix-issue-61631-self-in-type-param-default, r=alexreg

Disallow Self in type param defaults of ADTs

Fix #61631

(also includes a drive-by fix to a typo in some related diagnostic output.)

4 years agoRollup merge of #64741 - GuillaumeGomez:prevent-rustdoc-feature-doctests, r=QuietMisd...
Tyler Mandry [Thu, 3 Oct 2019 23:25:41 +0000 (16:25 -0700)]
Rollup merge of #64741 - GuillaumeGomez:prevent-rustdoc-feature-doctests, r=QuietMisdreavus

Prevent rustdoc feature doctests

Part of https://github.com/rust-lang/rust/pull/61351

cc @ollie27

4 years agoRollup merge of #64706 - nikomatsakis:issue-60218-test-case, r=centril
Tyler Mandry [Thu, 3 Oct 2019 23:25:40 +0000 (16:25 -0700)]
Rollup merge of #64706 - nikomatsakis:issue-60218-test-case, r=centril

add regression test for #60218

Fixes #60218

4 years agoRollup merge of #64690 - petrochenkov:mixed, r=dtolnay
Tyler Mandry [Thu, 3 Oct 2019 23:25:39 +0000 (16:25 -0700)]
Rollup merge of #64690 - petrochenkov:mixed, r=dtolnay

proc_macro API: Expose `macro_rules` hygiene

Proc macros do not have direct access to our oldest and most stable hygiene kind - `macro_rules` hygiene.

To emulate it macro authors have to go through two steps - first generate a temporary `macro_rules` item (using a derive, at least until https://github.com/rust-lang/rust/pull/64035 is merged), then generate a macro call to that item. Popular crates like [proc_macro_hack](https://crates.io/crates/proc-macro-hack) use this trick to generate hygienic identifiers from proc macros.

I'd say that these workarounds with nested macro definitions have more chances to hit some corner cases in our hygiene system, in which we don't have full confidence.
So, let's provide a direct access to `macro_rules` hygiene instead.

This PR does that by adding a new method `Span::mixed_site` (bikeshedding is welcome) in addition to existing `Span::call_site` (stable) and `Span::def_site` (unstable).
Identifiers with this span resolve at def-site in for local variables, labels and `$crate`, and resolve at call-site for everything else, i.e. exactly like identifiers produced by `macro_rules`.

This API addition opens the way to stabilizing proc macros in expression positions (https://github.com/rust-lang/rust/issues/54727), for which use of call-site hygiene or workarounds with temporary items would be quite unfortunate.
(`macro_rules` expanded in expression position, on the other hand, are stable since 1.0 and widely used.)

r? @dtolnay @alexcrichton

4 years agoRollup merge of #64675 - Centril:deprecate-plugin, r=oli-obk
Tyler Mandry [Thu, 3 Oct 2019 23:25:37 +0000 (16:25 -0700)]
Rollup merge of #64675 - Centril:deprecate-plugin, r=oli-obk

Deprecate `#![plugin]` & `#[plugin_registrar]`

This PR deprecates `#![plugin]` and `#[plugin_registrar]`.

~A removal deadline is set: 1.44.0. This will be in 9 months from now and should give everyone who is still relying on the feature ample time to rid themselves of this dependency.~

cc https://github.com/rust-lang/rust/issues/29597

r? @Mark-Simulacrum

4 years agoRollup merge of #61879 - stjepang:stabilize-todo, r=withoutboats
Tyler Mandry [Thu, 3 Oct 2019 23:25:35 +0000 (16:25 -0700)]
Rollup merge of #61879 - stjepang:stabilize-todo, r=withoutboats

Stabilize todo macro

The `todo!` macro is just another name for `unimplemented!`.

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

This PR needs a FCP to merge.

r? @withoutboats

4 years agoBless test
Dylan MacKenzie [Thu, 3 Oct 2019 22:51:11 +0000 (15:51 -0700)]
Bless test

4 years agometadata: Remove unused `Option` from `fn dlsym_proc_macros`
Vadim Petrochenkov [Wed, 2 Oct 2019 19:31:11 +0000 (22:31 +0300)]
metadata: Remove unused `Option` from `fn dlsym_proc_macros`

4 years agometadata: Remove `CrateMetadata::name`
Vadim Petrochenkov [Wed, 2 Oct 2019 00:15:38 +0000 (03:15 +0300)]
metadata: Remove `CrateMetadata::name`

It duplicates `CrateRoot::name`

4 years agometadata: Remove `CrateMetadata::host_lib`
Vadim Petrochenkov [Tue, 1 Oct 2019 23:47:36 +0000 (02:47 +0300)]
metadata: Remove `CrateMetadata::host_lib`

It was only used for retreiving edition, which was a bug.
In case of dual proc macros the edition should be taken from the target crate version, like any other metadata.

4 years agometadata: Simplify interface of `resolve_crate`
Vadim Petrochenkov [Sun, 29 Sep 2019 18:14:29 +0000 (21:14 +0300)]
metadata: Simplify interface of `resolve_crate`

4 years agometadata: Remove `locator::Context::ident`
Vadim Petrochenkov [Sun, 29 Sep 2019 17:16:23 +0000 (20:16 +0300)]
metadata: Remove `locator::Context::ident`

It's a crate name after renaming, so it's entirely irrelevant to crate loading

4 years agometadata: Do not pass crate name after renaming to `register_crate`
Vadim Petrochenkov [Sun, 29 Sep 2019 16:34:51 +0000 (19:34 +0300)]
metadata: Do not pass crate name after renaming to `register_crate`

It's entirely irrelevant to crate loading

4 years agometadata: Remove `CrateMetadata::imported_name`
Vadim Petrochenkov [Sun, 29 Sep 2019 15:51:09 +0000 (18:51 +0300)]
metadata: Remove `CrateMetadata::imported_name`

It's entirely irrelevant to crate loading

4 years agoRemove `borrowck_graphviz_postflow` from test
Dylan MacKenzie [Wed, 2 Oct 2019 22:35:59 +0000 (15:35 -0700)]
Remove `borrowck_graphviz_postflow` from test

4 years agoreview comments
Esteban Küber [Thu, 3 Oct 2019 20:22:18 +0000 (13:22 -0700)]
review comments

4 years agoreview comments
Esteban Küber [Tue, 1 Oct 2019 22:51:50 +0000 (15:51 -0700)]
review comments

4 years agoreview comments
Esteban Küber [Tue, 1 Oct 2019 18:24:05 +0000 (11:24 -0700)]
review comments

4 years agoProve bad turbofish parser recovery in test
Esteban Küber [Mon, 30 Sep 2019 20:22:58 +0000 (13:22 -0700)]
Prove bad turbofish parser recovery in test

4 years agoAccount for missing turbofish in paths too
Esteban Küber [Mon, 30 Sep 2019 19:36:44 +0000 (12:36 -0700)]
Account for missing turbofish in paths too

4 years agoreview comments
Esteban Küber [Mon, 30 Sep 2019 19:19:22 +0000 (12:19 -0700)]
review comments

4 years agoWhen encountering chained operators use heuristics to recover from bad turbofish
Esteban Küber [Mon, 30 Sep 2019 02:07:26 +0000 (19:07 -0700)]
When encountering chained operators use heuristics to recover from bad turbofish