diff options
| author | bors <bors@rust-lang.org> | 2018-09-12 21:20:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-09-12 21:20:05 +0000 |
| commit | f2302daef3608c09e2b50193a64611b18ced86f3 (patch) | |
| tree | 587c28333ce12e085b33c5890e70f4303a162c10 /src/test/rustdoc | |
| parent | 06d2448f1fde4005bddd2f349f9dce4c79adce65 (diff) | |
| parent | 86141797dbeb406a6b0a7c6442cc715d3f7bcc75 (diff) | |
| download | rust-f2302daef3608c09e2b50193a64611b18ced86f3.tar.gz rust-f2302daef3608c09e2b50193a64611b18ced86f3.zip | |
Auto merge of #53409 - GuillaumeGomez:associated-const-value, r=QuietMisdreavus
Don't show associated const value anymore Part of #44348. Before: <img width="1440" alt="screen shot 2018-08-16 at 00 48 30" src="https://user-images.githubusercontent.com/3050060/44177414-20ef1480-a0ee-11e8-80d4-7caf082cf0de.png"> After: <img width="1440" alt="screen shot 2018-08-16 at 00 48 23" src="https://user-images.githubusercontent.com/3050060/44177417-251b3200-a0ee-11e8-956a-4229275e3342.png"> cc @nox r? @QuietMisdreavus
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/assoc-consts.rs | 14 | ||||
| -rw-r--r-- | src/test/rustdoc/const-doc.rs | 2 | ||||
| -rw-r--r-- | src/test/rustdoc/escape-rust-expr.rs | 2 | ||||
| -rw-r--r-- | src/test/rustdoc/inline_cross/assoc-items.rs | 5 | ||||
| -rw-r--r-- | src/test/rustdoc/issue-28478.rs | 1 | ||||
| -rw-r--r-- | src/test/rustdoc/issue-33302.rs | 9 |
6 files changed, 4 insertions, 29 deletions
diff --git a/src/test/rustdoc/assoc-consts.rs b/src/test/rustdoc/assoc-consts.rs index 2edf61288f5..71e7db5f4a5 100644 --- a/src/test/rustdoc/assoc-consts.rs +++ b/src/test/rustdoc/assoc-consts.rs @@ -13,7 +13,6 @@ pub trait Foo { // @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \ // 'const FOO: usize;' // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize' - // @has - '//*[@class="docblock"]' 'FOO: usize = 12' const FOO: usize = 12; // @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool' const FOO_NO_DEFAULT: bool; @@ -27,10 +26,8 @@ pub struct Bar; impl Foo for Bar { // @has assoc_consts/struct.Bar.html '//code' 'impl Foo for Bar' // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize' - // @has - '//*[@class="docblock"]' 'FOO: usize = 12' const FOO: usize = 12; // @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool' - // @has - '//*[@class="docblock"]' 'FOO_NO_DEFAULT: bool = false' const FOO_NO_DEFAULT: bool = false; // @!has - FOO_HIDDEN #[doc(hidden)] @@ -40,7 +37,6 @@ impl Foo for Bar { impl Bar { // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \ // 'const BAR: usize' - // @has - '//*[@class="docblock"]' 'BAR: usize = 3' pub const BAR: usize = 3; } @@ -49,7 +45,6 @@ pub struct Baz<'a, U: 'a, T>(T, &'a [U]); impl Bar { // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAZ"]' \ // "const BAZ: Baz<'static, u8, u32>" - // @has - '//*[@class="docblock"]' "BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3])" pub const BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3]); } @@ -58,7 +53,6 @@ pub fn f(_: &(ToString + 'static)) {} impl Bar { // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.F"]' \ // "const F: fn(_: &(ToString + 'static))" - // @has - '//*[@class="docblock"]' "F: fn(_: &(ToString + 'static)) = f" pub const F: fn(_: &(ToString + 'static)) = f; } @@ -81,17 +75,14 @@ pub trait Qux { /// Docs for QUX1 in trait. const QUX1: i8; // @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16' - // @has - '//*[@class="docblock"]' "QUX_DEFAULT0: u16 = 1" // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT0 in trait." /// Docs for QUX_DEFAULT0 in trait. const QUX_DEFAULT0: u16 = 1; // @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16' - // @has - '//*[@class="docblock"]' "QUX_DEFAULT1: i16 = 2" // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in trait." /// Docs for QUX_DEFAULT1 in trait. const QUX_DEFAULT1: i16 = 2; // @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32' - // @has - '//*[@class="docblock"]' "QUX_DEFAULT2: u32 = 3" // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait." /// Docs for QUX_DEFAULT2 in trait. const QUX_DEFAULT2: u32 = 3; @@ -100,25 +91,20 @@ pub trait Qux { // @has assoc_consts/struct.Bar.html '//code' 'impl Qux for Bar' impl Qux for Bar { // @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8' - // @has - '//*[@class="docblock"]' "QUX0: u8 = 4" // @has - '//*[@class="docblock"]' "Docs for QUX0 in trait." /// Docs for QUX0 in trait. const QUX0: u8 = 4; // @has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8' - // @has - '//*[@class="docblock"]' "QUX1: i8 = 5" // @has - '//*[@class="docblock"]' "Docs for QUX1 in impl." /// Docs for QUX1 in impl. const QUX1: i8 = 5; // @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16' - // @has - '//*[@class="docblock"]' "QUX_DEFAULT0: u16 = 6" // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT0 in trait." const QUX_DEFAULT0: u16 = 6; // @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16' - // @has - '//*[@class="docblock"]' "QUX_DEFAULT1: i16 = 7" // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT1 in impl." /// Docs for QUX_DEFAULT1 in impl. const QUX_DEFAULT1: i16 = 7; // @has - '//*[@id="associatedconstant.QUX_DEFAULT2"]' 'const QUX_DEFAULT2: u32' - // @has - '//*[@class="docblock"]' "QUX_DEFAULT2: u32 = 3" // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait." } diff --git a/src/test/rustdoc/const-doc.rs b/src/test/rustdoc/const-doc.rs index 9884e3d2c19..b8bded7621e 100644 --- a/src/test/rustdoc/const-doc.rs +++ b/src/test/rustdoc/const-doc.rs @@ -23,7 +23,7 @@ pub struct ContentType { impl ContentType { // @has const_doc/struct.ContentType.html - // @has - '//*[@class="docblock"]' 'Any: ContentType = ContentType{ttype: Foo{f: ' + // @has - '//*[@id="associatedconstant.Any"]' 'const Any: ContentType' pub const Any: ContentType = ContentType { ttype: Foo { f: PhantomData, }, subtype: Foo { f: PhantomData, }, params: None, }; diff --git a/src/test/rustdoc/escape-rust-expr.rs b/src/test/rustdoc/escape-rust-expr.rs index 7f9a2bf175a..4594eb95ea1 100644 --- a/src/test/rustdoc/escape-rust-expr.rs +++ b/src/test/rustdoc/escape-rust-expr.rs @@ -11,5 +11,5 @@ // Test that we HTML-escape Rust expressions, where HTML special chars // can occur, and we know it's definitely not markup. -// @has escape_rust_expr/constant.CONST_S.html '//pre[@class="rust const"]' '"<script>"' +// @!has escape_rust_expr/constant.CONST_S.html '//pre[@class="rust const"]' '"<script>"' pub const CONST_S: &'static str = "<script>"; diff --git a/src/test/rustdoc/inline_cross/assoc-items.rs b/src/test/rustdoc/inline_cross/assoc-items.rs index 95d936883ff..0885f005d13 100644 --- a/src/test/rustdoc/inline_cross/assoc-items.rs +++ b/src/test/rustdoc/inline_cross/assoc-items.rs @@ -19,16 +19,13 @@ extern crate assoc_items; // @has foo/struct.MyStruct.html // @!has - 'PrivateConst' // @has - '//*[@id="associatedconstant.PublicConst"]' 'pub const PublicConst: u8' -// @has - '//*[@class="docblock"]' 'PublicConst: u8 = 123' // @has - '//*[@class="docblock"]' 'docs for PublicConst' // @!has - 'private_method' // @has - '//*[@id="method.public_method"]' 'pub fn public_method()' // @has - '//*[@class="docblock"]' 'docs for public_method' // @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16' -// @has - '//*[@class="docblock"]' 'ConstNoDefault: i16 = -123' // @has - '//*[@class="docblock"]' 'dox for ConstNoDefault' // @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16' -// @has - '//*[@class="docblock"]' 'ConstWithDefault: u16 = 12345' // @has - '//*[@class="docblock"]' 'docs for ConstWithDefault' // @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault = i32' // @has - '//*[@class="docblock"]' 'dox for TypeNoDefault' @@ -44,11 +41,9 @@ pub use assoc_items::MyStruct; // @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16' // @has - '//*[@class="docblock"]' 'docs for ConstNoDefault' // @has - '//*[@id="associatedconstant.ConstWithDefault"]' 'const ConstWithDefault: u16' -// @has - '//*[@class="docblock"]' 'ConstWithDefault: u16 = 12345' // @has - '//*[@class="docblock"]' 'docs for ConstWithDefault' // @has - '//*[@id="associatedtype.TypeNoDefault"]' 'type TypeNoDefault' // @has - '//*[@class="docblock"]' 'docs for TypeNoDefault' -// @has - '//*[@id="associatedtype.TypeWithDefault"]' 'type TypeWithDefault = u32' // @has - '//*[@class="docblock"]' 'docs for TypeWithDefault' // @has - '//*[@id="tymethod.method_no_default"]' 'fn method_no_default()' // @has - '//*[@class="docblock"]' 'docs for method_no_default' diff --git a/src/test/rustdoc/issue-28478.rs b/src/test/rustdoc/issue-28478.rs index c1141cb031e..cf4ebba4c32 100644 --- a/src/test/rustdoc/issue-28478.rs +++ b/src/test/rustdoc/issue-28478.rs @@ -16,7 +16,6 @@ pub trait Bar { // @has - '//*[@href="#associatedtype.Bar"]' 'Bar' type Bar = (); // @has - '//*[@id="associatedconstant.Baz"]' 'const Baz: usize' - // @has - '//*[@class="docblock"]' 'Baz: usize = 7' // @has - '//*[@href="#associatedconstant.Baz"]' 'Baz' const Baz: usize = 7; // @has - '//*[@id="tymethod.bar"]' 'fn bar' diff --git a/src/test/rustdoc/issue-33302.rs b/src/test/rustdoc/issue-33302.rs index a6ff001b96f..538de228424 100644 --- a/src/test/rustdoc/issue-33302.rs +++ b/src/test/rustdoc/issue-33302.rs @@ -17,10 +17,10 @@ macro_rules! make { pub struct S; // @has issue_33302/constant.CST.html \ - // '//pre[@class="rust const"]' 'pub const CST: i32 = 4 * 4' + // '//pre[@class="rust const"]' 'pub const CST: i32' pub const CST: i32 = ($n * $n); // @has issue_33302/static.ST.html \ - // '//pre[@class="rust static"]' 'pub static ST: i32 = 4 * 4' + // '//pre[@class="rust static"]' 'pub static ST: i32' pub static ST: i32 = ($n * $n); pub trait T<X> { @@ -28,7 +28,6 @@ macro_rules! make { const C: X; // @has issue_33302/trait.T.html \ // '//*[@class="rust trait"]' 'const D: i32' - // @has - '//*[@class="docblock"]' 'D: i32 = 4 * 4' // @has - '//*[@id="associatedconstant.D"]' 'const D: i32' const D: i32 = ($n * $n); } @@ -37,7 +36,6 @@ macro_rules! make { // '//h3[@class="impl"]' 'impl T<[i32; 16]> for S' // @has - '//*[@id="associatedconstant.C"]' 'const C: [i32; 16]' // @has - '//*[@id="associatedconstant.D"]' 'const D: i32' - // @has - '//*[@class="docblock"]' 'C: [i32; 16] = [0; 4 * 4]' impl T<[i32; ($n * $n)]> for S { const C: [i32; ($n * $n)] = [0; ($n * $n)]; } @@ -46,7 +44,6 @@ macro_rules! make { // '//h3[@class="impl"]' 'impl T<[i32; 16]> for S' // @has - '//*[@id="associatedconstant.C-1"]' 'const C: (i32,)' // @has - '//*[@id="associatedconstant.D-1"]' 'const D: i32' - // @has - '//*[@class="docblock"]' 'C: (i32,) = (4,)' impl T<(i32,)> for S { const C: (i32,) = ($n,); } @@ -55,8 +52,6 @@ macro_rules! make { // '//h3[@class="impl"]' 'impl T<(i32, i32)> for S' // @has - '//*[@id="associatedconstant.C-2"]' 'const C: (i32, i32)' // @has - '//*[@id="associatedconstant.D-2"]' 'const D: i32' - // @has - '//*[@class="docblock"]' 'C: (i32, i32) = (4, 4)' - // @has - '//*[@class="docblock"]' 'D: i32 = 4 / 4' impl T<(i32, i32)> for S { const C: (i32, i32) = ($n, $n); const D: i32 = ($n / $n); |
