Skip to content

Commit 4653bbf

Browse files
Add ui test for projection used as union field type
1 parent 921efd2 commit 4653bbf

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Ensures that we can use projections as union field's type.
2+
// check-pass
3+
4+
#![crate_type = "lib"]
5+
6+
pub trait Identity {
7+
type Identity;
8+
}
9+
10+
impl<T> Identity for T {
11+
type Identity = Self;
12+
}
13+
14+
pub type Foo = u8;
15+
16+
pub union Bar {
17+
pub a: <Foo as Identity>::Identity,
18+
pub b: u8,
19+
}

0 commit comments

Comments
 (0)