Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
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

Add Wake trait for safe construction of Wakers. #68700

Open
wants to merge 5 commits into
base: master
from

Conversation

@withoutboats
Copy link
Contributor

withoutboats commented Jan 31, 2020

Currently, constructing a waker requires calling the unsafe Waker::from_raw API. This API requires the user to manually construct a vtable for the waker themself - which is both cumbersome and very error prone. This API would provide an ergonomic, straightforward and guaranteed memory-safe way of constructing a waker.

It has been our longstanding intention that the Waker type essentially function as an Arc<dyn Wake>, with a Wake trait as defined here. Two considerations prevented the original API from being shipped as simply an Arc<dyn Wake>:

  • We want to support futures on embedded systems, which may not have an allocator, and in optimized executors for which this API may not be best-suited. Therefore, we have always explicitly supported the maximally-flexible (but also memory-unsafe) RawWaker API, and Waker has always lived in libcore.
  • Because Waker lives in libcore and Arc lives in liballoc, it has not been feasible to provide a constructor for Waker from Arc<dyn Wake>.

Therefore, the Wake trait was left out of the initial version of the task waker API.

However, as Rust 1.41, it is possible under the more flexible orphan rules to implement From<Arc<W>> for Waker where W: Wake in liballoc. Therefore, we can now define this constructor even though Waker lives in libcore.

This PR adds these APIs:

  • A Wake trait, which contains two methods
    • A required method wake, which is called by Waker::wake
    • A provided method wake_by_ref, which is called by Waker::wake_by_ref and which implementors can override if they can optimize this use case.
  • An implementation of From<Arc<W>> for Waker where W: Wake + Send + Sync + 'static
  • A similar implementation of From<Arc<W>> for RawWaker.
Currently, constructing a waker requires calling the unsafe
`Waker::from_raw` API. This API requires the user to manually construct
a vtable for the waker themself - which is both cumbersome and very
error prone. This API would provide an ergonomic, straightforward and
guaranteed memory-safe way of constructing a waker.

It has been our longstanding intention that the `Waker` type essentially
function as an `Arc<dyn Wake>`, with a `Wake` trait as defined here. Two
considerations prevented the original API from being shipped as simply
an `Arc<dyn Wake>`:

- We want to support futures on embedded systems, which may not have an
  allocator, and in optimized executors for which this API may not be
  best-suited. Therefore, we have always explicitly supported the
  maximally-flexible (but also memory-unsafe) `RawWaker` API, and
  `Waker` has always lived in libcore.
- Because `Waker` lives in libcore and `Arc` lives in liballoc, it has
  not been feasible to provide a constructor for `Waker` from `Arc<dyn
  Wake>`.

Therefore, the Wake trait was left out of the initial version of the
task waker API.

However, as Rust 1.41, it is possible under the more flexible orphan
rules to implement `From<Arc<W>> for Waker where W: Wake` in liballoc.
Therefore, we can now define this constructor even though `Waker` lives
in libcore.

This PR adds these APIs:

- A `Wake` trait, which contains two methods
    - A required method `wake`, which is called by `Waker::wake`
    - A provided method `wake_by_ref`, which is called by
      `Waker::wake_by_ref` and which implementors can override if they
      can optimize this use case.
- An implementation of `From<Arc<W>> for Waker where W: Wake + Send +
  Sync + 'static`
- A similar implementation of `From<Arc<W>> for RawWaker`.
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 31, 2020

r? @rkruppe

(rust_highfive has picked a reviewer for you, use r? to override)

@withoutboats

This comment has been minimized.

Copy link
Contributor Author

withoutboats commented Jan 31, 2020

r? @cramertj (maybe?)

@rust-highfive rust-highfive assigned cramertj and unassigned rkruppe Jan 31, 2020
@withoutboats

This comment has been minimized.

Copy link
Contributor Author

withoutboats commented Jan 31, 2020

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 31, 2020

The job mingw-check 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.
2020-01-31T13:37:19.7465639Z ========================== Starting Command Output ===========================
2020-01-31T13:37:19.7469338Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/8f7619dc-e4ce-40b3-814d-bc886f8689ef.sh
2020-01-31T13:37:19.7469452Z 
2020-01-31T13:37:19.7474049Z ##[section]Finishing: Disable git automatic line ending conversion
2020-01-31T13:37:19.7481127Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-01-31T13:37:19.7483103Z Task         : Get sources
2020-01-31T13:37:19.7483141Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-31T13:37:19.7483179Z Version      : 1.0.0
2020-01-31T13:37:19.7483277Z Author       : Microsoft
---
2020-01-31T13:37:20.7622183Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-31T13:37:20.7720875Z ##[command]git config gc.auto 0
2020-01-31T13:37:20.7803007Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-31T13:37:20.7863980Z ##[command]git config --get-all http.proxy
2020-01-31T13:37:20.8002090Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/68700/merge:refs/remotes/pull/68700/merge
---
2020-01-31T13:42:29.8322883Z     Checking panic_abort v0.0.0 (/checkout/src/libpanic_abort)
2020-01-31T13:42:29.9898649Z     Checking backtrace v0.3.40
2020-01-31T13:42:31.1017403Z     Checking rustc-std-workspace-alloc v1.99.0 (/checkout/src/tools/rustc-std-workspace-alloc)
2020-01-31T13:42:31.1018368Z     Checking panic_unwind v0.0.0 (/checkout/src/libpanic_unwind)
2020-01-31T13:42:32.5862517Z error[E0658]: use of unstable library feature 'wake_trait'
2020-01-31T13:42:32.5864437Z     |
2020-01-31T13:42:32.5865385Z 479 |     pub use alloc::task::*;
2020-01-31T13:42:32.5866158Z     |             ^^^^^^^^^^^
2020-01-31T13:42:32.5866792Z     |
2020-01-31T13:42:32.5866792Z     |
2020-01-31T13:42:32.5867488Z     = help: add `#![feature(wake_trait)]` to the crate attributes to enable
2020-01-31T13:42:34.3183378Z error: aborting due to previous error
2020-01-31T13:42:34.3183536Z 
2020-01-31T13:42:34.3184007Z For more information about this error, try `rustc --explain E0658`.
2020-01-31T13:42:34.3286838Z error: could not compile `std`.
---
2020-01-31T13:42:34.3369593Z   local time: Fri Jan 31 13:42:34 UTC 2020
2020-01-31T13:42:34.6259037Z   network time: Fri, 31 Jan 2020 13:42:34 GMT
2020-01-31T13:42:34.6260389Z == end clock drift check ==
2020-01-31T13:42:35.6921663Z 
2020-01-31T13:42:35.6979058Z ##[error]Bash exited with code '1'.
2020-01-31T13:42:35.7001634Z ##[section]Finishing: Run build
2020-01-31T13:42:35.7020068Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-01-31T13:42:35.7022598Z Task         : Get sources
2020-01-31T13:42:35.7022644Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-31T13:42:35.7022714Z Version      : 1.0.0
2020-01-31T13:42:35.7022869Z Author       : Microsoft
2020-01-31T13:42:35.7022869Z Author       : Microsoft
2020-01-31T13:42:35.7022915Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-31T13:42:35.7022988Z ==============================================================================
2020-01-31T13:42:36.1698244Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-01-31T13:42:36.1736680Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-01-31T13:42:36.1848064Z Cleaning up task key
2020-01-31T13:42:36.1849172Z Start cleaning up orphan processes.
2020-01-31T13:42:36.1951436Z Terminate orphan process: pid (4404) (python)
2020-01-31T13:42:36.2173497Z ##[section]Finishing: Finalize Job

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)

/// This trait is a memory-safe and ergonomic alternative to constructing a
/// [`RawWaker`]. It supports the common executor design in which the data
/// used to wake up a task is stored in an [`Arc`]. Some executors (especially
/// those for embedded systems) cannot use this API, which is way [`RawWaker`]

This comment has been minimized.

Copy link
@NickeZ

NickeZ Jan 31, 2020

typo way => why.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 31, 2020

The job x86_64-gnu-llvm-7 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.
2020-01-31T13:44:57.0266080Z ========================== Starting Command Output ===========================
2020-01-31T13:44:57.0270844Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/b0500972-e0b4-45ff-bad9-8acf365b3e19.sh
2020-01-31T13:44:57.0271085Z 
2020-01-31T13:44:57.0275137Z ##[section]Finishing: Disable git automatic line ending conversion
2020-01-31T13:44:57.0281389Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-01-31T13:44:57.0283044Z Task         : Get sources
2020-01-31T13:44:57.0283078Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-31T13:44:57.0283108Z Version      : 1.0.0
2020-01-31T13:44:57.0283187Z Author       : Microsoft
---
2020-01-31T13:44:58.0304877Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-31T13:44:58.0319158Z ##[command]git config gc.auto 0
2020-01-31T13:44:58.0321546Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-31T13:44:58.0323464Z ##[command]git config --get-all http.proxy
2020-01-31T13:44:58.0459345Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/68700/merge:refs/remotes/pull/68700/merge

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)

unsafe fn wake_by_ref<W: Wake + Send + Sync + 'static>(waker: *const ()) {
let waker: Arc<W> = Arc::from_raw(waker as *const W);
Wake::wake_by_ref(&waker);
mem::forget(waker);

This comment has been minimized.

Copy link
@tmiasko

tmiasko Jan 31, 2020

Using ManuallyDrop might be a better choice in the case waker panics.

/// [`Arc`] and calls `wake` on the clone.
#[unstable(feature = "wake_trait", issue = "0")]
fn wake_by_ref(self: &Arc<Self>) {
self.clone().wake();

This comment has been minimized.

Copy link
@Nemo157

Nemo157 Jan 31, 2020

Contributor

futures::task::ArcWake has the opposite defaulted method. Is there a reason to assume that implementations would commonly need to own the Arc instead of being able to wake through a shared reference?

This comment has been minimized.

Copy link
@withoutboats

withoutboats Jan 31, 2020

Author Contributor

In my experience working on romio/juliex and reading the tokio source, the standard executor model is to re-enqueue the task on some TLS or global queue (which means it must have ownership), and the standard reactor model is to store an Option<Waker> and then call .take().unwrap().wake(). IMO the default in futures is backwards, and would result in naive implementations making an additional unnecessary ref count increment.

This comment has been minimized.

Copy link
@cramertj

cramertj Jan 31, 2020

Member

I don't have a strong opinion about this either way-- I can definitely imagine arguments on either side. The reason I did it the other way in futures-rs was that I imagined implementations which only needed by-reference waking would implement just wake not realizing that that would result in a wake_by_ref method which cloned unnecessarily. In practice, I don't think either case is too big of an issue.

This comment has been minimized.

Copy link
@withoutboats

withoutboats Feb 2, 2020

Author Contributor

Yea, either way I think its a chance of an incorrectly implemented executor leading to one extra incr/decr on wakeup - a trivial and easily fixable problem.

But I do think the more likely scenario is that they do need ownership of the arc, rather than that they don't (the only point of it being by arc is to cheaply enqueue on wake up after all), and I thought our choice to name the fns wake and wake_by_ref was tied up in this assumption (that wake would be the default one).

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 31, 2020

The job mingw-check 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.
2020-01-31T16:02:41.8900972Z ========================== Starting Command Output ===========================
2020-01-31T16:02:41.8903816Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/45971c8c-4b52-4995-b981-095186d5626f.sh
2020-01-31T16:02:41.8904013Z 
2020-01-31T16:02:41.8907594Z ##[section]Finishing: Disable git automatic line ending conversion
2020-01-31T16:02:41.8914200Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-01-31T16:02:41.8915954Z Task         : Get sources
2020-01-31T16:02:41.8915989Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-31T16:02:41.8916021Z Version      : 1.0.0
2020-01-31T16:02:41.8916054Z Author       : Microsoft
---
2020-01-31T16:02:42.9375241Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-31T16:02:42.9386411Z ##[command]git config gc.auto 0
2020-01-31T16:02:42.9389141Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-31T16:02:42.9391118Z ##[command]git config --get-all http.proxy
2020-01-31T16:02:42.9397374Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/68700/merge:refs/remotes/pull/68700/merge
---
2020-01-31T16:07:37.0944373Z 
2020-01-31T16:07:37.0979986Z error: incorrect close delimiter: `)`
2020-01-31T16:07:37.0980299Z   --> src/liballoc/task.rs:86:6
2020-01-31T16:07:37.0980566Z    |
2020-01-31T16:07:37.0980896Z 58 | fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker {
2020-01-31T16:07:37.0981288Z    |                                                                          - un-closed delimiter
2020-01-31T16:07:37.0981799Z 86 |     ))
2020-01-31T16:07:37.0982136Z    |      ^ incorrect close delimiter
2020-01-31T16:07:37.0986490Z 
2020-01-31T16:07:37.1049187Z error: aborting due to 2 previous errors
---
2020-01-31T16:07:38.4393165Z   local time: Fri Jan 31 16:07:38 UTC 2020
2020-01-31T16:07:38.7283554Z   network time: Fri, 31 Jan 2020 16:07:38 GMT
2020-01-31T16:07:38.7284506Z == end clock drift check ==
2020-01-31T16:07:39.7393634Z 
2020-01-31T16:07:39.7483734Z ##[error]Bash exited with code '1'.
2020-01-31T16:07:39.7498098Z ##[section]Finishing: Run build
2020-01-31T16:07:39.7516226Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-01-31T16:07:39.7518505Z Task         : Get sources
2020-01-31T16:07:39.7518553Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-31T16:07:39.7518617Z Version      : 1.0.0
2020-01-31T16:07:39.7518676Z Author       : Microsoft
2020-01-31T16:07:39.7518676Z Author       : Microsoft
2020-01-31T16:07:39.7518723Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-31T16:07:39.7518772Z ==============================================================================
2020-01-31T16:07:40.1682207Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-01-31T16:07:40.1723981Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-01-31T16:07:40.1836052Z Cleaning up task key
2020-01-31T16:07:40.1836988Z Start cleaning up orphan processes.
2020-01-31T16:07:40.1951712Z Terminate orphan process: pid (3967) (python)
2020-01-31T16:07:40.2150862Z ##[section]Finishing: Finalize Job

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)

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jan 31, 2020

The job x86_64-gnu-llvm-7 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.
2020-01-31T16:15:05.3638631Z ========================== Starting Command Output ===========================
2020-01-31T16:15:05.3659998Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/6c9e28e6-71ba-49dd-8cd5-21242af713f0.sh
2020-01-31T16:15:05.3931565Z 
2020-01-31T16:15:05.3939622Z ##[section]Finishing: Disable git automatic line ending conversion
2020-01-31T16:15:05.3945487Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-01-31T16:15:05.3947192Z Task         : Get sources
2020-01-31T16:15:05.3947243Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-31T16:15:05.3947276Z Version      : 1.0.0
2020-01-31T16:15:05.3947310Z Author       : Microsoft
---
2020-01-31T16:15:06.4591690Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-01-31T16:15:06.4605863Z ##[command]git config gc.auto 0
2020-01-31T16:15:06.4611113Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-01-31T16:15:06.4615566Z ##[command]git config --get-all http.proxy
2020-01-31T16:15:06.4624183Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/68700/merge:refs/remotes/pull/68700/merge
---
2020-01-31T16:20:46.3759933Z * 589 error codes
2020-01-31T16:20:46.3760688Z * highest error code: E0746
2020-01-31T16:20:46.4659007Z thread 'main' panicked at 'assertion failed: `(left != right)`
2020-01-31T16:20:46.4659832Z   left: `0`,
2020-01-31T16:20:46.4660767Z  right: `0`: "none" should be used when there is no issue, not "0"', src/tools/tidy/src/features.rs:417:21
2020-01-31T16:20:46.4664469Z 
2020-01-31T16:20:46.4664767Z 
2020-01-31T16:20:46.4664767Z 
2020-01-31T16:20:46.4665594Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2020-01-31T16:20:46.4666662Z 
2020-01-31T16:20:46.4666867Z 
2020-01-31T16:20:46.4675192Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2020-01-31T16:20:46.4676338Z Build completed unsuccessfully in 0:01:35
2020-01-31T16:20:46.4676338Z Build completed unsuccessfully in 0:01:35
2020-01-31T16:20:46.4726342Z == clock drift check ==
2020-01-31T16:20:46.4736787Z   local time: Fri Jan 31 16:20:46 UTC 2020
2020-01-31T16:20:46.6330126Z   network time: Fri, 31 Jan 2020 16:20:46 GMT
2020-01-31T16:20:46.6336348Z == end clock drift check ==
2020-01-31T16:20:47.3851644Z 
2020-01-31T16:20:47.3955483Z ##[error]Bash exited with code '1'.
2020-01-31T16:20:47.3968246Z ##[section]Finishing: Run build
2020-01-31T16:20:47.3983208Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-01-31T16:20:47.3984981Z Task         : Get sources
2020-01-31T16:20:47.3985048Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-01-31T16:20:47.3985098Z Version      : 1.0.0
2020-01-31T16:20:47.3985141Z Author       : Microsoft
2020-01-31T16:20:47.3985141Z Author       : Microsoft
2020-01-31T16:20:47.3985219Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-01-31T16:20:47.3985272Z ==============================================================================
2020-01-31T16:20:47.8399674Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-01-31T16:20:47.8442657Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-01-31T16:20:47.8561273Z Cleaning up task key
2020-01-31T16:20:47.8562356Z Start cleaning up orphan processes.
2020-01-31T16:20:47.8681815Z Terminate orphan process: pid (3896) (python)
2020-01-31T16:20:47.8893305Z ##[section]Finishing: Finalize Job

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)

@withoutboats

This comment has been minimized.

Copy link
Contributor Author

withoutboats commented Feb 2, 2020

@rfcbot fcp merge See first post for a full explanation

@rfcbot

This comment has been minimized.

Copy link

rfcbot commented Feb 2, 2020

Team member @withoutboats has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 2, 2020

The job x86_64-gnu-llvm-7 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.
2020-02-02T15:52:44.6597906Z ========================== Starting Command Output ===========================
2020-02-02T15:52:44.6599890Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/05a112d7-4169-448c-af76-ddb09955816c.sh
2020-02-02T15:52:44.6599925Z 
2020-02-02T15:52:44.6602767Z ##[section]Finishing: Disable git automatic line ending conversion
2020-02-02T15:52:44.6607658Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-02-02T15:52:44.6609808Z Task         : Get sources
2020-02-02T15:52:44.6609834Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-02T15:52:44.6609860Z Version      : 1.0.0
2020-02-02T15:52:44.6609892Z Author       : Microsoft
---
2020-02-02T15:52:45.4755220Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-02-02T15:52:45.4844260Z ##[command]git config gc.auto 0
2020-02-02T15:52:45.4897914Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-02-02T15:52:45.4944460Z ##[command]git config --get-all http.proxy
2020-02-02T15:52:45.5080201Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/68700/merge:refs/remotes/pull/68700/merge
---
2020-02-02T15:57:52.1583998Z * 589 error codes
2020-02-02T15:57:52.1584962Z * highest error code: E0746
2020-02-02T15:57:52.2434408Z thread 'main' panicked at 'assertion failed: `(left != right)`
2020-02-02T15:57:52.2437304Z   left: `0`,
2020-02-02T15:57:52.2438681Z  right: `0`: "none" should be used when there is no issue, not "0"', src/tools/tidy/src/features.rs:417:21
2020-02-02T15:57:52.2446962Z 
2020-02-02T15:57:52.2447321Z 
2020-02-02T15:57:52.2447321Z 
2020-02-02T15:57:52.2448246Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor"
2020-02-02T15:57:52.2448829Z 
2020-02-02T15:57:52.2449201Z 
2020-02-02T15:57:52.2451649Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2020-02-02T15:57:52.2452111Z Build completed unsuccessfully in 0:01:20
2020-02-02T15:57:52.2452111Z Build completed unsuccessfully in 0:01:20
2020-02-02T15:57:52.2495500Z == clock drift check ==
2020-02-02T15:57:52.2503642Z   local time: Sun Feb  2 15:57:52 UTC 2020
2020-02-02T15:57:52.4172018Z   network time: Sun, 02 Feb 2020 15:57:52 GMT
2020-02-02T15:57:52.4178376Z == end clock drift check ==
2020-02-02T15:57:53.1970241Z 
2020-02-02T15:57:53.2035649Z ##[error]Bash exited with code '1'.
2020-02-02T15:57:53.2046900Z ##[section]Finishing: Run build
2020-02-02T15:57:53.2060199Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-02-02T15:57:53.2062062Z Task         : Get sources
2020-02-02T15:57:53.2062104Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-02-02T15:57:53.2062161Z Version      : 1.0.0
2020-02-02T15:57:53.2062198Z Author       : Microsoft
2020-02-02T15:57:53.2062198Z Author       : Microsoft
2020-02-02T15:57:53.2062255Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-02-02T15:57:53.2062315Z ==============================================================================
2020-02-02T15:57:53.5702836Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-02-02T15:57:53.5740037Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/68700/merge to s
2020-02-02T15:57:53.5846063Z Cleaning up task key
2020-02-02T15:57:53.5847165Z Start cleaning up orphan processes.
2020-02-02T15:57:53.5955071Z Terminate orphan process: pid (3756) (python)
2020-02-02T15:57:53.6135047Z ##[section]Finishing: Finalize Job

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)

@dtolnay

This comment has been minimized.

Copy link
Member

dtolnay commented Feb 2, 2020

Looks great to me. Minor question: is there any use case for a Wake impl that is not Send + Sync + 'static? Did you evaluate having those as supertraits of Wake?

@rfcbot reviewed

@withoutboats

This comment has been minimized.

Copy link
Contributor Author

withoutboats commented Feb 3, 2020

Looks great to me. Minor question: is there any use case for a Wake impl that is not Send + Sync + 'static? Did you evaluate having those as supertraits of Wake?

No there isn't, but I put them on the bound instead of as supertrait since that's my understanding of how std normally does things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.