Skip to content

Commit f495605

Browse files
committed
Auto merge of rust-lang#110901 - GuillaumeGomez:inlined-repr-rustdoc, r=notriddle
rustdoc: Fix missing `repr` attribute in doc(inline) on foreign items Fixes rust-lang#110698. r? `@notriddle`
2 parents f357475 + 3f08284 commit f495605

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

compiler/rustc_feature/src/builtin_attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
344344
),
345345
ungated!(link_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding),
346346
ungated!(no_link, Normal, template!(Word), WarnFollowing),
347-
ungated!(repr, Normal, template!(List: "C"), DuplicatesOk, @only_local: true),
347+
ungated!(repr, Normal, template!(List: "C"), DuplicatesOk),
348348
ungated!(export_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding),
349349
ungated!(link_section, Normal, template!(NameValueStr: "name"), FutureWarnPreceding),
350350
ungated!(no_mangle, Normal, template!(Word), WarnFollowing, @only_local: true),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#[repr(C)]
2+
pub struct Foo {
3+
field: u8,
4+
}

tests/rustdoc/inline_cross/repr.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/110698>.
2+
// This test ensures that the re-exported items still have the `#[repr(...)]` attribute.
3+
4+
// aux-build:repr.rs
5+
6+
#![crate_name = "foo"]
7+
8+
extern crate repr;
9+
10+
// @has 'foo/struct.Foo.html'
11+
// @has - '//*[@class="rust item-decl"]//*[@class="code-attribute"]' '#[repr(C)]'
12+
#[doc(inline)]
13+
pub use repr::Foo;

0 commit comments

Comments
 (0)