forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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 rust-lang#99300 - Mark-Simulacrum:beta-next, r=Mark-Sim…
…ulacrum [beta] rollup * Fix sized check ICE in asm check rust-lang#99124 * Windows: Fallback for overlapped I/O rust-lang#98950 * promote placeholder bounds to 'static obligations rust-lang#98713 * Create fresh lifetime parameters for bare fn trait too rust-lang#98637 r? `@Mark-Simulacrum`
- Loading branch information
Showing
17 changed files
with
377 additions
and
35 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 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,22 @@ | ||
use crate::sys::pipe::{anon_pipe, Pipes}; | ||
use crate::{thread, time}; | ||
|
||
/// Test the synchronous fallback for overlapped I/O. | ||
#[test] | ||
fn overlapped_handle_fallback() { | ||
// Create some pipes. `ours` will be asynchronous. | ||
let Pipes { ours, theirs } = anon_pipe(true, false).unwrap(); | ||
|
||
let async_readable = ours.into_handle(); | ||
let sync_writeable = theirs.into_handle(); | ||
|
||
thread::scope(|_| { | ||
thread::sleep(time::Duration::from_millis(100)); | ||
sync_writeable.write(b"hello world!").unwrap(); | ||
}); | ||
|
||
// The pipe buffer starts empty so reading won't complete synchronously unless | ||
// our fallback path works. | ||
let mut buffer = [0u8; 1024]; | ||
async_readable.read(&mut buffer).unwrap(); | ||
} |
Oops, something went wrong.