Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 12 pull requests #66432

Closed
wants to merge 31 commits into from
Closed

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost

haraldh and others added 30 commits October 22, 2019 16:52
Rename
* Error::iter_chain() -> Error::chain()
* ErrorIter -> Chain

Removed
* Error::iter_sources()

according to
rust-lang#58520

Rationale:

   1. Such iterators are helpful. They should better be stabilized sooner
      than later.
   2. self should be included. It is easy to .skip(1) it.
      Not including self is harmful because it is harder to add self
      to the iterator than to remove it.
   3. The chosen name should be telling and reflect the fact that self is
      included. `.chain()` was chosen because the iterator iterates over
      the chain of errors that is somehow included in self.
   4. The resulting iterator is named `Chain` because the `error::Chain`
      is what we want to have.
For a single-threaded parallel compiler, this reduces instruction counts
across several benchmarks, by up to 2.8%.

The commit also adds documentation about `Sharded`'s use of `FxHasher`.
The `Context` argument is currently smuggled through TLS for
async-generated futures. The current infrastructure is closure-based,
and results in an extra 6 stack frames when .awaiting an async-generated
future!

```
  12: foo::async_b::{{closure}}
             at src/main.rs:10
  13: <std::future::GenFuture<T> as core::future::future::Future>::poll::{{closure}}
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:43
  14: std::future::set_task_context
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:79
  15: <std::future::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:43
  16: std::future::poll_with_tls_context::{{closure}}
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:121
  17: std::future::get_task_context
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:111
  18: std::future::poll_with_tls_context
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:121
  19: foo::async_a::{{closure}}
             at src/main.rs:6
```

While the long (medium?) term solution is to remove the use of TLS
entirely, we can improve things a bit in the meantime. In particular,
this commit does 2 things:

1. `get_task_context` has been inlined into `poll_with_tls_context`,
    removing 2 frames (16 and 17 above).
2. `set_task_context` now returns a guard type that resets the TLS
    rather than taking a closure, removing 2 frames (13 and 14 above).

We can also remove frame 18 by removing `poll_with_tls_context` in favor
of a `get_task_context` function which returns a guard, but that
requires adjusting the code generated for .await, so I've left that off
for now.
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
rename Error::iter_chain() and remove Error::iter_sources()

~~Rename~~
* ~~Error::iter_chain() -> Error::chained()~~
* ~~Error::iter_sources() -> Error::ancestors()~~
* ~~ErrorIter -> Chained and Ancestors~~

according to
rust-lang#58520 (comment)

Tracker:
rust-lang#58520

Edit:

Rename
* Error::iter_chain() -> Error::chained()
* ErrorIter -> Chain

So, it seems, that even Path::ancestors() includes itself. So, to avoid confusion and simplify it more, I reduced PR  rust-lang#65557 to only have `chained` and `Chain`.

Rationale:

   1. Such iterators are helpful. They should better be stabilized sooner than later.
   1. self should be included. It is easy to .skip(1) it.  Not including self is harmful because it is harder to add self to the iterator than to remove it.
   1. The chosen name should be telling and reflect the fact that self is included. `.chained()` was chosen in honor of error-chain and because the iterator iterates over the chain of errors that is somehow included in self.
   1. The resulting iterator is named `Chain` because the `error::Chain` is what we want to have.
…get_query, r=Zoxc

Avoid hashing the key twice in `get_query()`.

For a single-threaded parallel compiler, this reduces instruction counts
across several benchmarks, by up to 2.8%.

The commit also adds documentation about `Sharded`'s use of `FxHasher`.

r? @Zoxc
…miri, r=oli-obk

Remove cannot mutate statics in initializer of another static error

r? @oli-obk

This is just a refactoring. As the removed code itself said, it only a heuristic catching a few cases early instead of leaving it all to const eval. It's easy to work around the static check and then run into the miri-engine check.
Update mdbook.

This brings in some important updates to fix some rendering issues in the books. In particular fixing hidden lines in code blocks, and some escaping issues.  More details at https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md

This also requires updating mdbook-linkcheck.
Do not ICE on recovery from unmet associated type bound obligation

Fix rust-lang#66353.

r? @Centril
Fix ICE when trying to suggest `Type<>` instead of `Type()`

Fixes rust-lang#66286, but the output has no span:

```
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait

error: aborting due to previous error

For more information about this error, try `rustc --explain E0214`.
```
Do not ICE in `if` without `else` in `async fn`

Fix rust-lang#66387.
Remove some stack frames from `.async` calls

The `Context` argument is currently smuggled through TLS for
async-generated futures. The current infrastructure is closure-based,
and results in an extra 6 stack frames when .awaiting an async-generated
future!

```
  12: foo::async_b::{{closure}}
             at src/main.rs:10
  13: <std::future::GenFuture<T> as core::future::future::Future>::poll::{{closure}}
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:43
  14: std::future::set_task_context
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:79
  15: <std::future::GenFuture<T> as core::future::future::Future>::poll
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:43
  16: std::future::poll_with_tls_context::{{closure}}
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:121
  17: std::future::get_task_context
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:111
  18: std::future::poll_with_tls_context
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:121
  19: foo::async_a::{{closure}}
             at src/main.rs:6
```

While the long (medium?) term solution is to remove the use of TLS
entirely, we can improve things a bit in the meantime. In particular,
this commit does 2 things:

1. `get_task_context` has been inlined into `poll_with_tls_context`,
    removing 2 frames (16 and 17 above).
2. `set_task_context` now returns a guard type that resets the TLS
    rather than taking a closure, removing 2 frames (13 and 14 above).

We can also remove frame 18 by removing `poll_with_tls_context` in favor
of a `get_task_context` function which returns a guard, but that
requires adjusting the code generated for .await, so I've left that off
for now.
Add more tests for fixed ICEs

Closes rust-lang#36122 (fixed in 1.20.0)
Closes rust-lang#58094 (fixed in rust-lang#66054)
Also, fix mistaken test case, from rust-lang#30904 to rust-lang#30906 (cc @eddyb)

r? @Centril
miri: helper methods for max values of machine's usize/isize

We recently wanted this in Miri.

r? @oli-obk
…msg, r=estebank

Link to tracking issue in HIR const-check error code description

This is a follow up to rust-lang#66170 that addresses [this comment](rust-lang#66170 (comment)).

As an aside, the only other error code whose description uses the phrase "tracking issue" is `E0202`. We may want to come up with standards around this, especially since error codes are now centralized and easier to keep track of (thanks @GuillaumeGomez).

r? @estebank (since they +1'ed the comment)
Don't warn labels beginning with `_` on unused_labels lint

Fixes rust-lang#66382

r? @varkor
@JohnTitor
Copy link
Member Author

@bors r+ p=12 rollup=never

@bors
Copy link
Contributor

bors commented Nov 15, 2019

📌 Commit 9b8959c has been approved by JohnTitor

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 15, 2019
@JohnTitor JohnTitor added the rollup A PR which is a rollup label Nov 15, 2019
@bors
Copy link
Contributor

bors commented Nov 15, 2019

⌛ Testing commit 9b8959c with merge 98f0f0846cf4fef902fc5b34768a57d9273b8a8e...

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-nopt of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-15T07:57:59.6647018Z test [ui] ui/parser/issue-5544-a.rs ... ok
2019-11-15T07:57:59.6892347Z test [ui] ui/parser/issue-33418.rs ... ok
2019-11-15T07:57:59.7119121Z test [ui] ui/parser/issue-5544-b.rs ... ok
2019-11-15T07:57:59.7136146Z test [ui] ui/parser/issue-5806.rs ... ok
2019-11-15T07:57:59.7375841Z test [ui] ui/parser/issue-58094-missing-right-square-bracket.rs ... ok
2019-11-15T07:57:59.7791300Z test [ui] ui/parser/issue-59418.rs ... ok
2019-11-15T07:57:59.8160907Z test [ui] ui/parser/issue-62660.rs ... ok
2019-11-15T07:57:59.8327346Z test [ui] ui/parser/issue-62881.rs ... ok
2019-11-15T07:57:59.8558191Z test [ui] ui/parser/issue-62913.rs ... ok
---
2019-11-15T08:10:44.0046600Z test [ui (nll)] ui/parser/issue-41155.rs ... ok
2019-11-15T08:10:44.0536743Z test [ui (nll)] ui/parser/issue-5544-a.rs ... ok
2019-11-15T08:10:44.0537298Z test [ui (nll)] ui/parser/issue-5544-b.rs ... ok
2019-11-15T08:10:44.0794678Z test [ui (nll)] ui/parser/issue-5806.rs ... ok
2019-11-15T08:10:44.0795880Z test [ui (nll)] ui/parser/issue-58094-missing-right-square-bracket.rs ... ok
2019-11-15T08:10:44.1424030Z test [ui (nll)] ui/parser/issue-59418.rs ... ok
2019-11-15T08:10:44.1687599Z test [ui (nll)] ui/parser/issue-62660.rs ... ok
2019-11-15T08:10:44.1967063Z test [ui (nll)] ui/parser/issue-62881.rs ... ok
2019-11-15T08:10:44.2282825Z test [ui (nll)] ui/parser/issue-62913.rs ... ok
---
2019-11-15T08:14:55.2120588Z - error[E0308]: mismatched types
2019-11-15T08:14:55.2121175Z + error: higher-ranked subtype error
2019-11-15T08:14:55.2121757Z 2   --> $DIR/issue-30906.rs:15:5
2019-11-15T08:14:55.2122088Z 3    |
2019-11-15T08:14:55.2122353Z 4 LL |     test(Compose(f, |_| {}));
2019-11-15T08:14:55.2123434Z -    |     ^^^^ one type is more general than the other
2019-11-15T08:14:55.2123990Z -    |
2019-11-15T08:14:55.2123990Z -    |
2019-11-15T08:14:55.2124568Z -    = note: expected type `std::ops::FnOnce<(&'x str,)>`
2019-11-15T08:14:55.2125188Z -               found type `std::ops::FnOnce<(&str,)>`
2019-11-15T08:14:55.2125793Z 9 
2019-11-15T08:14:55.2126044Z 10 error: aborting due to previous error
2019-11-15T08:14:55.2126288Z 11 
2019-11-15T08:14:55.2126484Z 
2019-11-15T08:14:55.2126484Z 
2019-11-15T08:14:55.2127031Z - For more information about this error, try `rustc --explain E0308`.
2019-11-15T08:14:55.2127379Z 13 
2019-11-15T08:14:55.2127586Z 
2019-11-15T08:14:55.2127790Z 
2019-11-15T08:14:55.2128051Z The actual stderr differed from the expected stderr.
2019-11-15T08:14:55.2129108Z Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/unboxed-closures/issue-30906.nll/issue-30906.nll.stderr
2019-11-15T08:14:55.2129787Z To update references, rerun the tests and pass the `--bless` flag
2019-11-15T08:14:55.2130472Z To only update this specific test, also pass `--test-args unboxed-closures/issue-30906.rs`
2019-11-15T08:14:55.2131068Z error: 1 errors occurred comparing output.
2019-11-15T08:14:55.2131341Z status: exit code: 1
2019-11-15T08:14:55.2131341Z status: exit code: 1
2019-11-15T08:14:55.2132570Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/unboxed-closures/issue-30906.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/unboxed-closures/issue-30906.nll" "-Zborrowck=mir" "-Crpath" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/unboxed-closures/issue-30906.nll/auxiliary" "-A" "unused"
2019-11-15T08:14:55.2133672Z ------------------------------------------
2019-11-15T08:14:55.2133966Z 
2019-11-15T08:14:55.2134499Z ------------------------------------------
2019-11-15T08:14:55.2134841Z stderr:
2019-11-15T08:14:55.2134841Z stderr:
2019-11-15T08:14:55.2135326Z ------------------------------------------
2019-11-15T08:14:55.2136601Z error: higher-ranked subtype error
2019-11-15T08:14:55.2137311Z   --> /checkout/src/test/ui/unboxed-closures/issue-30906.rs:15:5
2019-11-15T08:14:55.2137581Z    |
2019-11-15T08:14:55.2137762Z LL |     test(Compose(f, |_| {})); //~ ERROR: mismatched types
2019-11-15T08:14:55.2138096Z 
2019-11-15T08:14:55.2138274Z error: aborting due to previous error
2019-11-15T08:14:55.2138415Z 
2019-11-15T08:14:55.2138543Z 
---
2019-11-15T08:14:55.2169557Z thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:537:22
2019-11-15T08:14:55.2170712Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-11-15T08:14:55.2198752Z 
2019-11-15T08:14:55.2198852Z 
2019-11-15T08:14:55.2201245Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "9.0.0-rust-1.41.0-dev\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always" "--compare-mode" "nll"
2019-11-15T08:14:55.2204080Z 
2019-11-15T08:14:55.2204123Z 
2019-11-15T08:14:55.2204271Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-11-15T08:14:55.2204359Z Build completed unsuccessfully in 1:44:24
2019-11-15T08:14:55.2204359Z Build completed unsuccessfully in 1:44:24
2019-11-15T08:14:55.2257838Z == clock drift check ==
2019-11-15T08:14:55.2271133Z   local time: Fri Nov 15 08:14:55 UTC 2019
2019-11-15T08:14:57.3026719Z   network time: == end clock drift check ==
2019-11-15T08:14:58.1162164Z 
2019-11-15T08:14:58.1298238Z ##[error]Bash exited with code '1'.
2019-11-15T08:14:58.1339511Z ##[section]Starting: Checkout
2019-11-15T08:14:58.1342061Z ==============================================================================
2019-11-15T08:14:58.1342157Z Task         : Get sources
2019-11-15T08:14:58.1342259Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Nov 15, 2019

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 15, 2019
@JohnTitor JohnTitor closed this Nov 15, 2019
@JohnTitor JohnTitor deleted the rollup-qqndbkq branch November 15, 2019 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.