diff options
| author | Jonas Schievink <jonasschievink@gmail.com> | 2021-01-24 22:10:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-24 22:10:04 +0100 |
| commit | ee4461a996dba7a1c7064fdc04934e9b7f01f7f3 (patch) | |
| tree | bc42be3d2993c685d696c2120e6619ef23985b81 /src/test/rustdoc | |
| parent | 9089dd2248c2bdca89140f6af514b5fcbb1b97da (diff) | |
| parent | 20a460e1cf23262b46a7e9672a02c5f07b91eff5 (diff) | |
| download | rust-ee4461a996dba7a1c7064fdc04934e9b7f01f7f3.tar.gz rust-ee4461a996dba7a1c7064fdc04934e9b7f01f7f3.zip | |
Rollup merge of #81302 - LeSeulArtichaut:80777-trait-render, r=jyn514
Fix rendering of stabilization version for trait implementors Rustdoc compares an item's stabilization version with its parent's to not render it if they are the same. Here, the implementor was compared with itself, resulting in the stabilization version never getting shown. This probably needs a test. Fixes #80777. r? `@jyn514`
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/implementor-stable-version.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/rustdoc/implementor-stable-version.rs b/src/test/rustdoc/implementor-stable-version.rs new file mode 100644 index 00000000000..0a065d8095b --- /dev/null +++ b/src/test/rustdoc/implementor-stable-version.rs @@ -0,0 +1,19 @@ +#![crate_name = "foo"] + +#![feature(staged_api)] + +#[stable(feature = "bar", since = "OLD 1.0")] +pub trait Bar {} + +#[stable(feature = "baz", since = "OLD 1.0")] +pub trait Baz {} + +pub struct Foo; + +// @has foo/trait.Bar.html '//div[@id="implementors-list"]//span[@class="since"]' 'NEW 2.0' +#[stable(feature = "foobar", since = "NEW 2.0")] +impl Bar for Foo {} + +// @!has foo/trait.Baz.html '//div[@id="implementors-list"]//span[@class="since"]' 'OLD 1.0' +#[stable(feature = "foobaz", since = "OLD 1.0")] +impl Baz for Foo {} |
