-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #67310 - Centril:rollup-22jiyow, r=Centril
Rollup of 6 pull requests Successful merges: - #67255 (Remove i686-unknown-dragonfly target) - #67267 (Fix signature of `__wasilibc_find_relpath`) - #67282 (Fix example code of OpenOptions::open) - #67289 (Do not ICE on unnamed future) - #67300 (Restore original implementation of Vec::retain) - #67305 (Doc typo) Failed merges: r? @ghost
- Loading branch information
Showing
10 changed files
with
96 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// edition:2018 | ||
use std::future::Future; | ||
use std::pin::Pin; | ||
use std::task::{Context, Poll}; | ||
|
||
fn spawn<T: Send>(_: T) {} | ||
|
||
pub struct AFuture; | ||
impl Future for AFuture{ | ||
type Output = (); | ||
|
||
fn poll(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<()> { | ||
unimplemented!() | ||
} | ||
} | ||
|
||
async fn foo() { | ||
spawn(async { //~ ERROR future cannot be sent between threads safely | ||
let _a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send` | ||
AFuture.await; | ||
}); | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
error: future cannot be sent between threads safely | ||
--> $DIR/issue-67252-unnamed-future.rs:18:5 | ||
| | ||
LL | fn spawn<T: Send>(_: T) {} | ||
| ----- ---- required by this bound in `spawn` | ||
... | ||
LL | spawn(async { | ||
| ^^^^^ future is not `Send` | ||
| | ||
= help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `*mut ()` | ||
note: future is not `Send` as this value is used across an await | ||
--> $DIR/issue-67252-unnamed-future.rs:20:9 | ||
| | ||
LL | let _a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send` | ||
| -- has type `*mut ()` | ||
LL | AFuture.await; | ||
| ^^^^^^^^^^^^^ await occurs here, with `_a` maybe used later | ||
LL | }); | ||
| - `_a` is later dropped here | ||
|
||
error: aborting due to previous error | ||
|