Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 20a460e

Browse files
committedJan 23, 2021
Fix rendering of stabilization version for trait implementors
1 parent 1129e86 commit 20a460e

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed
 

‎src/librustdoc/html/render/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,7 +2471,7 @@ fn item_function(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, f: &clean::
24712471
fn render_implementor(
24722472
cx: &Context<'_>,
24732473
implementor: &Impl,
2474-
parent: &clean::Item,
2474+
trait_: &clean::Item,
24752475
w: &mut Buffer,
24762476
implementor_dups: &FxHashMap<Symbol, (DefId, bool)>,
24772477
aliases: &[String],
@@ -2491,11 +2491,11 @@ fn render_implementor(
24912491
w,
24922492
cx,
24932493
implementor,
2494-
parent,
2494+
trait_,
24952495
AssocItemLink::Anchor(None),
24962496
RenderMode::Normal,
2497-
implementor.impl_item.stable_since(cx.tcx()).as_deref(),
2498-
implementor.impl_item.const_stable_since(cx.tcx()).as_deref(),
2497+
trait_.stable_since(cx.tcx()).as_deref(),
2498+
trait_.const_stable_since(cx.tcx()).as_deref(),
24992499
false,
25002500
Some(use_absolute),
25012501
false,
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#![crate_name = "foo"]
2+
3+
#![feature(staged_api)]
4+
5+
#[stable(feature = "bar", since = "OLD 1.0")]
6+
pub trait Bar {}
7+
8+
#[stable(feature = "baz", since = "OLD 1.0")]
9+
pub trait Baz {}
10+
11+
pub struct Foo;
12+
13+
// @has foo/trait.Bar.html '//div[@id="implementors-list"]//span[@class="since"]' 'NEW 2.0'
14+
#[stable(feature = "foobar", since = "NEW 2.0")]
15+
impl Bar for Foo {}
16+
17+
// @!has foo/trait.Baz.html '//div[@id="implementors-list"]//span[@class="since"]' 'OLD 1.0'
18+
#[stable(feature = "foobaz", since = "OLD 1.0")]
19+
impl Baz for Foo {}

0 commit comments

Comments
 (0)
Please sign in to comment.