about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-20 19:10:11 +0000
committerbors <bors@rust-lang.org>2022-09-20 19:10:11 +0000
commit432abd86f231c908f6df3cdd779e83f35084be90 (patch)
treec29cc2538d936d0746c5b28c474ce005d1f00fb0 /src/test
parentcd8cc91045281f7f1924ecc101f2c6002f6a1eee (diff)
parent25f5483f581a56fa6186ed7e986b0a5d80ba896b (diff)
downloadrust-432abd86f231c908f6df3cdd779e83f35084be90.tar.gz
rust-432abd86f231c908f6df3cdd779e83f35084be90.zip
Auto merge of #102061 - notriddle:rollup-kwu9vp8, r=notriddle
Rollup of 12 pull requests

Successful merges:

 - #100250 (Manually cleanup token stream when macro expansion aborts.)
 - #101014 (Fix -Zmeta-stats ICE by giving `FileEncoder` file read permissions)
 - #101958 (Improve error for when query is unsupported by crate)
 - #101976 (MirPhase: clarify that linting is not a semantic change)
 - #102001 (Use LLVM C-API to build atomic cmpxchg and fence)
 - #102008 (Add GUI test for notable traits element position)
 - #102013 (Simplify rpitit handling on lower_fn_decl)
 - #102021 (some post-valtree cleanup)
 - #102027 (rustdoc: remove `docblock` class from `item-decl`)
 - #102034 (rustdoc: remove no-op CSS `h1-6 { border-bottom-color }`)
 - #102038 (Make the `normalize-overflow` rustdoc test actually do something)
 - #102053 (:arrow_up: rust-analyzer)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-gui/check-code-blocks-margin.goml4
-rw-r--r--src/test/rustdoc-gui/docblock-details.goml2
-rw-r--r--src/test/rustdoc-gui/font-weight.goml8
-rw-r--r--src/test/rustdoc-gui/headings.goml24
-rw-r--r--src/test/rustdoc-gui/item-info-overflow.goml2
-rw-r--r--src/test/rustdoc-gui/notable-trait.goml91
-rw-r--r--src/test/rustdoc-gui/src/test_docs/lib.rs12
-rw-r--r--src/test/rustdoc-ui/normalize-overflow.rs2
-rw-r--r--src/test/rustdoc/attribute-rendering.rs2
-rw-r--r--src/test/rustdoc/attributes.rs2
-rw-r--r--src/test/rustdoc/const-value-display.rs4
-rw-r--r--src/test/rustdoc/decl-trailing-whitespace.rs2
-rw-r--r--src/test/rustdoc/macro-higher-kinded-function.rs4
-rw-r--r--src/test/rustdoc/reexport-dep-foreign-fn.rs2
-rw-r--r--src/test/rustdoc/reexports-priv.rs32
-rw-r--r--src/test/rustdoc/reexports.rs16
-rw-r--r--src/test/rustdoc/toggle-item-contents.rs2
-rw-r--r--src/test/rustdoc/trait_alias.rs6
-rw-r--r--src/test/rustdoc/where.SWhere_Simd_item-decl.html2
-rw-r--r--src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html4
-rw-r--r--src/test/rustdoc/where.rs4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.enum.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.enum2.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.rs16
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.struct.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.struct2.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.trait.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.trait2.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.union.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.union2.html4
-rw-r--r--src/test/ui/macros/syntax-error-recovery.rs18
-rw-r--r--src/test/ui/macros/syntax-error-recovery.stderr30
32 files changed, 238 insertions, 85 deletions
diff --git a/src/test/rustdoc-gui/check-code-blocks-margin.goml b/src/test/rustdoc-gui/check-code-blocks-margin.goml
index f6266eba75d..f2fc3e9afc2 100644
--- a/src/test/rustdoc-gui/check-code-blocks-margin.goml
+++ b/src/test/rustdoc-gui/check-code-blocks-margin.goml
@@ -1,6 +1,6 @@
 // This test ensures that the docblock elements have the appropriate left margin.
 goto: file://|DOC_PATH|/test_docs/fn.foo.html
 // The top docblock elements shouldn't have left margin...
-assert-css: ("#main-content .docblock.item-decl", {"margin-left": "0px"})
+assert-css: ("#main-content .item-decl", {"margin-left": "0px"})
 // ... but all the others should!
-assert-css: ("#main-content .docblock:not(.item-decl)", {"margin-left": "24px"})
+assert-css: ("#main-content .docblock", {"margin-left": "24px"})
diff --git a/src/test/rustdoc-gui/docblock-details.goml b/src/test/rustdoc-gui/docblock-details.goml
index f6287ade2f2..c0c4d1b43aa 100644
--- a/src/test/rustdoc-gui/docblock-details.goml
+++ b/src/test/rustdoc-gui/docblock-details.goml
@@ -14,7 +14,7 @@ assert-css: (
 // We now check that the `<summary>` doesn't have a bottom border and has the correct display.
 assert-css: (
     ".top-doc .docblock summary h4",
-    {"border-bottom": "0px none rgb(210, 210, 210)"},
+    {"border-bottom-width": "0px"},
 )
 // This allows to ensure that summary is on one line only!
 assert-property: (".top-doc .docblock summary h4", {"offsetHeight": "33"})
diff --git a/src/test/rustdoc-gui/font-weight.goml b/src/test/rustdoc-gui/font-weight.goml
index 5f29fde6689..13e8ec9fb16 100644
--- a/src/test/rustdoc-gui/font-weight.goml
+++ b/src/test/rustdoc-gui/font-weight.goml
@@ -1,6 +1,6 @@
 // This test checks that the font weight is correctly applied.
 goto: file://|DOC_PATH|/lib2/struct.Foo.html
-assert-css: ("//*[@class='docblock item-decl']//a[text()='Alias']", {"font-weight": "400"})
+assert-css: ("//*[@class='item-decl']//a[text()='Alias']", {"font-weight": "400"})
 assert-css: (
     "//*[@class='structfield small-section-header']//a[text()='Alias']",
     {"font-weight": "400"},
@@ -19,7 +19,7 @@ goto: file://|DOC_PATH|/lib2/trait.Trait.html
 
 // This is a complex selector, so here's how it works:
 //
-// * //*[@class='docblock item-decl'] — selects element of any tag with classes docblock and item-decl
+// * //*[@class='item-decl'] — selects element of any tag with classes docblock and item-decl
 // * /pre[@class='rust trait'] — selects immediate child with tag pre and classes rust and trait
 // * /code — selects immediate child with tag code
 // * /a[@class='constant'] — selects immediate child with tag a and class constant
@@ -29,11 +29,11 @@ goto: file://|DOC_PATH|/lib2/trait.Trait.html
 // This uses '/parent::*' as a proxy for the style of the text node.
 // We can't just select the '<a>' because intermediate tags could be added.
 assert-count: (
-    "//*[@class='docblock item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
+    "//*[@class='item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
     1,
 )
 assert-css: (
-    "//*[@class='docblock item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
+    "//*[@class='item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
     {"font-weight": "400"},
 )
 
diff --git a/src/test/rustdoc-gui/headings.goml b/src/test/rustdoc-gui/headings.goml
index ed07e777b18..53308e13480 100644
--- a/src/test/rustdoc-gui/headings.goml
+++ b/src/test/rustdoc-gui/headings.goml
@@ -168,19 +168,19 @@ assert-css: (
 )
 assert-css: (
     ".top-doc .docblock h5",
-    {"color": "rgb(0, 0, 0)", "border-bottom": "0px none rgb(221, 221, 221)"},
+    {"color": "rgb(0, 0, 0)", "border-bottom-width": "0px"},
 )
 assert-css: (
     "#implementations-list .docblock h4",
-    {"color": "rgb(0, 0, 0)", "border-bottom": "0px none rgb(221, 221, 221)"},
+    {"color": "rgb(0, 0, 0)", "border-bottom-width": "0px"},
 )
 assert-css: (
     "#implementations-list .docblock h5",
-    {"color": "rgb(0, 0, 0)", "border-bottom": "0px none rgb(221, 221, 221)"},
+    {"color": "rgb(0, 0, 0)", "border-bottom-width": "0px"},
 )
 assert-css: (
     "#implementations-list .docblock h6",
-    {"color": "rgb(0, 0, 0)", "border-bottom": "0px none rgb(221, 221, 221)"},
+    {"color": "rgb(0, 0, 0)", "border-bottom-width": "0px"},
 )
 
 local-storage: {"rustdoc-theme": "dark"}
@@ -199,19 +199,19 @@ assert-css: (
 )
 assert-css: (
     ".top-doc .docblock h5",
-    {"color": "rgb(221, 221, 221)", "border-bottom": "0px none rgb(210, 210, 210)"},
+    {"color": "rgb(221, 221, 221)", "border-bottom-width": "0px"},
 )
 assert-css: (
     "#implementations-list .docblock h4",
-    {"color": "rgb(221, 221, 221)", "border-bottom": "0px none rgb(210, 210, 210)"},
+    {"color": "rgb(221, 221, 221)", "border-bottom-width": "0px"},
 )
 assert-css: (
     "#implementations-list .docblock h5",
-    {"color": "rgb(221, 221, 221)", "border-bottom": "0px none rgb(210, 210, 210)"},
+    {"color": "rgb(221, 221, 221)", "border-bottom-width": "0px"},
 )
 assert-css: (
     "#implementations-list .docblock h6",
-    {"color": "rgb(221, 221, 221)", "border-bottom": "0px none rgb(210, 210, 210)"},
+    {"color": "rgb(221, 221, 221)", "border-bottom-width": "0px"},
 )
 
 local-storage: {"rustdoc-theme": "ayu"}
@@ -230,19 +230,19 @@ assert-css: (
 )
 assert-css: (
     ".top-doc .docblock h5",
-    {"color": "rgb(197, 197, 197)", "border-bottom": "0px none rgb(92, 103, 115)"},
+    {"color": "rgb(197, 197, 197)", "border-bottom-width": "0px"},
 )
 assert-css: (
     "#implementations-list .docblock h4",
-    {"color": "rgb(255, 255, 255)", "border-bottom": "0px none rgb(92, 103, 115)"},
+    {"color": "rgb(255, 255, 255)", "border-bottom-width": "0px"},
 )
 assert-css: (
     "#implementations-list .docblock h5",
-    {"color": "rgb(197, 197, 197)", "border-bottom": "0px none rgb(92, 103, 115)"},
+    {"color": "rgb(197, 197, 197)", "border-bottom-width": "0px"},
 )
 assert-css: (
     "#implementations-list .docblock h6",
-    {"color": "rgb(197, 197, 197)", "border-bottom": "0px none rgb(92, 103, 115)"},
+    {"color": "rgb(197, 197, 197)", "border-bottom-width": "0px"},
 )
 
 local-storage: {"rustdoc-theme": "light"}
diff --git a/src/test/rustdoc-gui/item-info-overflow.goml b/src/test/rustdoc-gui/item-info-overflow.goml
index b7095a3c532..17478da4fea 100644
--- a/src/test/rustdoc-gui/item-info-overflow.goml
+++ b/src/test/rustdoc-gui/item-info-overflow.goml
@@ -3,7 +3,7 @@ goto: file://|DOC_PATH|/lib2/struct.LongItemInfo.html
 // We set a fixed size so there is no chance of "random" resize.
 size: (1200, 870)
 // Logically, the "item-decl" and the "item-info" should have the same scroll width.
-compare-elements-property: (".docblock.item-decl", ".item-info", ["scrollWidth"])
+compare-elements-property: (".item-decl", ".item-info", ["scrollWidth"])
 assert-property: (".item-info", {"scrollWidth": "890"})
 // Just to be sure we're comparing the correct "item-info":
 assert-text: (
diff --git a/src/test/rustdoc-gui/notable-trait.goml b/src/test/rustdoc-gui/notable-trait.goml
new file mode 100644
index 00000000000..69088a0774f
--- /dev/null
+++ b/src/test/rustdoc-gui/notable-trait.goml
@@ -0,0 +1,91 @@
+// This test checks the position of the `i` for the notable traits.
+goto: file://|DOC_PATH|/test_docs/struct.NotableStructWithLongName.html
+show-text: true
+// We start with a wide screen.
+size: (1100, 600)
+// Checking they have the same y position.
+compare-elements-position: (
+    "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+    "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+    ("y"),
+)
+// Checking they don't have the same x position.
+compare-elements-position-false: (
+    "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+    "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+    ("x"),
+)
+// The `i` should be *after* the type.
+assert-position: (
+    "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+    {"x": 692},
+)
+assert-position: (
+    "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+    {"x": 966},
+)
+
+
+// Now only the `i` should be on the next line.
+size: (1055, 600)
+compare-elements-position-false: (
+    "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+    "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+    ("y", "x"),
+)
+
+// Now both the `i` and the struct name should be on the next line.
+size: (980, 600)
+// Checking they have the same y position.
+compare-elements-position: (
+    "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+    "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+    ("y"),
+)
+// Checking they don't have the same x position.
+compare-elements-position-false: (
+    "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+    "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+    ("x"),
+)
+// The `i` should be *after* the type.
+assert-position: (
+    "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+    {"x": 245},
+)
+assert-position: (
+    "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+    {"x": 519},
+)
+
+// Checking on mobile now.
+size: (650, 600)
+// Checking they have the same y position.
+compare-elements-position: (
+    "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+    "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+    ("y"),
+)
+// Checking they don't have the same x position.
+compare-elements-position-false: (
+    "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+    "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+    ("x"),
+)
+// The `i` should be *after* the type.
+assert-position: (
+    "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+    {"x": 15},
+)
+assert-position: (
+    "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+    {"x": 289},
+)
+
+// Checking on very small mobile. The `i` should be on its own line.
+size: (410, 600)
+compare-elements-position-false: (
+    "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+    "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+    ("y", "x"),
+)
diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs
index 4eedf7f15c3..e6177ff84b4 100644
--- a/src/test/rustdoc-gui/src/test_docs/lib.rs
+++ b/src/test/rustdoc-gui/src/test_docs/lib.rs
@@ -325,3 +325,15 @@ pub mod doc_block_table {
     }
 
 }
+
+pub struct NotableStructWithLongName<R>(R);
+
+impl<R: std::io::Read> NotableStructWithLongName<R> {
+    pub fn create_an_iterator_from_read(r: R) -> NotableStructWithLongName<R> { Self(r) }
+}
+
+impl<R: std::io::Read> std::iter::Iterator for NotableStructWithLongName<R> {
+    type Item = ();
+
+    fn next(&mut self) -> Option<Self::Item> { () }
+}
diff --git a/src/test/rustdoc-ui/normalize-overflow.rs b/src/test/rustdoc-ui/normalize-overflow.rs
index 0cdcc88e314..3698fe70e7f 100644
--- a/src/test/rustdoc-ui/normalize-overflow.rs
+++ b/src/test/rustdoc-ui/normalize-overflow.rs
@@ -1,3 +1,5 @@
 // aux-crate:overflow=overflow.rs
 // check-pass
 // Regression test for <https://github.com/rust-lang/rust/issues/79506>.
+
+extern crate overflow;
diff --git a/src/test/rustdoc/attribute-rendering.rs b/src/test/rustdoc/attribute-rendering.rs
index 6777871846e..36e10923c85 100644
--- a/src/test/rustdoc/attribute-rendering.rs
+++ b/src/test/rustdoc/attribute-rendering.rs
@@ -1,7 +1,7 @@
 #![crate_name = "foo"]
 
 // @has 'foo/fn.f.html'
-// @has - //*[@'class="docblock item-decl"]' '#[export_name = "f"] pub fn f()'
+// @has - //*[@'class="item-decl"]' '#[export_name = "f"] pub fn f()'
 #[export_name = "\
 f"]
 pub fn f() {}
diff --git a/src/test/rustdoc/attributes.rs b/src/test/rustdoc/attributes.rs
index 1c7f4b72418..a36dadced87 100644
--- a/src/test/rustdoc/attributes.rs
+++ b/src/test/rustdoc/attributes.rs
@@ -8,6 +8,6 @@ pub extern "C" fn f() {}
 #[export_name = "bar"]
 pub extern "C" fn g() {}
 
-// @has foo/struct.Repr.html '//*[@class="docblock item-decl"]' '#[repr(C, align(8))]'
+// @has foo/struct.Repr.html '//*[@class="item-decl"]' '#[repr(C, align(8))]'
 #[repr(C, align(8))]
 pub struct Repr;
diff --git a/src/test/rustdoc/const-value-display.rs b/src/test/rustdoc/const-value-display.rs
index 5b2f3c48d57..8d95f0de9d0 100644
--- a/src/test/rustdoc/const-value-display.rs
+++ b/src/test/rustdoc/const-value-display.rs
@@ -1,9 +1,9 @@
 #![crate_name = "foo"]
 
 // @has 'foo/constant.HOUR_IN_SECONDS.html'
-// @has - '//*[@class="docblock item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = _; // 3_600u64'
+// @has - '//*[@class="item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = _; // 3_600u64'
 pub const HOUR_IN_SECONDS: u64 = 60 * 60;
 
 // @has 'foo/constant.NEGATIVE.html'
-// @has - '//*[@class="docblock item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64'
+// @has - '//*[@class="item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64'
 pub const NEGATIVE: i64 = -60 * 60;
diff --git a/src/test/rustdoc/decl-trailing-whitespace.rs b/src/test/rustdoc/decl-trailing-whitespace.rs
index 46a2307abef..e47edc13218 100644
--- a/src/test/rustdoc/decl-trailing-whitespace.rs
+++ b/src/test/rustdoc/decl-trailing-whitespace.rs
@@ -7,7 +7,7 @@ pub struct Error;
 // @has 'foo/trait.Write.html'
 
 pub trait Write {
-    // @snapshot 'declaration' - '//*[@class="docblock item-decl"]//code'
+    // @snapshot 'declaration' - '//*[@class="item-decl"]//code'
     fn poll_write(
         self: Option<String>,
         cx: &mut Option<String>,
diff --git a/src/test/rustdoc/macro-higher-kinded-function.rs b/src/test/rustdoc/macro-higher-kinded-function.rs
index 02a4305644e..b8c52b7b791 100644
--- a/src/test/rustdoc/macro-higher-kinded-function.rs
+++ b/src/test/rustdoc/macro-higher-kinded-function.rs
@@ -11,8 +11,8 @@ macro_rules! gen {
 }
 
 // @has 'foo/struct.Providers.html'
-// @has - '//*[@class="docblock item-decl"]//code' "pub a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8,"
-// @has - '//*[@class="docblock item-decl"]//code' "pub b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16,"
+// @has - '//*[@class="item-decl"]//code' "pub a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8,"
+// @has - '//*[@class="item-decl"]//code' "pub b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16,"
 // @has - '//*[@id="structfield.a"]/code' "a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8"
 // @has - '//*[@id="structfield.b"]/code' "b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16"
 gen! {
diff --git a/src/test/rustdoc/reexport-dep-foreign-fn.rs b/src/test/rustdoc/reexport-dep-foreign-fn.rs
index 6e1dc453982..6694c91d104 100644
--- a/src/test/rustdoc/reexport-dep-foreign-fn.rs
+++ b/src/test/rustdoc/reexport-dep-foreign-fn.rs
@@ -8,5 +8,5 @@
 extern crate all_item_types;
 
 // @has 'foo/fn.foo_ffn.html'
-// @has - '//*[@class="docblock item-decl"]//code' 'pub unsafe extern "C" fn foo_ffn()'
+// @has - '//*[@class="item-decl"]//code' 'pub unsafe extern "C" fn foo_ffn()'
 pub use all_item_types::foo_ffn;
diff --git a/src/test/rustdoc/reexports-priv.rs b/src/test/rustdoc/reexports-priv.rs
index aea9b9f2b39..11364e7f707 100644
--- a/src/test/rustdoc/reexports-priv.rs
+++ b/src/test/rustdoc/reexports-priv.rs
@@ -5,7 +5,7 @@
 
 extern crate reexports;
 
-// @has 'foo/macro.addr_of.html' '//*[@class="docblock item-decl"]' 'pub macro addr_of($place:expr) {'
+// @has 'foo/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
 pub use reexports::addr_of;
 // @!has 'foo/macro.addr_of_crate.html'
 pub(crate) use reexports::addr_of_crate;
@@ -14,7 +14,7 @@ pub(self) use reexports::addr_of_self;
 // @!has 'foo/macro.addr_of_local.html'
 use reexports::addr_of_local;
 
-// @has 'foo/struct.Foo.html' '//*[@class="docblock item-decl"]' 'pub struct Foo;'
+// @has 'foo/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
 pub use reexports::Foo;
 // @!has 'foo/struct.FooCrate.html'
 pub(crate) use reexports::FooCrate;
@@ -23,7 +23,7 @@ pub(self) use reexports::FooSelf;
 // @!has 'foo/struct.FooLocal.html'
 use reexports::FooLocal;
 
-// @has 'foo/enum.Bar.html' '//*[@class="docblock item-decl"]' 'pub enum Bar {'
+// @has 'foo/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
 pub use reexports::Bar;
 // @!has 'foo/enum.BarCrate.html'
 pub(crate) use reexports::BarCrate;
@@ -50,7 +50,7 @@ pub(self) use reexports::TypeSelf;
 // @!has 'foo/type.TypeLocal.html'
 use reexports::TypeLocal;
 
-// @has 'foo/union.Union.html' '//*[@class="docblock item-decl"]' 'pub union Union {'
+// @has 'foo/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
 pub use reexports::Union;
 // @!has 'foo/union.UnionCrate.html'
 pub(crate) use reexports::UnionCrate;
@@ -61,33 +61,33 @@ use reexports::UnionLocal;
 
 pub mod outer {
     pub mod inner {
-        // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="docblock item-decl"]' 'pub macro addr_of($place:expr) {'
+        // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
         pub use reexports::addr_of;
-        // @has 'foo/outer/inner/macro.addr_of_crate.html' '//*[@class="docblock item-decl"]' 'pub(crate) macro addr_of_crate($place:expr) {'
+        // @has 'foo/outer/inner/macro.addr_of_crate.html' '//*[@class="item-decl"]' 'pub(crate) macro addr_of_crate($place:expr) {'
         pub(crate) use reexports::addr_of_crate;
-        // @has 'foo/outer/inner/macro.addr_of_super.html' '//*[@class="docblock item-decl"]' 'pub(in outer) macro addr_of_super($place:expr) {'
+        // @has 'foo/outer/inner/macro.addr_of_super.html' '//*[@class="item-decl"]' 'pub(in outer) macro addr_of_super($place:expr) {'
         pub(super) use reexports::addr_of_super;
         // @!has 'foo/outer/inner/macro.addr_of_self.html'
         pub(self) use reexports::addr_of_self;
         // @!has 'foo/outer/inner/macro.addr_of_local.html'
         use reexports::addr_of_local;
 
-        // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="docblock item-decl"]' 'pub struct Foo;'
+        // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
         pub use reexports::Foo;
-        // @has 'foo/outer/inner/struct.FooCrate.html' '//*[@class="docblock item-decl"]' 'pub(crate) struct FooCrate;'
+        // @has 'foo/outer/inner/struct.FooCrate.html' '//*[@class="item-decl"]' 'pub(crate) struct FooCrate;'
         pub(crate) use reexports::FooCrate;
-        // @has 'foo/outer/inner/struct.FooSuper.html' '//*[@class="docblock item-decl"]' 'pub(in outer) struct FooSuper;'
+        // @has 'foo/outer/inner/struct.FooSuper.html' '//*[@class="item-decl"]' 'pub(in outer) struct FooSuper;'
         pub(super) use reexports::FooSuper;
         // @!has 'foo/outer/inner/struct.FooSelf.html'
         pub(self) use reexports::FooSelf;
         // @!has 'foo/outer/inner/struct.FooLocal.html'
         use reexports::FooLocal;
 
-        // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="docblock item-decl"]' 'pub enum Bar {'
+        // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
         pub use reexports::Bar;
-        // @has 'foo/outer/inner/enum.BarCrate.html' '//*[@class="docblock item-decl"]' 'pub(crate) enum BarCrate {'
+        // @has 'foo/outer/inner/enum.BarCrate.html' '//*[@class="item-decl"]' 'pub(crate) enum BarCrate {'
         pub(crate) use reexports::BarCrate;
-        // @has 'foo/outer/inner/enum.BarSuper.html' '//*[@class="docblock item-decl"]' 'pub(in outer) enum BarSuper {'
+        // @has 'foo/outer/inner/enum.BarSuper.html' '//*[@class="item-decl"]' 'pub(in outer) enum BarSuper {'
         pub(super) use reexports::BarSuper;
         // @!has 'foo/outer/inner/enum.BarSelf.html'
         pub(self) use reexports::BarSelf;
@@ -116,11 +116,11 @@ pub mod outer {
         // @!has 'foo/outer/inner/type.TypeLocal.html'
         use reexports::TypeLocal;
 
-        // @has 'foo/outer/inner/union.Union.html' '//*[@class="docblock item-decl"]' 'pub union Union {'
+        // @has 'foo/outer/inner/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
         pub use reexports::Union;
-        // @has 'foo/outer/inner/union.UnionCrate.html' '//*[@class="docblock item-decl"]' 'pub(crate) union UnionCrate {'
+        // @has 'foo/outer/inner/union.UnionCrate.html' '//*[@class="item-decl"]' 'pub(crate) union UnionCrate {'
         pub(crate) use reexports::UnionCrate;
-        // @has 'foo/outer/inner/union.UnionSuper.html' '//*[@class="docblock item-decl"]' 'pub(in outer) union UnionSuper {'
+        // @has 'foo/outer/inner/union.UnionSuper.html' '//*[@class="item-decl"]' 'pub(in outer) union UnionSuper {'
         pub(super) use reexports::UnionSuper;
         // @!has 'foo/outer/inner/union.UnionSelf.html'
         pub(self) use reexports::UnionSelf;
diff --git a/src/test/rustdoc/reexports.rs b/src/test/rustdoc/reexports.rs
index 7abcbfb6181..9aa6d7224ba 100644
--- a/src/test/rustdoc/reexports.rs
+++ b/src/test/rustdoc/reexports.rs
@@ -4,7 +4,7 @@
 
 extern crate reexports;
 
-// @has 'foo/macro.addr_of.html' '//*[@class="docblock item-decl"]' 'pub macro addr_of($place:expr) {'
+// @has 'foo/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
 pub use reexports::addr_of;
 // @!has 'foo/macro.addr_of_crate.html'
 pub(crate) use reexports::addr_of_crate;
@@ -13,7 +13,7 @@ pub(self) use reexports::addr_of_self;
 // @!has 'foo/macro.addr_of_local.html'
 use reexports::addr_of_local;
 
-// @has 'foo/struct.Foo.html' '//*[@class="docblock item-decl"]' 'pub struct Foo;'
+// @has 'foo/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
 pub use reexports::Foo;
 // @!has 'foo/struct.FooCrate.html'
 pub(crate) use reexports::FooCrate;
@@ -22,7 +22,7 @@ pub(self) use reexports::FooSelf;
 // @!has 'foo/struct.FooLocal.html'
 use reexports::FooLocal;
 
-// @has 'foo/enum.Bar.html' '//*[@class="docblock item-decl"]' 'pub enum Bar {'
+// @has 'foo/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
 pub use reexports::Bar;
 // @!has 'foo/enum.BarCrate.html'
 pub(crate) use reexports::BarCrate;
@@ -49,7 +49,7 @@ pub(self) use reexports::TypeSelf;
 // @!has 'foo/type.TypeLocal.html'
 use reexports::TypeLocal;
 
-// @has 'foo/union.Union.html' '//*[@class="docblock item-decl"]' 'pub union Union {'
+// @has 'foo/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
 pub use reexports::Union;
 // @!has 'foo/union.UnionCrate.html'
 pub(crate) use reexports::UnionCrate;
@@ -60,7 +60,7 @@ use reexports::UnionLocal;
 
 pub mod outer {
     pub mod inner {
-        // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="docblock item-decl"]' 'pub macro addr_of($place:expr) {'
+        // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
         pub use reexports::addr_of;
         // @!has 'foo/outer/inner/macro.addr_of_crate.html'
         pub(crate) use reexports::addr_of_crate;
@@ -71,7 +71,7 @@ pub mod outer {
         // @!has 'foo/outer/inner/macro.addr_of_local.html'
         use reexports::addr_of_local;
 
-        // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="docblock item-decl"]' 'pub struct Foo;'
+        // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
         pub use reexports::Foo;
         // @!has 'foo/outer/inner/struct.FooCrate.html'
         pub(crate) use reexports::FooCrate;
@@ -82,7 +82,7 @@ pub mod outer {
         // @!has 'foo/outer/inner/struct.FooLocal.html'
         use reexports::FooLocal;
 
-        // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="docblock item-decl"]' 'pub enum Bar {'
+        // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
         pub use reexports::Bar;
         // @!has 'foo/outer/inner/enum.BarCrate.html'
         pub(crate) use reexports::BarCrate;
@@ -115,7 +115,7 @@ pub mod outer {
         // @!has 'foo/outer/inner/type.TypeLocal.html'
         use reexports::TypeLocal;
 
-        // @has 'foo/outer/inner/union.Union.html' '//*[@class="docblock item-decl"]' 'pub union Union {'
+        // @has 'foo/outer/inner/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
         pub use reexports::Union;
         // @!has 'foo/outer/inner/union.UnionCrate.html'
         pub(crate) use reexports::UnionCrate;
diff --git a/src/test/rustdoc/toggle-item-contents.rs b/src/test/rustdoc/toggle-item-contents.rs
index dbaf195e1a9..47a1d62f5a7 100644
--- a/src/test/rustdoc/toggle-item-contents.rs
+++ b/src/test/rustdoc/toggle-item-contents.rs
@@ -55,7 +55,7 @@ pub union Union {
 
 // @has 'toggle_item_contents/struct.PrivStruct.html'
 // @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
-// @has - '//div[@class="docblock item-decl"]' '/* private fields */'
+// @has - '//div[@class="item-decl"]' '/* private fields */'
 pub struct PrivStruct {
     a: usize,
     b: usize,
diff --git a/src/test/rustdoc/trait_alias.rs b/src/test/rustdoc/trait_alias.rs
index a0c657d9a05..791c099cc52 100644
--- a/src/test/rustdoc/trait_alias.rs
+++ b/src/test/rustdoc/trait_alias.rs
@@ -14,13 +14,13 @@ use std::fmt::Debug;
 // @has foo/index.html '//a[@class="traitalias"]' 'Foo'
 
 // @has foo/traitalias.CopyAlias.html
-// @has - '//section[@id="main-content"]/div[@class="docblock item-decl"]/pre' 'trait CopyAlias = Copy;'
+// @has - '//section[@id="main-content"]/div[@class="item-decl"]/pre' 'trait CopyAlias = Copy;'
 pub trait CopyAlias = Copy;
 // @has foo/traitalias.Alias2.html
-// @has - '//section[@id="main-content"]/div[@class="docblock item-decl"]/pre' 'trait Alias2 = Copy + Debug;'
+// @has - '//section[@id="main-content"]/div[@class="item-decl"]/pre' 'trait Alias2 = Copy + Debug;'
 pub trait Alias2 = Copy + Debug;
 // @has foo/traitalias.Foo.html
-// @has - '//section[@id="main-content"]/div[@class="docblock item-decl"]/pre' 'trait Foo<T> = Into<T> + Debug;'
+// @has - '//section[@id="main-content"]/div[@class="item-decl"]/pre' 'trait Foo<T> = Into<T> + Debug;'
 pub trait Foo<T> = Into<T> + Debug;
 // @has foo/fn.bar.html '//a[@href="traitalias.Alias2.html"]' 'Alias2'
 pub fn bar<T>() where T: Alias2 {}
diff --git a/src/test/rustdoc/where.SWhere_Simd_item-decl.html b/src/test/rustdoc/where.SWhere_Simd_item-decl.html
index 0133bcaeb66..6c1b5d31513 100644
--- a/src/test/rustdoc/where.SWhere_Simd_item-decl.html
+++ b/src/test/rustdoc/where.SWhere_Simd_item-decl.html
@@ -1 +1 @@
-<div class="docblock item-decl"><pre class="rust struct"><code>pub struct Simd&lt;T&gt;(_) <br /><span class="where">where<br />&#160;&#160;&#160;&#160;T: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code></pre></div>
\ No newline at end of file
+<div class="item-decl"><pre class="rust struct"><code>pub struct Simd&lt;T&gt;(_)<br /><span class="where">where<br />&#160;&#160;&#160;&#160;T: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code></pre></div>
\ No newline at end of file
diff --git a/src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html b/src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html
index 54026ff034e..0fbdc0c9cd1 100644
--- a/src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html
+++ b/src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html
@@ -1,3 +1,3 @@
-<div class="docblock item-decl"><pre class="rust trait"><code>pub trait TraitWhere {
-    type <a href="#associatedtype.Item" class="associatedtype">Item</a>&lt;'a&gt;<br />&#160;&#160;&#160; <span class="where">where<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Self: 'a</span>;
+<div class="item-decl"><pre class="rust trait"><code>pub trait TraitWhere {
+    type <a href="#associatedtype.Item" class="associatedtype">Item</a>&lt;'a&gt;<br />&#160;&#160;&#160;<span class="where">where<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Self: 'a</span>;
 }</code></pre></div>
\ No newline at end of file
diff --git a/src/test/rustdoc/where.rs b/src/test/rustdoc/where.rs
index b1034c707f5..8818d74ddd0 100644
--- a/src/test/rustdoc/where.rs
+++ b/src/test/rustdoc/where.rs
@@ -20,13 +20,13 @@ impl<D> Delta<D> where D: MyTrait {
 pub struct Echo<E>(E);
 
 // @has 'foo/struct.Simd.html'
-// @snapshot SWhere_Simd_item-decl - '//div[@class="docblock item-decl"]'
+// @snapshot SWhere_Simd_item-decl - '//div[@class="item-decl"]'
 pub struct Simd<T>([T; 1])
 where
     T: MyTrait;
 
 // @has 'foo/trait.TraitWhere.html'
-// @snapshot SWhere_TraitWhere_item-decl - '//div[@class="docblock item-decl"]'
+// @snapshot SWhere_TraitWhere_item-decl - '//div[@class="item-decl"]'
 pub trait TraitWhere {
     type Item<'a> where Self: 'a;
 }
diff --git a/src/test/rustdoc/whitespace-after-where-clause.enum.html b/src/test/rustdoc/whitespace-after-where-clause.enum.html
index 9e5bf45ae7d..c74866f4a10 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.enum.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.enum.html
@@ -1,4 +1,4 @@
-<div class="docblock item-decl"><pre class="rust enum"><code>pub enum Cow&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,&#160;</span>{
+<div class="item-decl"><pre class="rust enum"><code>pub enum Cow&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt;<span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,</span>{
     Borrowed(<a class="primitive" href="{{channel}}/std/primitive.reference.html">&amp;'a </a>B),
     Whatever(<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>),
-}</code></pre></div>
+}</code></pre></div>
\ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.enum2.html b/src/test/rustdoc/whitespace-after-where-clause.enum2.html
index 6bc47beaed1..ac7d7759821 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.enum2.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.enum2.html
@@ -1,4 +1,4 @@
-<div class="docblock item-decl"><pre class="rust enum"><code>pub enum Cow2&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
+<div class="item-decl"><pre class="rust enum"><code>pub enum Cow2&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
     Borrowed(<a class="primitive" href="{{channel}}/std/primitive.reference.html">&amp;'a </a>B),
     Whatever(<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>),
-}</code></pre></div>
+}</code></pre></div>
\ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.rs b/src/test/rustdoc/whitespace-after-where-clause.rs
index c36386a2aa2..4b740b970fc 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.rs
+++ b/src/test/rustdoc/whitespace-after-where-clause.rs
@@ -4,7 +4,7 @@
 #![crate_name = "foo"]
 
 // @has 'foo/trait.ToOwned.html'
-// @snapshot trait - '//*[@class="docblock item-decl"]'
+// @snapshot trait - '//*[@class="item-decl"]'
 pub trait ToOwned<T>
 where T: Clone
 {
@@ -14,7 +14,7 @@ where T: Clone
 }
 
 // @has 'foo/trait.ToOwned2.html'
-// @snapshot trait2 - '//*[@class="docblock item-decl"]'
+// @snapshot trait2 - '//*[@class="item-decl"]'
 // There should be a whitespace before `{` in this case!
 pub trait ToOwned2<T: Clone> {
     type Owned;
@@ -23,7 +23,7 @@ pub trait ToOwned2<T: Clone> {
 }
 
 // @has 'foo/enum.Cow.html'
-// @snapshot enum - '//*[@class="docblock item-decl"]'
+// @snapshot enum - '//*[@class="item-decl"]'
 pub enum Cow<'a, B: ?Sized + 'a>
 where
     B: ToOwned<Clone>,
@@ -33,7 +33,7 @@ where
 }
 
 // @has 'foo/enum.Cow2.html'
-// @snapshot enum2 - '//*[@class="docblock item-decl"]'
+// @snapshot enum2 - '//*[@class="item-decl"]'
 // There should be a whitespace before `{` in this case!
 pub enum Cow2<'a, B: ?Sized + ToOwned<Clone> + 'a> {
     Borrowed(&'a B),
@@ -41,7 +41,7 @@ pub enum Cow2<'a, B: ?Sized + ToOwned<Clone> + 'a> {
 }
 
 // @has 'foo/struct.Struct.html'
-// @snapshot struct - '//*[@class="docblock item-decl"]'
+// @snapshot struct - '//*[@class="item-decl"]'
 pub struct Struct<'a, B: ?Sized + 'a>
 where
     B: ToOwned<Clone>,
@@ -51,7 +51,7 @@ where
 }
 
 // @has 'foo/struct.Struct2.html'
-// @snapshot struct2 - '//*[@class="docblock item-decl"]'
+// @snapshot struct2 - '//*[@class="item-decl"]'
 // There should be a whitespace before `{` in this case!
 pub struct Struct2<'a, B: ?Sized + ToOwned<Clone> + 'a> {
     pub a: &'a B,
@@ -59,7 +59,7 @@ pub struct Struct2<'a, B: ?Sized + ToOwned<Clone> + 'a> {
 }
 
 // @has 'foo/union.Union.html'
-// @snapshot union - '//*[@class="docblock item-decl"]'
+// @snapshot union - '//*[@class="item-decl"]'
 pub union Union<'a, B: ?Sized + 'a>
 where
     B: ToOwned<Clone>,
@@ -69,7 +69,7 @@ where
 }
 
 // @has 'foo/union.Union2.html'
-// @snapshot union2 - '//*[@class="docblock item-decl"]'
+// @snapshot union2 - '//*[@class="item-decl"]'
 // There should be a whitespace before `{` in this case!
 pub union Union2<'a, B: ?Sized + ToOwned<Clone> + 'a> {
     a: &'a B,
diff --git a/src/test/rustdoc/whitespace-after-where-clause.struct.html b/src/test/rustdoc/whitespace-after-where-clause.struct.html
index 236cc3b30d0..1ba1367d20f 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.struct.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.struct.html
@@ -1,4 +1,4 @@
-<div class="docblock item-decl"><pre class="rust struct"><code>pub struct Struct&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,&#160;</span>{
+<div class="item-decl"><pre class="rust struct"><code>pub struct Struct&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt;<span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,</span>{
     pub a: <a class="primitive" href="{{channel}}/std/primitive.reference.html">&amp;'a </a>B,
     pub b: <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>,
-}</code></pre></div>
+}</code></pre></div>
\ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.struct2.html b/src/test/rustdoc/whitespace-after-where-clause.struct2.html
index 47f5c6ba9c8..fb06b0f77c5 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.struct2.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.struct2.html
@@ -1,4 +1,4 @@
-<div class="docblock item-decl"><pre class="rust struct"><code>pub struct Struct2&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
+<div class="item-decl"><pre class="rust struct"><code>pub struct Struct2&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
     pub a: <a class="primitive" href="{{channel}}/std/primitive.reference.html">&amp;'a </a>B,
     pub b: <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>,
-}</code></pre></div>
+}</code></pre></div>
\ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.trait.html b/src/test/rustdoc/whitespace-after-where-clause.trait.html
index 98f03b837b5..16b55823703 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.trait.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.trait.html
@@ -1,6 +1,6 @@
-<div class="docblock item-decl"><pre class="rust trait"><code>pub trait ToOwned&lt;T&gt; <span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;T: <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&#160;</span>{
+<div class="item-decl"><pre class="rust trait"><code>pub trait ToOwned&lt;T&gt;<span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;T: <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</span>{
     type <a href="#associatedtype.Owned" class="associatedtype">Owned</a>;
 
     fn <a href="#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.ToOwned.html#associatedtype.Owned" title="type foo::ToOwned::Owned">Owned</a>;
 <span class="item-spacer" />    fn <a href="#tymethod.whatever" class="fnname">whatever</a>(&amp;self) -&gt; T;
-}</code></pre></div>
+}</code></pre></div>
\ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.trait2.html b/src/test/rustdoc/whitespace-after-where-clause.trait2.html
index 35052869e76..eeca6e1f500 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.trait2.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.trait2.html
@@ -1,6 +1,6 @@
-<div class="docblock item-decl"><pre class="rust trait"><code>pub trait ToOwned2&lt;T:&#160;<a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; {
+<div class="item-decl"><pre class="rust trait"><code>pub trait ToOwned2&lt;T:&#160;<a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; {
     type <a href="#associatedtype.Owned" class="associatedtype">Owned</a>;
 
     fn <a href="#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.ToOwned2.html#associatedtype.Owned" title="type foo::ToOwned2::Owned">Owned</a>;
 <span class="item-spacer" />    fn <a href="#tymethod.whatever" class="fnname">whatever</a>(&amp;self) -&gt; T;
-}</code></pre></div>
+}</code></pre></div>
\ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.union.html b/src/test/rustdoc/whitespace-after-where-clause.union.html
index 97e1bbcf339..0dfb6407d45 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.union.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.union.html
@@ -1,3 +1,3 @@
-<div class="docblock item-decl"><pre class="rust union"><code>pub union Union&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,&#160;</span>{
+<div class="item-decl"><pre class="rust union"><code>pub union Union&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt;<span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,</span>{
     /* private fields */
-}</code></pre></div>
+}</code></pre></div>
\ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.union2.html b/src/test/rustdoc/whitespace-after-where-clause.union2.html
index 6c752a8b4c5..0d237df53c7 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.union2.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.union2.html
@@ -1,3 +1,3 @@
-<div class="docblock item-decl"><pre class="rust union"><code>pub union Union2&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
+<div class="item-decl"><pre class="rust union"><code>pub union Union2&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
     /* private fields */
-}</code></pre></div>
+}</code></pre></div>
\ No newline at end of file
diff --git a/src/test/ui/macros/syntax-error-recovery.rs b/src/test/ui/macros/syntax-error-recovery.rs
new file mode 100644
index 00000000000..ae6de3c5046
--- /dev/null
+++ b/src/test/ui/macros/syntax-error-recovery.rs
@@ -0,0 +1,18 @@
+macro_rules! values {
+    ($($token:ident($value:literal) $(as $inner:ty)? => $attr:meta,)*) => {
+        #[derive(Debug)]
+        pub enum TokenKind {
+            $(
+                #[$attr]
+                $token $($inner)? = $value,
+            )*
+        }
+    };
+}
+//~^^^^^ ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found `(String)`
+//~| ERROR macro expansion ignores token `(String)` and any following
+
+values!(STRING(1) as (String) => cfg(test),);
+//~^ ERROR expected one of `!` or `::`, found `<eof>`
+
+fn main() {}
diff --git a/src/test/ui/macros/syntax-error-recovery.stderr b/src/test/ui/macros/syntax-error-recovery.stderr
new file mode 100644
index 00000000000..c153b3b910b
--- /dev/null
+++ b/src/test/ui/macros/syntax-error-recovery.stderr
@@ -0,0 +1,30 @@
+error: expected one of `(`, `,`, `=`, `{`, or `}`, found `(String)`
+  --> $DIR/syntax-error-recovery.rs:7:26
+   |
+LL |                 $token $($inner)? = $value,
+   |                          ^^^^^^ expected one of `(`, `,`, `=`, `{`, or `}`
+...
+LL | values!(STRING(1) as (String) => cfg(test),);
+   | -------------------------------------------- in this macro invocation
+   |
+   = note: this error originates in the macro `values` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: macro expansion ignores token `(String)` and any following
+  --> $DIR/syntax-error-recovery.rs:7:26
+   |
+LL |                 $token $($inner)? = $value,
+   |                          ^^^^^^
+...
+LL | values!(STRING(1) as (String) => cfg(test),);
+   | -------------------------------------------- caused by the macro expansion here
+   |
+   = note: the usage of `values!` is likely invalid in item context
+
+error: expected one of `!` or `::`, found `<eof>`
+  --> $DIR/syntax-error-recovery.rs:15:9
+   |
+LL | values!(STRING(1) as (String) => cfg(test),);
+   |         ^^^^^^ expected one of `!` or `::`
+
+error: aborting due to 3 previous errors
+