From a333572970ed62701fd57f902d57a0a0aca0dd86 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 29 Nov 2023 12:10:16 +0100 Subject: [PATCH] Update rustdoc tests for stability display --- tests/rustdoc/const-display.rs | 4 ++-- tests/rustdoc/deref/deref-const-fn.rs | 2 +- tests/rustdoc/ensure-src-link.rs | 2 +- tests/rustdoc/implementor-stable-version.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/rustdoc/const-display.rs b/tests/rustdoc/const-display.rs index 594501b22b1..c8967f426f0 100644 --- a/tests/rustdoc/const-display.rs +++ b/tests/rustdoc/const-display.rs @@ -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 } diff --git a/tests/rustdoc/deref/deref-const-fn.rs b/tests/rustdoc/deref/deref-const-fn.rs index 8ecca6d12d2..85c2f2934e0 100644 --- a/tests/rustdoc/deref/deref-const-fn.rs +++ b/tests/rustdoc/deref/deref-const-fn.rs @@ -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 { diff --git a/tests/rustdoc/ensure-src-link.rs b/tests/rustdoc/ensure-src-link.rs index f99c4c4d988..f95b5f2d424 100644 --- a/tests/rustdoc/ensure-src-link.rs +++ b/tests/rustdoc/ensure-src-link.rs @@ -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; diff --git a/tests/rustdoc/implementor-stable-version.rs b/tests/rustdoc/implementor-stable-version.rs index 9c5b9b7e303..3674b9f2e48 100644 --- a/tests/rustdoc/implementor-stable-version.rs +++ b/tests/rustdoc/implementor-stable-version.rs @@ -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 {}