Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't record all intermediate adjustment types
That's way more than is needed, and winds up recording types that will never appear in MIR.
- Loading branch information
1 parent
dece573
commit d95a776
Showing
2 changed files
with
47 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Regression test for #64477. | ||
// | ||
// We were incorrectly claiming that the `f(x).await` future captured | ||
// a value of type `T`, and hence that `T: Send` would have to hold. | ||
// | ||
// check-pass | ||
// edition:2018 | ||
|
||
use std::future::Future; | ||
use std::pin::Pin; | ||
|
||
fn f<T>(_: &T) -> Pin<Box<dyn Future<Output = ()> + Send>> { | ||
unimplemented!() | ||
} | ||
|
||
pub fn g<T: Sync>(x: &'static T) -> impl Future<Output = ()> + Send { | ||
async move { f(x).await } | ||
} | ||
|
||
fn main() { } |