Skip to content

Commit 2693e20

Browse files
Extend foreign inlined item with #[repr()] test
1 parent 89b0956 commit 2693e20

File tree

2 files changed

+39
-5
lines changed

2 files changed

+39
-5
lines changed
+20-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
#[repr(C)]
2-
pub struct Foo {
1+
#![feature(repr_simd)]
2+
3+
#[repr(C, align(8))]
4+
pub struct ReprC {
35
field: u8,
46
}
7+
#[repr(simd, packed(2))]
8+
pub struct ReprSimd {
9+
field: u8,
10+
}
11+
#[repr(transparent)]
12+
pub struct ReprTransparent {
13+
field: u8,
14+
}
15+
#[repr(isize)]
16+
pub enum ReprIsize {
17+
Bla,
18+
}
19+
#[repr(u8)]
20+
pub enum ReprU8 {
21+
Bla,
22+
}

tests/rustdoc/inline_cross/repr.rs

+19-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,23 @@
77

88
extern crate repr;
99

10-
// @has 'foo/struct.Foo.html'
11-
// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(C)]'
10+
// @has 'foo/struct.ReprC.html'
11+
// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(C, align(8))]'
1212
#[doc(inline)]
13-
pub use repr::Foo;
13+
pub use repr::ReprC;
14+
// @has 'foo/struct.ReprSimd.html'
15+
// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(simd, packed(2))]'
16+
#[doc(inline)]
17+
pub use repr::ReprSimd;
18+
// @has 'foo/struct.ReprTransparent.html'
19+
// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(transparent)]'
20+
#[doc(inline)]
21+
pub use repr::ReprTransparent;
22+
// @has 'foo/enum.ReprIsize.html'
23+
// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(isize)]'
24+
#[doc(inline)]
25+
pub use repr::ReprIsize;
26+
// @has 'foo/enum.ReprU8.html'
27+
// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(u8)]'
28+
#[doc(inline)]
29+
pub use repr::ReprU8;

0 commit comments

Comments
 (0)