Skip to content

Commit b0ee5de

Browse files
Update tests
1 parent a545944 commit b0ee5de

File tree

5 files changed

+1
-26
lines changed

5 files changed

+1
-26
lines changed

src/test/rustdoc/assoc-consts.rs

-14
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub trait Foo {
1313
// @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \
1414
// 'const FOO: usize;'
1515
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
16-
// @has - '//*[@class="docblock"]' 'FOO: usize = 12'
1716
const FOO: usize = 12;
1817
// @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
1918
const FOO_NO_DEFAULT: bool;
@@ -27,10 +26,8 @@ pub struct Bar;
2726
impl Foo for Bar {
2827
// @has assoc_consts/struct.Bar.html '//code' 'impl Foo for Bar'
2928
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
30-
// @has - '//*[@class="docblock"]' 'FOO: usize = 12'
3129
const FOO: usize = 12;
3230
// @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
33-
// @has - '//*[@class="docblock"]' 'FOO_NO_DEFAULT: bool = false'
3431
const FOO_NO_DEFAULT: bool = false;
3532
// @!has - FOO_HIDDEN
3633
#[doc(hidden)]
@@ -40,7 +37,6 @@ impl Foo for Bar {
4037
impl Bar {
4138
// @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \
4239
// 'const BAR: usize'
43-
// @has - '//*[@class="docblock"]' 'BAR: usize = 3'
4440
pub const BAR: usize = 3;
4541
}
4642

@@ -49,7 +45,6 @@ pub struct Baz<'a, U: 'a, T>(T, &'a [U]);
4945
impl Bar {
5046
// @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAZ"]' \
5147
// "const BAZ: Baz<'static, u8, u32>"
52-
// @has - '//*[@class="docblock"]' "BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3])"
5348
pub const BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3]);
5449
}
5550

@@ -58,7 +53,6 @@ pub fn f(_: &(ToString + 'static)) {}
5853
impl Bar {
5954
// @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.F"]' \
6055
// "const F: fn(_: &(ToString + 'static))"
61-
// @has - '//*[@class="docblock"]' "F: fn(_: &(ToString + 'static)) = f"
6256
pub const F: fn(_: &(ToString + 'static)) = f;
6357
}
6458

@@ -81,17 +75,14 @@ pub trait Qux {
8175
/// Docs for QUX1 in trait.
8276
const QUX1: i8;
8377
// @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16'
84-
// @has - '//*[@class="docblock"]' "QUX_DEFAULT0: u16 = 1"
8578
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT0 in trait."
8679
/// Docs for QUX_DEFAULT0 in trait.
8780
const QUX_DEFAULT0: u16 = 1;
8881
// @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16'
89-
// @has - '//*[@class="docblock"]' "QUX_DEFAULT1: i16 = 2"
9082
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in trait."
9183
/// Docs for QUX_DEFAULT1 in trait.
9284
const QUX_DEFAULT1: i16 = 2;
9385
// @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32'
94-
// @has - '//*[@class="docblock"]' "QUX_DEFAULT2: u32 = 3"
9586
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait."
9687
/// Docs for QUX_DEFAULT2 in trait.
9788
const QUX_DEFAULT2: u32 = 3;
@@ -100,25 +91,20 @@ pub trait Qux {
10091
// @has assoc_consts/struct.Bar.html '//code' 'impl Qux for Bar'
10192
impl Qux for Bar {
10293
// @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8'
103-
// @has - '//*[@class="docblock"]' "QUX0: u8 = 4"
10494
// @has - '//*[@class="docblock"]' "Docs for QUX0 in trait."
10595
/// Docs for QUX0 in trait.
10696
const QUX0: u8 = 4;
10797
// @has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8'
108-
// @has - '//*[@class="docblock"]' "QUX1: i8 = 5"
10998
// @has - '//*[@class="docblock"]' "Docs for QUX1 in impl."
11099
/// Docs for QUX1 in impl.
111100
const QUX1: i8 = 5;
112101
// @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16'
113-
// @has - '//*[@class="docblock"]' "QUX_DEFAULT0: u16 = 6"
114102
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT0 in trait."
115103
const QUX_DEFAULT0: u16 = 6;
116104
// @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16'
117-
// @has - '//*[@class="docblock"]' "QUX_DEFAULT1: i16 = 7"
118105
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in impl."
119106
/// Docs for QUX_DEFAULT1 in impl.
120107
const QUX_DEFAULT1: i16 = 7;
121108
// @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32'
122-
// @has - '//*[@class="docblock"]' "QUX_DEFAULT2: u32 = 3"
123109
// @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait."
124110
}

src/test/rustdoc/const-doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct ContentType {
2323

2424
impl ContentType {
2525
// @has const_doc/struct.ContentType.html
26-
// @has - '//*[@class="docblock"]' 'Any: ContentType = ContentType{ttype: Foo{f: '
26+
// @has - '//*[@id="associatedconstant.Any"]' 'const Any: ContentType'
2727
pub const Any: ContentType = ContentType { ttype: Foo { f: PhantomData, },
2828
subtype: Foo { f: PhantomData, },
2929
params: None, };

src/test/rustdoc/inline_cross/assoc-items.rs

-5
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,13 @@ extern crate assoc_items;
1919
// @has foo/struct.MyStruct.html
2020
// @!has - 'PrivateConst'
2121
// @has - '//*[@id="associatedconstant.PublicConst"]' 'pub const PublicConst: u8'
22-
// @has - '//*[@class="docblock"]' 'PublicConst: u8 = 123'
2322
// @has - '//*[@class="docblock"]' 'docs for PublicConst'
2423
// @!has - 'private_method'
2524
// @has - '//*[@id="method.public_method"]' 'pub fn public_method()'
2625
// @has - '//*[@class="docblock"]' 'docs for public_method'
2726
// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16'
28-
// @has - '//*[@class="docblock"]' 'ConstNoDefault: i16 = -123'
2927
// @has - '//*[@class="docblock"]' 'dox for ConstNoDefault'
3028
// @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16'
31-
// @has - '//*[@class="docblock"]' 'ConstWithDefault: u16 = 12345'
3229
// @has - '//*[@class="docblock"]' 'docs for ConstWithDefault'
3330
// @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault = i32'
3431
// @has - '//*[@class="docblock"]' 'dox for TypeNoDefault'
@@ -44,11 +41,9 @@ pub use assoc_items::MyStruct;
4441
// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16'
4542
// @has - '//*[@class="docblock"]' 'docs for ConstNoDefault'
4643
// @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16'
47-
// @has - '//*[@class="docblock"]' 'ConstWithDefault: u16 = 12345'
4844
// @has - '//*[@class="docblock"]' 'docs for ConstWithDefault'
4945
// @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault'
5046
// @has - '//*[@class="docblock"]' 'docs for TypeNoDefault'
51-
// @has - '//*[@id="associatedtype.TypeWithDefault"]' 'type TypeWithDefault = u32'
5247
// @has - '//*[@class="docblock"]' 'docs for TypeWithDefault'
5348
// @has - '//*[@id="tymethod.method_no_default"]' 'fn method_no_default()'
5449
// @has - '//*[@class="docblock"]' 'docs for method_no_default'

src/test/rustdoc/issue-28478.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub trait Bar {
1616
// @has - '//*[@href="#associatedtype.Bar"]' 'Bar'
1717
type Bar = ();
1818
// @has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize'
19-
// @has - '//*[@class="docblock"]' 'Baz: usize = 7'
2019
// @has - '//*[@href="#associatedconstant.Baz"]' 'Baz'
2120
const Baz: usize = 7;
2221
// @has - '//*[@id="tymethod.bar"]' 'fn bar'

src/test/rustdoc/issue-33302.rs

-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ macro_rules! make {
2828
const C: X;
2929
// @has issue_33302/trait.T.html \
3030
// '//*[@class="rust trait"]' 'const D: i32'
31-
// @has - '//*[@class="docblock"]' 'D: i32 = 4 * 4'
3231
// @has - '//*[@id="associatedconstant.D"]' 'const D: i32'
3332
const D: i32 = ($n * $n);
3433
}
@@ -37,7 +36,6 @@ macro_rules! make {
3736
// '//h3[@class="impl"]' 'impl T<[i32; 16]> for S'
3837
// @has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16]'
3938
// @has - '//*[@id="associatedconstant.D"]' 'const D: i32'
40-
// @has - '//*[@class="docblock"]' 'C: [i32; 16] = [0; 4 * 4]'
4139
impl T<[i32; ($n * $n)]> for S {
4240
const C: [i32; ($n * $n)] = [0; ($n * $n)];
4341
}
@@ -46,7 +44,6 @@ macro_rules! make {
4644
// '//h3[@class="impl"]' 'impl T<[i32; 16]> for S'
4745
// @has - '//*[@id="associatedconstant.C-1"]' 'const C: (i32,)'
4846
// @has - '//*[@id="associatedconstant.D-1"]' 'const D: i32'
49-
// @has - '//*[@class="docblock"]' 'C: (i32,) = (4,)'
5047
impl T<(i32,)> for S {
5148
const C: (i32,) = ($n,);
5249
}
@@ -55,8 +52,6 @@ macro_rules! make {
5552
// '//h3[@class="impl"]' 'impl T<(i32, i32)> for S'
5653
// @has - '//*[@id="associatedconstant.C-2"]' 'const C: (i32, i32)'
5754
// @has - '//*[@id="associatedconstant.D-2"]' 'const D: i32'
58-
// @has - '//*[@class="docblock"]' 'C: (i32, i32) = (4, 4)'
59-
// @has - '//*[@class="docblock"]' 'D: i32 = 4 / 4'
6055
impl T<(i32, i32)> for S {
6156
const C: (i32, i32) = ($n, $n);
6257
const D: i32 = ($n / $n);

0 commit comments

Comments
 (0)