Skip to content

Commit b119189

Browse files
Add regression test for #121772
1 parent bc26199 commit b119189

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/rustdoc/trait-item-info.rs

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// This is a regression test for <https://github.com/rust-lang/rust/issues/121772>.
2+
// The goal is to ensure that the item information is always part of the `<summary>`
3+
// if there is one.
4+
5+
#![crate_name = "foo"]
6+
#![feature(staged_api)]
7+
8+
#![unstable(feature = "test", issue = "none")]
9+
10+
// @has 'foo/trait.Foo.html'
11+
12+
#[stable(feature = "rust2", since = "2.2.2")]
13+
pub trait Foo {
14+
// @has - '//div[@class="methods"]/span[@class="item-info"]' 'bla'
15+
// Should not be in a `<details>` because there is no doc.
16+
#[unstable(feature = "bla", reason = "bla", issue = "111")]
17+
fn bla() {}
18+
19+
// @has - '//details[@class="toggle method-toggle"]/summary/span[@class="item-info"]' 'bar'
20+
// Should have a `<summary>` in the `<details>` containing the unstable info.
21+
/// doc
22+
#[unstable(feature = "bar", reason = "bla", issue = "222")]
23+
fn bar() {}
24+
}

0 commit comments

Comments
 (0)