Skip to content

Commit 15fa511

Browse files
committed
add tests
1 parent b26fea5 commit 15fa511

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

src/test/ui/mir/issue-105819.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#![feature(type_alias_impl_trait)]
2+
// check-pass
3+
4+
fn main() {}
5+
6+
fn upvar() {
7+
#[derive(Copy, Clone)]
8+
struct Foo((u32, u32));
9+
10+
type T = impl Copy;
11+
let foo: T = Foo((1u32, 2u32));
12+
let x = move || {
13+
let Foo((a, b)) = foo;
14+
};
15+
}

src/test/ui/mir/issue-105881.rs

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// check-pass
2+
// compile-flags: --edition 2018
3+
4+
use std::future::Future;
5+
use std::pin::Pin;
6+
use std::task::{Context, Poll};
7+
8+
async fn new_future() {
9+
loop {}
10+
}
11+
12+
pub struct SelectAll<Fut> {
13+
_inner: Fut,
14+
}
15+
16+
fn select_all<I>(_: I) -> SelectAll<I::Item>
17+
where
18+
I: IntoIterator,
19+
I::Item: Future + Unpin,
20+
{
21+
loop {}
22+
}
23+
24+
impl<Fut: Future> Future for SelectAll<Fut> {
25+
type Output = ();
26+
27+
fn poll(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Self::Output> {
28+
loop {}
29+
}
30+
}
31+
32+
async fn run_one_step() {
33+
let mut select = select_all(vec![Box::pin(new_future())]);
34+
let poll_fns = &mut |cx: &mut Context<'_>| Pin::new(&mut select).poll(cx);
35+
for _poll_fn in [poll_fns] {}
36+
}
37+
38+
fn main() {}

0 commit comments

Comments
 (0)