Commit Graph

100391 Commits

Author SHA1 Message Date
Tatsuyuki Ishi
c97f5f0045 Remove dead module 2019-10-04 22:55:10 +09:00
csmoe
afc0bb9794 clean up GeneratorSubsts 2019-10-04 20:47:43 +08:00
csmoe
ef9fe10280 remove GeneratorSubsts visitors 2019-10-04 20:47:43 +08:00
csmoe
774ea808be replace GeneratorSubsts inside related types 2019-10-04 20:47:43 +08:00
csmoe
fa7a87be63 generate GeneratorSubsts from SubstsRef 2019-10-04 20:47:43 +08:00
csmoe
2d87bace96 replace GeneratorSubsts with SubstsRef 2019-10-04 20:47:43 +08:00
Mateusz Mikuła
d89608829c Upgrade librustc_macros dependencies 2019-10-04 14:43:23 +02:00
bors
2e7244807a 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
2019-10-04 12:17:13 +00:00
Thomas Lively
43c4b81be7 Add C ABI for wasm-bindgen compat 2019-10-04 00:47:21 -07:00
Thomas Lively
63955bbdf9 Remove asmjs and wasm32 from PR CI 2019-10-04 00:47:21 -07:00
Thomas Lively
b78cc69cc8 Revert "Temporarily enable wasm32 CI" 2019-10-04 00:47:21 -07:00
Thomas Lively
1b4d5ec0f7 Temporarily enable wasm32 CI 2019-10-04 00:47:21 -07:00
Thomas Lively
5b56c660c9 Fix ABI, run and fix more tests, re-enable CI for PRs 2019-10-04 00:47:21 -07:00
Thomas Lively
9a55103b98 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.
2019-10-04 00:47:21 -07:00
bors
9e35a2811d 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
2019-10-04 07:27:59 +00:00
Nicholas Nethercote
2a3a544741 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%.
2019-10-04 17:04:00 +10:00
Nicholas Nethercote
5515a97646 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%.
2019-10-04 17:03:41 +10:00
Nicholas Nethercote
a69e0e0ab4 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`.
2019-10-04 17:01:10 +10:00
Nicholas Nethercote
62ea39a1c9 Inline and remove constructor_intersects_pattern().
This is a 2% instruction count win on `unicode_normalization-check-clean`.
2019-10-04 17:00:19 +10:00
Nicholas Nethercote
9a1a3b9013 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.
2019-10-04 16:58:44 +10:00
Mazdak Farrokhzad
aacc89a1dd
Rollup merge of #65073 - ecstatic-morse:issue-65071, r=petrochenkov
Remove `borrowck_graphviz_postflow` from test

Resolves #65071.

r? @petrochenkov
2019-10-04 07:24:39 +02:00
Mazdak Farrokhzad
a16c637374
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.
2019-10-04 07:24:37 +02:00
Mazdak Farrokhzad
cb4145e759
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
2019-10-04 07:24:36 +02:00
Mazdak Farrokhzad
17e1f23209
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
2019-10-04 07:24:34 +02:00
Mazdak Farrokhzad
314fbf48cf
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
2019-10-04 07:24:33 +02:00
Esteban Küber
76456e7406 review comments 2019-10-03 19:32:56 -07:00
Mark Rousskov
e85089b63a Remove -Zprofile-queries 2019-10-03 21:34:27 -04:00
bors
31d75c4e9c 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
2019-10-03 23:29:48 +00:00
Tyler Mandry
cc5dcfaada
Rollup merge of #65057 - mathstuf:fix-warning-typo, r=Centril
typo: fix typo in E0392

See #64931.

---
Cc: @Centril @estebank
2019-10-03 16:25:51 -07:00
Tyler Mandry
4a25c3c1ec
Rollup merge of #65056 - spastorino:place-mut-visitor-adjusts, r=oli-obk
Make visit projection iterative

r? @oli-obk

/cc @nikomatsakis
2019-10-03 16:25:49 -07:00
Tyler Mandry
dd9ccb20fc
Rollup merge of #65055 - GuillaumeGomez:long-err-explanation-E0556, r=petrochenkov
Add long error explanation for E0556

Part of #61137
2019-10-03 16:25:47 -07:00
Tyler Mandry
211bc4a687
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`
2019-10-03 16:25:46 -07:00
Tyler Mandry
4886f35537
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
2019-10-03 16:25:44 -07:00
Tyler Mandry
27c90524a0
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.)
2019-10-03 16:25:43 -07:00
Tyler Mandry
69837b14d6
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
2019-10-03 16:25:41 -07:00
Tyler Mandry
c6999a5834
Rollup merge of #64706 - nikomatsakis:issue-60218-test-case, r=centril
add regression test for #60218

Fixes #60218
2019-10-03 16:25:40 -07:00
Tyler Mandry
2a9bd75994
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
2019-10-03 16:25:39 -07:00
Tyler Mandry
da0afc1638
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
2019-10-03 16:25:37 -07:00
Tyler Mandry
f7ee31e3d7
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
2019-10-03 16:25:35 -07:00
Dylan MacKenzie
1cda591314 Bless test 2019-10-03 15:51:11 -07:00
Vadim Petrochenkov
68aadcb2ae metadata: Remove unused Option from fn dlsym_proc_macros 2019-10-04 01:12:29 +03:00
Vadim Petrochenkov
0f96ba92b6 metadata: Remove CrateMetadata::name
It duplicates `CrateRoot::name`
2019-10-04 01:12:29 +03:00
Vadim Petrochenkov
f13adc5f9d 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.
2019-10-04 01:12:29 +03:00
Vadim Petrochenkov
92386a7ff3 metadata: Simplify interface of resolve_crate 2019-10-04 01:12:29 +03:00
Vadim Petrochenkov
33c9ada800 metadata: Remove locator::Context::ident
It's a crate name after renaming, so it's entirely irrelevant to crate loading
2019-10-04 01:12:29 +03:00
Vadim Petrochenkov
acd102aebf metadata: Do not pass crate name after renaming to register_crate
It's entirely irrelevant to crate loading
2019-10-04 01:12:28 +03:00
Vadim Petrochenkov
b507971119 metadata: Remove CrateMetadata::imported_name
It's entirely irrelevant to crate loading
2019-10-04 01:12:28 +03:00
Dylan MacKenzie
4d9b4b4769 Remove borrowck_graphviz_postflow from test 2019-10-03 14:24:52 -07:00
Esteban Küber
02f57f83a9 review comments 2019-10-03 13:22:18 -07:00
Esteban Küber
f1499a8646 review comments 2019-10-03 11:55:19 -07:00