Skip to content

Commit 2e3dcc6

Browse files
committed
add send test
1 parent efff225 commit 2e3dcc6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/ui/field_projections/send.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//@ revisions: old next
2+
//@ [next] compile-flags: -Znext-solver
3+
//@ run-pass
4+
#![feature(field_projections)]
5+
#![allow(incomplete_features)]
6+
use std::field::field_of;
7+
8+
struct Foo {
9+
field: u32,
10+
}
11+
struct Bar {
12+
bar_field: u32,
13+
}
14+
unsafe impl Send for field_of!(Bar, bar_field) {}
15+
16+
fn is_send<T: Send>() {}
17+
18+
fn main() {
19+
is_send::<field_of!(Bar, bar_field)>();
20+
is_send::<field_of!(Foo, field)>();
21+
}

0 commit comments

Comments
 (0)