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

Make Spawn::spawn take &self rather than &mut self #1950

Merged
merged 1 commit into from
Nov 5, 2019

Conversation

cramertj
Copy link
Member

@cramertj cramertj commented Nov 5, 2019

@cramertj cramertj merged commit 47f3ccb into rust-lang:master Nov 5, 2019
@cramertj cramertj deleted the spawn-by-ref branch November 5, 2019 19:02
Marwes added a commit to Marwes/futures-rs that referenced this pull request Nov 6, 2019
Seems like an oversight in rust-lang#1950

Technically a

BREAKING CHANGE
cramertj pushed a commit that referenced this pull request Nov 7, 2019
Seems like an oversight in #1950

Technically a

BREAKING CHANGE
najamelan added a commit to najamelan/futures-rs that referenced this pull request Jan 19, 2020
Since rust-lang#1950 (0.3.0) the Spawn and LocalSpawn only require a shared reference
for spawning operations.

This adds blanket impls for `Arc<Sp: ?Sized + Spawn>` and `Rc<Sp: ?Sized + Spawn>`.
It does the same for LocalSpawn.

This allows client code to pass an Arc<Exec> when library code takes
parameters as `&dyn Spawn` or `impl Spawn`.

So far there were blanket impls for `&`, `&mut` and `Box`.
najamelan added a commit to najamelan/futures-rs that referenced this pull request Jan 23, 2020
Since rust-lang#1950 (0.3.0) the Spawn and LocalSpawn only require a shared reference
for spawning operations.

This adds blanket impls for `Arc<Sp: ?Sized + Spawn>` and `Rc<Sp: ?Sized + Spawn>`.
It does the same for LocalSpawn.

This allows client code to pass an Arc<Exec> when library code takes
parameters as `&dyn Spawn` or `impl Spawn`.

So far there were blanket impls for `&`, `&mut` and `Box`.
najamelan added a commit to najamelan/futures-rs that referenced this pull request Jan 23, 2020
Since rust-lang#1950 (0.3.0) the Spawn and LocalSpawn only require a shared reference
for spawning operations.

This adds blanket impls for `Arc<Sp: ?Sized + Spawn>` and `Rc<Sp: ?Sized + Spawn>`.
It does the same for LocalSpawn.

This allows client code to pass an Arc<Exec> when library code takes
parameters as `&dyn Spawn` or `impl Spawn`.

So far there were blanket impls for `&`, `&mut` and `Box`.
cramertj pushed a commit that referenced this pull request Jan 23, 2020
Since #1950 (0.3.0) the Spawn and LocalSpawn only require a shared reference
for spawning operations.

This adds blanket impls for `Arc<Sp: ?Sized + Spawn>` and `Rc<Sp: ?Sized + Spawn>`.
It does the same for LocalSpawn.

This allows client code to pass an Arc<Exec> when library code takes
parameters as `&dyn Spawn` or `impl Spawn`.

So far there were blanket impls for `&`, `&mut` and `Box`.
exrook pushed a commit to exrook/futures-rs that referenced this pull request Apr 5, 2021
Seems like an oversight in rust-lang#1950

Technically a

BREAKING CHANGE
exrook pushed a commit to exrook/futures-rs that referenced this pull request Apr 5, 2021
Since rust-lang#1950 (0.3.0) the Spawn and LocalSpawn only require a shared reference
for spawning operations.

This adds blanket impls for `Arc<Sp: ?Sized + Spawn>` and `Rc<Sp: ?Sized + Spawn>`.
It does the same for LocalSpawn.

This allows client code to pass an Arc<Exec> when library code takes
parameters as `&dyn Spawn` or `impl Spawn`.

So far there were blanket impls for `&`, `&mut` and `Box`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

&self vs. &mut self for spawners
3 participants