forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#89882 - matthiaskrgr:rollup-1dh7pz8, r=matthi…
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#89390 (Fix incorrect Box::pin suggestion) - rust-lang#89433 (Fix ctrl-c causing reads of stdin to return empty on Windows.) - rust-lang#89823 (Switch order of terms to prevent overflow) - rust-lang#89865 (Allow static linking LLVM with ThinLTO) - rust-lang#89873 (Add missing word to `FromStr` trait documentation) - rust-lang#89878 (Fix missing remaining compiler specific cfg information) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
14 changed files
with
120 additions
and
49 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
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 @@ | ||
// Issue #72117 | ||
// edition:2018 | ||
|
||
use core::future::Future; | ||
use core::pin::Pin; | ||
|
||
pub type BoxFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>; | ||
|
||
impl<T: ?Sized> FutureExt for T where T: Future {} | ||
trait FutureExt: Future { | ||
fn boxed<'a>(self) -> BoxFuture<'a, Self::Output> | ||
where | ||
Self: Sized + Send + 'a, | ||
{ | ||
Box::pin(self) | ||
} | ||
} | ||
|
||
fn main() { | ||
let _: BoxFuture<'static, bool> = async {}.boxed(); | ||
//~^ ERROR: mismatched types | ||
} |
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,14 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/box-future-wrong-output.rs:20:39 | ||
| | ||
LL | let _: BoxFuture<'static, bool> = async {}.boxed(); | ||
| ------------------------ ^^^^^^^^^^^^^^^^ expected `bool`, found `()` | ||
| | | ||
| expected due to this | ||
| | ||
= note: expected struct `Pin<Box<(dyn Future<Output = bool> + Send + 'static)>>` | ||
found struct `Pin<Box<dyn Future<Output = ()> + Send>>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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