Skip to content

Commit 80170ae

Browse files
Add regression test for #143107
1 parent 29b75a6 commit 80170ae

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// This test ensures that if an item is inlined from two different `use`,
2+
// then it will use attributes from both of them.
3+
// This is a regression test for <https://github.com/rust-lang/rust/issues/143107>.
4+
5+
#![feature(no_core)]
6+
#![no_core]
7+
#![no_std]
8+
#![crate_name = "foo"]
9+
10+
// First we ensure we only have two items.
11+
//@ has 'foo/index.html'
12+
//@ count - '//dl[@class="item-table"]/dt' 2
13+
// We should also only have one section (Structs).
14+
//@ count - '//h2[@class="section-header"]' 1
15+
16+
//@ has 'foo/struct.Foo.html'
17+
//@ has - '//*[@class="docblock"]' 'Foobar Blob'
18+
19+
//@ has 'foo/struct.Another.html'
20+
//@ has - '//*[@class="docblock"]' 'Tarte Tatin'
21+
22+
mod raw {
23+
/// Blob
24+
pub struct Foo;
25+
26+
/// Tatin
27+
pub struct Another;
28+
}
29+
30+
/// Foobar
31+
pub use raw::Foo;
32+
33+
// Glob reexport attributes are ignored.
34+
/// Baz
35+
pub use raw::*;
36+
37+
/// Tarte
38+
pub use raw::Another as Another;

0 commit comments

Comments
 (0)