Skip to content

Commit

Permalink
Add regression test for rust-lang#121772
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez authored and Gankra committed Mar 3, 2024
1 parent e0f98b9 commit 3d87abf
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/rustdoc/trait-item-info.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// This is a regression test for <https://github.com/rust-lang/rust/issues/121772>.
// The goal is to ensure that the item information is always part of the `<summary>`
// if there is one.

#![crate_name = "foo"]
#![feature(staged_api)]

#![unstable(feature = "test", issue = "none")]

// @has 'foo/trait.Foo.html'

#[stable(feature = "rust2", since = "2.2.2")]
pub trait Foo {
// @has - '//div[@class="methods"]/span[@class="item-info"]' 'bla'
// Should not be in a `<details>` because there is no doc.
#[unstable(feature = "bla", reason = "bla", issue = "111")]
fn bla() {}

// @has - '//details[@class="toggle method-toggle"]/summary/span[@class="item-info"]' 'bar'
// Should have a `<summary>` in the `<details>` containing the unstable info.
/// doc
#[unstable(feature = "bar", reason = "bla", issue = "222")]
fn bar() {}
}

0 comments on commit 3d87abf

Please sign in to comment.