<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/libcore/future, branch try</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=try</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=try'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2020-07-28T00:51:13+00:00</updated>
<entry>
<title>mv std libs to library/</title>
<updated>2020-07-28T00:51:13+00:00</updated>
<author>
<name>mark</name>
<email>markm@cs.wisc.edu</email>
</author>
<published>2020-06-12T02:31:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2c31b45ae878b821975c4ebd94cc1e49f6073fd0'/>
<id>urn:sha1:2c31b45ae878b821975c4ebd94cc1e49f6073fd0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Revert "Remove spotlight usage"</title>
<updated>2020-07-16T16:58:34+00:00</updated>
<author>
<name>Manish Goregaokar</name>
<email>manishsmail@gmail.com</email>
</author>
<published>2020-07-06T19:54:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3cecd6003b3eb15168421084a27223596517899c'/>
<id>urn:sha1:3cecd6003b3eb15168421084a27223596517899c</id>
<content type='text'>
This reverts commit 13c6d5819aae3c0de6a90e7f17ea967bf4487cbb.
</content>
</entry>
<entry>
<title>Rollup merge of #72303 - yoshuawuyts:future-poll-fn, r=dtolnay</title>
<updated>2020-07-11T06:26:24+00:00</updated>
<author>
<name>Manish Goregaokar</name>
<email>manishsmail@gmail.com</email>
</author>
<published>2020-07-11T06:26:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d82588b45aa866418a3cc88924e939015fd1bd1c'/>
<id>urn:sha1:d82588b45aa866418a3cc88924e939015fd1bd1c</id>
<content type='text'>
Add core::future::{poll_fn, PollFn}

This is a sibling PR to #70834, adding `future::poll_fn`. This is a small helper function that helps bridge the gap between "poll state machines" and "async/await". It was first introduced in [futures@0.1.7](https://docs.rs/futures/0.1.7/futures/future/fn.poll_fn.html) in December of 2016, and has been tried and tested as part of the ecosystem for the past 3.5 years.

## Implementation

Much of the same reasoning from #70834 applies: by returning a concrete struct rather than an `async fn` we get to mark the future as `Unpin`. It also becomes named which allows storing it in structs without boxing. This implementation has been modified from the implementation in `futures-rs`.

## References
- [`futures::future::poll_fn`](https://docs.rs/futures/0.3.5/futures/future/fn.poll_fn.html)
- [`async_std::future::poll_fn`](https://docs.rs/async-std/1.5.0/async_std/future/fn.poll_fn.html)
</content>
</entry>
<entry>
<title>Deny unsafe ops in unsafe fns, part 6</title>
<updated>2020-06-30T17:28:51+00:00</updated>
<author>
<name>LeSeulArtichaut</name>
<email>leseulartichaut@gmail.com</email>
</author>
<published>2020-06-30T17:10:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a1623ff3b6a48e7ac29e1c25900989851278743b'/>
<id>urn:sha1:a1623ff3b6a48e7ac29e1c25900989851278743b</id>
<content type='text'>
And final part!!!
</content>
</entry>
<entry>
<title>Adds a clearer message for when the async keyword is missing from a function</title>
<updated>2020-06-25T23:01:45+00:00</updated>
<author>
<name>Nell Shamrell</name>
<email>nellshamrell@gmail.com</email>
</author>
<published>2020-06-18T17:30:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5e28eb580ff48a84fe6f49bff31c4c022f243ac9'/>
<id>urn:sha1:5e28eb580ff48a84fe6f49bff31c4c022f243ac9</id>
<content type='text'>
Signed-off-by: Nell Shamrell &lt;nellshamrell@gmail.com&gt;
</content>
</entry>
<entry>
<title>Display information about captured variable in `FnMut` error</title>
<updated>2020-05-26T03:18:00+00:00</updated>
<author>
<name>Aaron Hill</name>
<email>aa1ronham@gmail.com</email>
</author>
<published>2020-05-24T01:40:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9cee22c1a401ace6dd8633335b131c47a37d7bac'/>
<id>urn:sha1:9cee22c1a401ace6dd8633335b131c47a37d7bac</id>
<content type='text'>
Fixes #69446

When we encounter a region error involving an `FnMut` closure, we
display a specialized error message. However, we currently do not
tell the user which upvar was captured. This makes it difficult to
determine the cause of the error, especially when the closure is large.

This commit records marks constraints involving closure upvars
with `ConstraintCategory::ClosureUpvar`. When we decide to 'blame'
a `ConstraintCategory::Return`, we additionall store
the captured upvar if we found a `ConstraintCategory::ClosureUpvar` in
the path.

When generating an error message, we point to relevant spans if we have
closure upvar information available. We further customize the message if
an `async` closure is being returned, to make it clear that the captured
variable is being returned indirectly.
</content>
</entry>
<entry>
<title>Add core::future::IntoFuture</title>
<updated>2020-05-22T08:55:01+00:00</updated>
<author>
<name>Yoshua Wuyts</name>
<email>yoshuawuyts@gmail.com</email>
</author>
<published>2020-05-22T08:07:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9ff502029d379bebc50cf92a97f019fefba09d79'/>
<id>urn:sha1:9ff502029d379bebc50cf92a97f019fefba09d79</id>
<content type='text'>
This patch adds `core::future::IntoFuture`. However unlike earlier PRs this patch does not integrate it into the `async/.await` lowering. That integration should be done in a follow-up PR.
</content>
</entry>
<entry>
<title>Add core::future::{poll_fn, PollFn}</title>
<updated>2020-05-18T19:54:14+00:00</updated>
<author>
<name>Yoshua Wuyts</name>
<email>yoshuawuyts@gmail.com</email>
</author>
<published>2020-05-17T17:44:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a31f103fd27bde3f83b9dd54af8e41d64e5001f4'/>
<id>urn:sha1:a31f103fd27bde3f83b9dd54af8e41d64e5001f4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #70834 - yoshuawuyts:future-pending-ready, r=sfackler</title>
<updated>2020-05-09T01:10:01+00:00</updated>
<author>
<name>Dylan DPC</name>
<email>dylan.dpc@gmail.com</email>
</author>
<published>2020-05-09T01:10:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=62374ee4ad00a4cc8a4807ed13823a49e2e8422d'/>
<id>urn:sha1:62374ee4ad00a4cc8a4807ed13823a49e2e8422d</id>
<content type='text'>
Add core::future::{pending,ready}

Adds two future constructors to `core`: `future::ready` and `future::pending`. These functions enable constructing futures of any type that either immediately resolve, or never resolve which is an incredible useful tool when writing documentation.

These functions have prior art in both the `futures` and `async-std` crates. This implementation has been adapted from the `futures` crate.

## Examples

In https://github.com/rust-lang/rust/pull/70817 we propose adding the `ready!` macro. In the example we use an `async fn` which does not return a future that implements `Unpin`, which leads to the use of `unsafe`. Instead had we had `future::ready` available, we could've written the same example without using `unsafe`:

```rust
use core::task::{Context, Poll};
use core::future::{self, Future};
use core::pin::Pin;

pub fn do_poll(cx: &amp;mut Context&lt;'_&gt;) -&gt; Poll&lt;()&gt; {
    let mut fut = future::ready(42_u8);
    let num = ready!(Pin::new(fut).poll(cx));
    // ... use num

    Poll::Ready(())
}
```

## Why future::ready?

Arguably `future::ready` and `async {}` can be considered equivalent. The main differences are that `future::ready` returns a future that implements `Unpin`, and the returned future is a concrete type. This is useful for traits that require a future as an associated type that can sometimes be a no-op ([example](https://docs.rs/http-service/0.4.0/http_service/trait.HttpService.html#associatedtype.ConnectionFuture)).

The final, minor argument is that `future::ready` and `future::pending` form a counterpart to the enum members of `Poll`: `Ready` and `Pending`. These functions form a conceptual bridge between `Poll` and `Future`, and can be used as a useful teaching device.

## References
- [`futures::future::ready`](https://docs.rs/futures/0.3.4/futures/future/fn.ready.html)
- [`futures::future::pending`](https://docs.rs/futures/0.3.4/futures/future/fn.pending.html)
- [`async_std::future::pending`](https://docs.rs/async-std/1.5.0/async_std/future/fn.pending.html)
- [`async_std::future::ready`](https://docs.rs/async-std/1.5.0/async_std/future/fn.ready.html)
</content>
</entry>
<entry>
<title>Add core::future::{pending,ready}</title>
<updated>2020-05-07T13:19:27+00:00</updated>
<author>
<name>Yoshua Wuyts</name>
<email>yoshuawuyts@gmail.com</email>
</author>
<published>2020-04-06T07:24:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=029515d9164bddc0928c159d375aadfc7f256b28'/>
<id>urn:sha1:029515d9164bddc0928c159d375aadfc7f256b28</id>
<content type='text'>
</content>
</entry>
</feed>
