Skip to content

Commit

Permalink
Update rustdoc tests for stability display
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 29, 2023
1 parent 00779af commit a333572
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/rustdoc/const-display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ impl Foo {
pub struct Bar;

impl Bar {
// Do not show non-const stabilities that are the same as the enclosing item.
// @matches 'foo/struct.Bar.html' '//span[@class="since"]' '^const: 1.2.0$'
// Show non-const stabilities that are the same as the enclosing item.
// @has 'foo/struct.Bar.html' '//span[@class="since"]' '1.0.0 (const: 1.2.0)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const2", since = "1.2.0")]
pub const fn stable_impl() -> u32 { 42 }
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc/deref/deref-const-fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct Foo {

// @has 'foo/struct.Foo.html'
// @has - '//*[@id="method.len"]' 'pub fn len(&self) -> usize'
// @!has - '//*[@id="method.len"]//span[@class="since"]' '1.0.0'
// @has - '//*[@id="method.len"]//span[@class="since"]' '1.0.0'
// @!has - '//*[@id="method.len"]//span[@class="since"]' '(const: 1.0.0)'
#[stable(feature = "rust1", since = "1.0.0")]
impl std::ops::Deref for Foo {
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc/ensure-src-link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

// This test ensures that the [src] link is present on traits items.

// @has foo/trait.Iterator.html '//*[@id="method.zip"]//a[@class="src rightside"]' "source"
// @has foo/trait.Iterator.html '//*[@id="method.zip"]//a[@class="src"]' "source"
pub use std::iter::Iterator;
2 changes: 1 addition & 1 deletion tests/rustdoc/implementor-stable-version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ pub struct Foo;
#[stable(feature = "foobar", since = "4.4.4")]
impl Bar for Foo {}

// @!has foo/trait.Baz.html '//div[@id="implementors-list"]//span[@class="since"]' '3.3.3'
// @has foo/trait.Baz.html '//div[@id="implementors-list"]//span[@class="since"]' '3.3.3'
#[stable(feature = "foobaz", since = "3.3.3")]
impl Baz for Foo {}

0 comments on commit a333572

Please sign in to comment.