forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#121855 - GuillaumeGomez:trait-item-info, r=notriddle Correctly generate item info of trait items Fixes rust-lang#121772. The `document_info` function was wrongly used when documenting a trait item. r? `@notriddle`
- Loading branch information
Showing
3 changed files
with
38 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} | ||
} |