Skip to content

Commit 0146929

Browse files
tests: add system/idempotence tests for Anonymous{Struct,Union}
1 parent f5d12c4 commit 0146929

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/source/type.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ struct F {
1414
z: Foo, /* comment */ .../* comment 2*/ ),
1515
}
1616

17+
// anonymous structs and unions
18+
struct Foo {foo: u8, bar: union {
19+
bar: u8,baz: u16}
20+
}
21+
22+
union Bar {
23+
foobar: u8, barfoo:
24+
struct { foobaz: u8,
25+
barbaz: u16}}
26+
1727
fn issue_1006(def_id_to_string: for<'a, 'b> unsafe fn(TyCtxt<'b, 'tcx, 'tcx>, DefId) -> String) {}
1828

1929
fn impl_trait_fn_1() -> impl Fn(i32) -> Option<u8> {}

tests/target/type.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,23 @@ struct F {
2020
),
2121
}
2222

23+
// anonymous structs and unions
24+
struct Foo {
25+
foo: u8,
26+
bar: union {
27+
bar: u8,
28+
baz: u16,
29+
},
30+
}
31+
32+
union Bar {
33+
foobar: u8,
34+
barfoo: struct {
35+
foobaz: u8,
36+
barbaz: u16,
37+
},
38+
}
39+
2340
fn issue_1006(def_id_to_string: for<'a, 'b> unsafe fn(TyCtxt<'b, 'tcx, 'tcx>, DefId) -> String) {}
2441

2542
fn impl_trait_fn_1() -> impl Fn(i32) -> Option<u8> {}

0 commit comments

Comments
 (0)