diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
commit | 4f9fe856a25ab29345b90e7725509e9ee38a37be (patch) | |
tree | e4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /tests/rustdoc/const-generics | |
parent | Adding upstream version 1.68.2+dfsg1. (diff) | |
download | rustc-upstream/1.69.0+dfsg1.tar.xz rustc-upstream/1.69.0+dfsg1.zip |
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/rustdoc/const-generics/add-impl.rs | 2 | ||||
-rw-r--r-- | tests/rustdoc/const-generics/const-generic-defaults.rs | 2 | ||||
-rw-r--r-- | tests/rustdoc/const-generics/const-generic-slice.rs | 2 | ||||
-rw-r--r-- | tests/rustdoc/const-generics/const-generics-docs.rs | 44 | ||||
-rw-r--r-- | tests/rustdoc/const-generics/const-impl.rs | 12 | ||||
-rw-r--r-- | tests/rustdoc/const-generics/generic_const_exprs.rs | 2 | ||||
-rw-r--r-- | tests/rustdoc/const-generics/type-alias.rs | 2 |
7 files changed, 33 insertions, 33 deletions
diff --git a/tests/rustdoc/const-generics/add-impl.rs b/tests/rustdoc/const-generics/add-impl.rs index b5226ad3f..195e47bc8 100644 --- a/tests/rustdoc/const-generics/add-impl.rs +++ b/tests/rustdoc/const-generics/add-impl.rs @@ -2,7 +2,7 @@ use std::ops::Add; -// @has foo/struct.Simd.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub struct Simd<T, const WIDTH: usize>' +// @has foo/struct.Simd.html '//pre[@class="rust item-decl"]' 'pub struct Simd<T, const WIDTH: usize>' pub struct Simd<T, const WIDTH: usize> { inner: T, } diff --git a/tests/rustdoc/const-generics/const-generic-defaults.rs b/tests/rustdoc/const-generics/const-generic-defaults.rs index acc3b853e..f781c6a62 100644 --- a/tests/rustdoc/const-generics/const-generic-defaults.rs +++ b/tests/rustdoc/const-generics/const-generic-defaults.rs @@ -1,5 +1,5 @@ #![crate_name = "foo"] -// @has foo/struct.Foo.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/struct.Foo.html '//pre[@class="rust item-decl"]' \ // 'pub struct Foo<const M: usize = 10, const N: usize = M, T = i32>(_);' pub struct Foo<const M: usize = 10, const N: usize = M, T = i32>(T); diff --git a/tests/rustdoc/const-generics/const-generic-slice.rs b/tests/rustdoc/const-generics/const-generic-slice.rs index 4279de91f..80a9ab3f1 100644 --- a/tests/rustdoc/const-generics/const-generic-slice.rs +++ b/tests/rustdoc/const-generics/const-generic-slice.rs @@ -5,7 +5,7 @@ pub trait Array { } // @has foo/trait.Array.html -// @has - '//*[@class="impl has-srclink"]' 'impl<T, const N: usize> Array for [T; N]' +// @has - '//*[@class="impl"]' 'impl<T, const N: usize> Array for [T; N]' impl<T, const N: usize> Array for [T; N] { type Item = T; } diff --git a/tests/rustdoc/const-generics/const-generics-docs.rs b/tests/rustdoc/const-generics/const-generics-docs.rs index 543332d2c..828486a41 100644 --- a/tests/rustdoc/const-generics/const-generics-docs.rs +++ b/tests/rustdoc/const-generics/const-generics-docs.rs @@ -3,26 +3,26 @@ #![crate_name = "foo"] extern crate extern_crate; -// @has foo/fn.extern_fn.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/fn.extern_fn.html '//pre[@class="rust item-decl"]' \ // 'pub fn extern_fn<const N: usize>() -> impl Iterator<Item = [u8; N]>' pub use extern_crate::extern_fn; -// @has foo/struct.ExternTy.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/struct.ExternTy.html '//pre[@class="rust item-decl"]' \ // 'pub struct ExternTy<const N: usize> {' pub use extern_crate::ExternTy; -// @has foo/type.TyAlias.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/type.TyAlias.html '//pre[@class="rust item-decl"]' \ // 'type TyAlias<const N: usize> = ExternTy<N>;' pub use extern_crate::TyAlias; -// @has foo/trait.WTrait.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/trait.WTrait.html '//pre[@class="rust item-decl"]' \ // 'pub trait WTrait<const N: usize, const M: usize>' -// @has - '//div[@class="item-decl"]/pre[@class="rust"]' 'fn hey<const P: usize>() -> usize' +// @has - '//pre[@class="rust item-decl"]' 'fn hey<const P: usize>() -> usize' pub use extern_crate::WTrait; -// @has foo/trait.Trait.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/trait.Trait.html '//pre[@class="rust item-decl"]' \ // 'pub trait Trait<const N: usize>' // @has - '//*[@id="impl-Trait%3C1%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<1> for u8' // @has - '//*[@id="impl-Trait%3C2%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<2> for u8' -// @has - '//*[@id="impl-Trait%3C{1%20+%202}%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<{1 + 2}> for u8' -// @has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8%3B%20N%5D"]//h3[@class="code-header"]' \ +// @has - '//*[@id="impl-Trait%3C%7B1+%2B+2%7D%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<{1 + 2}> for u8' +// @has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8;+N%5D"]//h3[@class="code-header"]' \ // 'impl<const N: usize> Trait<N> for [u8; N]' pub trait Trait<const N: usize> {} impl Trait<1> for u8 {} @@ -30,10 +30,10 @@ impl Trait<2> for u8 {} impl Trait<{1 + 2}> for u8 {} impl<const N: usize> Trait<N> for [u8; N] {} -// @has foo/struct.Foo.html '//div[@class="item-decl"]/pre[@class="rust"]' \ -// 'pub struct Foo<const N: usize>where u8: Trait<N>' +// @has foo/struct.Foo.html '//pre[@class="rust item-decl"]' \ +// 'pub struct Foo<const N: usize> where u8: Trait<N>' pub struct Foo<const N: usize> where u8: Trait<N>; -// @has foo/struct.Bar.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub struct Bar<T, const N: usize>(_)' +// @has foo/struct.Bar.html '//pre[@class="rust item-decl"]' 'pub struct Bar<T, const N: usize>(_)' pub struct Bar<T, const N: usize>([T; N]); // @has foo/struct.Foo.html '//*[@id="impl-Foo%3CM%3E"]/h3[@class="code-header"]' 'impl<const M: usize> Foo<M>where u8: Trait<M>' @@ -47,7 +47,7 @@ impl<const M: usize> Foo<M> where u8: Trait<M> { } } -// @has foo/struct.Bar.html '//*[@id="impl-Bar%3Cu8%2C%20M%3E"]/h3[@class="code-header"]' 'impl<const M: usize> Bar<u8, M>' +// @has foo/struct.Bar.html '//*[@id="impl-Bar%3Cu8,+M%3E"]/h3[@class="code-header"]' 'impl<const M: usize> Bar<u8, M>' impl<const M: usize> Bar<u8, M> { // @has - '//*[@id="method.hey"]' \ // 'pub fn hey<const N: usize>(&self) -> Foo<N>where u8: Trait<N>' @@ -56,32 +56,32 @@ impl<const M: usize> Bar<u8, M> { } } -// @has foo/fn.test.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/fn.test.html '//pre[@class="rust item-decl"]' \ // 'pub fn test<const N: usize>() -> impl Trait<N>where u8: Trait<N>' pub fn test<const N: usize>() -> impl Trait<N> where u8: Trait<N> { 2u8 } -// @has foo/fn.a_sink.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/fn.a_sink.html '//pre[@class="rust item-decl"]' \ // 'pub async fn a_sink<const N: usize>(v: [u8; N]) -> impl Trait<N>' pub async fn a_sink<const N: usize>(v: [u8; N]) -> impl Trait<N> { v } -// @has foo/fn.b_sink.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/fn.b_sink.html '//pre[@class="rust item-decl"]' \ // 'pub async fn b_sink<const N: usize>(_: impl Trait<N>)' pub async fn b_sink<const N: usize>(_: impl Trait<N>) {} -// @has foo/fn.concrete.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/fn.concrete.html '//pre[@class="rust item-decl"]' \ // 'pub fn concrete() -> [u8; 22]' pub fn concrete() -> [u8; 3 + std::mem::size_of::<u64>() << 1] { Default::default() } -// @has foo/type.Faz.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/type.Faz.html '//pre[@class="rust item-decl"]' \ // 'type Faz<const N: usize> = [u8; N];' pub type Faz<const N: usize> = [u8; N]; -// @has foo/type.Fiz.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/type.Fiz.html '//pre[@class="rust item-decl"]' \ // 'type Fiz<const N: usize> = [[u8; N]; 48];' pub type Fiz<const N: usize> = [[u8; N]; 3 << 4]; @@ -91,7 +91,7 @@ macro_rules! define_me { } } -// @has foo/struct.Foz.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/struct.Foz.html '//pre[@class="rust item-decl"]' \ // 'pub struct Foz<const N: usize>(_);' define_me!(Foz<N>); @@ -103,13 +103,13 @@ impl<const N: usize> Q for [u8; N] { const ASSOC: usize = N; } -// @has foo/fn.q_user.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/fn.q_user.html '//pre[@class="rust item-decl"]' \ // 'pub fn q_user() -> [u8; 13]' pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] { [0; <[u8; 13] as Q>::ASSOC] } -// @has foo/union.Union.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/union.Union.html '//pre[@class="rust item-decl"]' \ // 'pub union Union<const N: usize>' pub union Union<const N: usize> { // @has - //pre "pub arr: [u8; N]" @@ -118,7 +118,7 @@ pub union Union<const N: usize> { pub another_arr: [(); N], } -// @has foo/enum.Enum.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/enum.Enum.html '//pre[@class="rust item-decl"]' \ // 'pub enum Enum<const N: usize>' pub enum Enum<const N: usize> { // @has - //pre "Variant([u8; N])" diff --git a/tests/rustdoc/const-generics/const-impl.rs b/tests/rustdoc/const-generics/const-impl.rs index 726fb8f0c..152b643bf 100644 --- a/tests/rustdoc/const-generics/const-impl.rs +++ b/tests/rustdoc/const-generics/const-impl.rs @@ -8,21 +8,21 @@ pub enum Order { Unsorted, } -// @has foo/struct.VSet.html '//div[@class="item-decl"]/pre[@class="rust"]' 'pub struct VSet<T, const ORDER: Order>' -// @has foo/struct.VSet.html '//*[@id="impl-Send-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>' -// @has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>' +// @has foo/struct.VSet.html '//pre[@class="rust item-decl"]' 'pub struct VSet<T, const ORDER: Order>' +// @has foo/struct.VSet.html '//*[@id="impl-Send-for-VSet%3CT,+ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>' +// @has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT,+ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>' pub struct VSet<T, const ORDER: Order> { inner: Vec<T>, } -// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT%2C%20{%20Order%3A%3ASorted%20}%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Sorted }>' +// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT,+%7B+Order::Sorted+%7D%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Sorted }>' impl<T> VSet<T, { Order::Sorted }> { pub fn new() -> Self { Self { inner: Vec::new() } } } -// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT%2C%20{%20Order%3A%3AUnsorted%20}%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Unsorted }>' +// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT,+%7B+Order::Unsorted+%7D%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Unsorted }>' impl<T> VSet<T, { Order::Unsorted }> { pub fn new() -> Self { Self { inner: Vec::new() } @@ -31,7 +31,7 @@ impl<T> VSet<T, { Order::Unsorted }> { pub struct Escape<const S: &'static str>; -// @has foo/struct.Escape.html '//*[@id="impl-Escape%3Cr#%22%3Cscript%3Ealert(%22Escape%22)%3B%3C/script%3E%22#%3E"]/h3[@class="code-header"]' 'impl Escape<r#"<script>alert("Escape");</script>"#>' +// @has foo/struct.Escape.html '//*[@id="impl-Escape%3Cr%23%22%3Cscript%3Ealert(%22Escape%22);%3C/script%3E%22%23%3E"]/h3[@class="code-header"]' 'impl Escape<r#"<script>alert("Escape");</script>"#>' impl Escape<r#"<script>alert("Escape");</script>"#> { pub fn f() {} } diff --git a/tests/rustdoc/const-generics/generic_const_exprs.rs b/tests/rustdoc/const-generics/generic_const_exprs.rs index c53cf6dcd..e23b3006d 100644 --- a/tests/rustdoc/const-generics/generic_const_exprs.rs +++ b/tests/rustdoc/const-generics/generic_const_exprs.rs @@ -2,6 +2,6 @@ #![feature(generic_const_exprs)] #![allow(incomplete_features)] // make sure that `ConstEvaluatable` predicates dont cause rustdoc to ICE #77647 -// @has foo/struct.Ice.html '//div[@class="item-decl"]/pre[@class="rust"]' \ +// @has foo/struct.Ice.html '//pre[@class="rust item-decl"]' \ // 'pub struct Ice<const N: usize>;' pub struct Ice<const N: usize> where [(); N + 1]:; diff --git a/tests/rustdoc/const-generics/type-alias.rs b/tests/rustdoc/const-generics/type-alias.rs index 72473a112..4b93e72d2 100644 --- a/tests/rustdoc/const-generics/type-alias.rs +++ b/tests/rustdoc/const-generics/type-alias.rs @@ -1,4 +1,4 @@ #![crate_name = "foo"] -// @has foo/type.CellIndex.html '//div[@class="item-decl"]/pre[@class="rust"]' 'type CellIndex<const D: usize> = [i64; D];' +// @has foo/type.CellIndex.html '//pre[@class="rust item-decl"]' 'type CellIndex<const D: usize> = [i64; D];' pub type CellIndex<const D: usize> = [i64; D]; |