From cf2dff2b1e3fa55fa5415d524200070d0d7aacfe Mon Sep 17 00:00:00 2001
From: Albert Larsan <74931857+albertlarsan68@users.noreply.github.com>
Date: Thu, 5 Jan 2023 09:13:28 +0100
Subject: Move /src/test to /tests
---
tests/rustdoc/all.rs | 28 +++
tests/rustdoc/anchors.no_const_anchor.html | 1 +
tests/rustdoc/anchors.no_const_anchor2.html | 1 +
tests/rustdoc/anchors.no_method_anchor.html | 1 +
tests/rustdoc/anchors.no_trait_method_anchor.html | 1 +
tests/rustdoc/anchors.no_tymethod_anchor.html | 1 +
tests/rustdoc/anchors.no_type_anchor.html | 1 +
tests/rustdoc/anchors.no_type_anchor2.html | 1 +
tests/rustdoc/anchors.rs | 49 +++++
tests/rustdoc/anonymous-lifetime.rs | 28 +++
tests/rustdoc/anonymous-reexport.rs | 22 +++
tests/rustdoc/array-links.link_box_generic.html | 1 +
tests/rustdoc/array-links.link_box_u32.html | 1 +
tests/rustdoc/array-links.link_slice_generic.html | 1 +
tests/rustdoc/array-links.link_slice_u32.html | 1 +
tests/rustdoc/array-links.rs | 28 +++
tests/rustdoc/asm-foreign.rs | 20 ++
tests/rustdoc/asm-foreign2.rs | 11 ++
tests/rustdoc/assoc-consts-version.rs | 15 ++
tests/rustdoc/assoc-consts.rs | 104 +++++++++++
tests/rustdoc/assoc-item-cast.rs | 14 ++
tests/rustdoc/assoc-types.rs | 37 ++++
tests/rustdoc/associated-consts.rs | 51 +++++
tests/rustdoc/async-fn.rs | 95 ++++++++++
tests/rustdoc/async-move-doctest.rs | 12 ++
tests/rustdoc/async-trait-sig.rs | 14 ++
tests/rustdoc/async-trait.rs | 16 ++
tests/rustdoc/attribute-rendering.rs | 7 +
tests/rustdoc/attributes.rs | 13 ++
tests/rustdoc/auto-impl-for-trait.rs | 16 ++
tests/rustdoc/auto-impl-primitive.rs | 10 +
tests/rustdoc/auto-trait-not-send.rs | 8 +
tests/rustdoc/auto-traits.rs | 13 ++
tests/rustdoc/auto_aliases.rs | 6 +
tests/rustdoc/auxiliary/all-item-types.rs | 22 +++
tests/rustdoc/auxiliary/async-trait-dep.rs | 9 +
tests/rustdoc/auxiliary/auto-traits.rs | 3 +
.../cross-crate-hidden-assoc-trait-items.rs | 19 ++
.../auxiliary/cross-crate-hidden-impl-parameter.rs | 5 +
tests/rustdoc/auxiliary/elided-lifetime.rs | 11 ++
tests/rustdoc/auxiliary/empty.rs | 1 +
tests/rustdoc/auxiliary/enum-primitive.rs | 207 +++++++++++++++++++++
tests/rustdoc/auxiliary/extern-impl-trait.rs | 27 +++
tests/rustdoc/auxiliary/extern-links.rs | 1 +
tests/rustdoc/auxiliary/external-cross-doc.md | 4 +
tests/rustdoc/auxiliary/external-cross.rs | 3 +
tests/rustdoc/auxiliary/external-doc.md | 3 +
tests/rustdoc/auxiliary/external-macro-src.rs | 15 ++
tests/rustdoc/auxiliary/html_root.rs | 2 +
tests/rustdoc/auxiliary/incoherent-impl-types.rs | 7 +
tests/rustdoc/auxiliary/inline-default-methods.rs | 6 +
tests/rustdoc/auxiliary/issue-100204-aux.rs | 13 ++
tests/rustdoc/auxiliary/issue-13698.rs | 8 +
tests/rustdoc/auxiliary/issue-15318.rs | 16 ++
tests/rustdoc/auxiliary/issue-17476.rs | 7 +
tests/rustdoc/auxiliary/issue-19190-3.rs | 23 +++
tests/rustdoc/auxiliary/issue-20646.rs | 7 +
tests/rustdoc/auxiliary/issue-20727.rs | 30 +++
tests/rustdoc/auxiliary/issue-21092.rs | 12 ++
tests/rustdoc/auxiliary/issue-21801.rs | 9 +
tests/rustdoc/auxiliary/issue-22025.rs | 10 +
tests/rustdoc/auxiliary/issue-23207-1.rs | 3 +
tests/rustdoc/auxiliary/issue-23207-2.rs | 5 +
tests/rustdoc/auxiliary/issue-26606-macro.rs | 4 +
tests/rustdoc/auxiliary/issue-27362-aux.rs | 10 +
tests/rustdoc/auxiliary/issue-28927-1.rs | 4 +
tests/rustdoc/auxiliary/issue-28927-2.rs | 1 +
tests/rustdoc/auxiliary/issue-29584.rs | 10 +
tests/rustdoc/auxiliary/issue-30109-1.rs | 1 +
tests/rustdoc/auxiliary/issue-34274.rs | 3 +
tests/rustdoc/auxiliary/issue-36031.rs | 9 +
tests/rustdoc/auxiliary/issue-40936.rs | 5 +
tests/rustdoc/auxiliary/issue-46727.rs | 7 +
tests/rustdoc/auxiliary/issue-48414.rs | 5 +
tests/rustdoc/auxiliary/issue-53689.rs | 1 +
tests/rustdoc/auxiliary/issue-57180.rs | 16 ++
tests/rustdoc/auxiliary/issue-61592.rs | 4 +
tests/rustdoc/auxiliary/issue-73061.rs | 17 ++
tests/rustdoc/auxiliary/issue-85454.rs | 17 ++
tests/rustdoc/auxiliary/issue-86620-1.rs | 11 ++
...issue-98697-reexport-with-anonymous-lifetime.rs | 17 ++
tests/rustdoc/auxiliary/issue-99221-aux.rs | 20 ++
tests/rustdoc/auxiliary/issue-99734-aux.rs | 11 ++
tests/rustdoc/auxiliary/macro_pub_in_module.rs | 13 ++
tests/rustdoc/auxiliary/masked.rs | 14 ++
tests/rustdoc/auxiliary/mod-stackoverflow.rs | 11 ++
tests/rustdoc/auxiliary/no_html_root.rs | 1 +
tests/rustdoc/auxiliary/normalize-assoc-item.rs | 12 ++
tests/rustdoc/auxiliary/primitive-doc.rs | 9 +
tests/rustdoc/auxiliary/primitive-reexport.rs | 8 +
tests/rustdoc/auxiliary/pub-extern-crate.rs | 2 +
tests/rustdoc/auxiliary/pub-use-extern-macros.rs | 21 +++
tests/rustdoc/auxiliary/real_gimli.rs | 13 ++
tests/rustdoc/auxiliary/realcore.rs | 15 ++
tests/rustdoc/auxiliary/reexp-stripped.rs | 11 ++
tests/rustdoc/auxiliary/reexport-check.rs | 2 +
tests/rustdoc/auxiliary/reexport-doc-aux.rs | 5 +
tests/rustdoc/auxiliary/reexports.rs | 66 +++++++
tests/rustdoc/auxiliary/rustdoc-default-impl.rs | 23 +++
.../auxiliary/rustdoc-extern-default-method.rs | 11 ++
tests/rustdoc/auxiliary/rustdoc-extern-method.rs | 7 +
tests/rustdoc/auxiliary/rustdoc-ffi.rs | 6 +
.../auxiliary/rustdoc-impl-parts-crosscrate.rs | 3 +
tests/rustdoc/auxiliary/source-code-bar.rs | 17 ++
tests/rustdoc/auxiliary/source_code.rs | 1 +
tests/rustdoc/auxiliary/src-links-external.rs | 1 +
tests/rustdoc/auxiliary/trait-alias-mention.rs | 3 +
tests/rustdoc/auxiliary/trait-visibility.rs | 3 +
tests/rustdoc/auxiliary/unit-return.rs | 3 +
tests/rustdoc/auxiliary/unstable-trait.rs | 26 +++
tests/rustdoc/auxiliary/variant-struct.rs | 5 +
tests/rustdoc/bad-codeblock-syntax.rs | 44 +++++
tests/rustdoc/blanket-reexport-item.rs | 8 +
tests/rustdoc/bounds-in-multiple-parts.rs | 20 ++
tests/rustdoc/cap-lints.rs | 9 +
tests/rustdoc/cfg-doctest.rs | 6 +
tests/rustdoc/cfg_doc_reexport.rs | 33 ++++
tests/rustdoc/check-source-code-urls-to-def-std.rs | 42 +++++
tests/rustdoc/check-source-code-urls-to-def.rs | 69 +++++++
tests/rustdoc/check-styled-link.rs | 8 +
tests/rustdoc/check.rs | 5 +
tests/rustdoc/codeblock-title.rs | 25 +++
tests/rustdoc/comment-in-doctest.rs | 20 ++
tests/rustdoc/const-display.rs | 86 +++++++++
tests/rustdoc/const-doc.rs | 19 ++
tests/rustdoc/const-fn.rs | 16 ++
tests/rustdoc/const-generics/add-impl.rs | 17 ++
.../const-generics/auxiliary/extern_crate.rs | 16 ++
.../const-generics/const-generic-defaults.rs | 5 +
.../rustdoc/const-generics/const-generic-slice.rs | 11 ++
.../rustdoc/const-generics/const-generics-docs.rs | 128 +++++++++++++
tests/rustdoc/const-generics/const-impl.rs | 37 ++++
.../rustdoc/const-generics/generic_const_exprs.rs | 7 +
.../lazy_normalization_consts/const-equate-pred.rs | 18 ++
tests/rustdoc/const-generics/type-alias.rs | 4 +
tests/rustdoc/const-underscore.rs | 7 +
tests/rustdoc/const-value-display.rs | 9 +
tests/rustdoc/const.rs | 10 +
tests/rustdoc/constructor-imports.rs | 15 ++
tests/rustdoc/crate-version-escape.rs | 5 +
tests/rustdoc/crate-version.rs | 3 +
.../cross-crate-hidden-assoc-trait-items.rs | 23 +++
tests/rustdoc/cross-crate-hidden-impl-parameter.rs | 35 ++++
tests/rustdoc/cross-crate-links.rs | 59 ++++++
tests/rustdoc/cross-crate-primitive-doc.rs | 13 ++
.../decl-trailing-whitespace.declaration.html | 7 +
tests/rustdoc/decl-trailing-whitespace.rs | 30 +++
tests/rustdoc/decl_macro.rs | 56 ++++++
tests/rustdoc/decl_macro_priv.rs | 14 ++
tests/rustdoc/deep-structures.rs | 104 +++++++++++
tests/rustdoc/default-impl.rs | 9 +
tests/rustdoc/default-theme.rs | 7 +
tests/rustdoc/default-trait-method-link.rs | 15 ++
tests/rustdoc/default-trait-method.rs | 26 +++
tests/rustdoc/deprecated-future-staged-api.rs | 18 ++
tests/rustdoc/deprecated-future.rs | 6 +
tests/rustdoc/deprecated-impls.rs | 118 ++++++++++++
tests/rustdoc/deprecated.rs | 33 ++++
tests/rustdoc/deref-const-fn.rs | 38 ++++
tests/rustdoc/deref-mut-methods.rs | 29 +++
tests/rustdoc/deref-recursive-pathbuf.rs | 25 +++
tests/rustdoc/deref-recursive.rs | 41 ++++
tests/rustdoc/deref-slice-core.rs | 22 +++
tests/rustdoc/deref-to-primitive.rs | 15 ++
tests/rustdoc/deref-typedef.rs | 46 +++++
tests/rustdoc/description.rs | 24 +++
tests/rustdoc/description_default.rs | 14 ++
tests/rustdoc/doc-assoc-item.rs | 18 ++
tests/rustdoc/doc-auto-cfg.rs | 35 ++++
tests/rustdoc/doc-cfg-hide.rs | 32 ++++
tests/rustdoc/doc-cfg-implicit-gate.rs | 7 +
tests/rustdoc/doc-cfg-implicit.rs | 31 +++
tests/rustdoc/doc-cfg-simplification.rs | 182 ++++++++++++++++++
tests/rustdoc/doc-cfg-target-feature.rs | 21 +++
tests/rustdoc/doc-cfg-traits.rs | 124 ++++++++++++
tests/rustdoc/doc-cfg.rs | 101 ++++++++++
.../doc-notable_trait-mut_t_is_not_an_iterator.rs | 23 +++
.../doc-notable_trait-mut_t_is_not_ref_t.rs | 21 +++
.../doc-notable_trait-slice.bare_fn_matches.html | 1 +
tests/rustdoc/doc-notable_trait-slice.rs | 20 ++
tests/rustdoc/doc-notable_trait.bare-fn.html | 1 +
tests/rustdoc/doc-notable_trait.rs | 38 ++++
.../rustdoc/doc-notable_trait.some-struct-new.html | 1 +
tests/rustdoc/doc-notable_trait.wrap-me.html | 1 +
.../doc-notable_trait_box_is_not_an_iterator.rs | 38 ++++
tests/rustdoc/doc-proc-macro.rs | 8 +
tests/rustdoc/doc_auto_cfg_nested_impl.rs | 24 +++
tests/rustdoc/doctest-manual-crate-name.rs | 7 +
tests/rustdoc/double-quote-escape.rs | 11 ++
tests/rustdoc/duplicate-cfg.rs | 53 ++++++
tests/rustdoc/duplicate-flags.rs | 4 +
tests/rustdoc/duplicate_impls/impls.rs | 12 ++
tests/rustdoc/duplicate_impls/issue-33054.rs | 14 ++
tests/rustdoc/duplicated_impl.rs | 14 ++
tests/rustdoc/early-unindent.rs | 26 +++
tests/rustdoc/edition-doctest.rs | 44 +++++
tests/rustdoc/edition-flag.rs | 11 ++
tests/rustdoc/elided-lifetime.rs | 43 +++++
tests/rustdoc/empty-doc-comment.rs | 22 +++
tests/rustdoc/empty-impl-block-private-with-doc.rs | 44 +++++
tests/rustdoc/empty-impl-block-private.rs | 40 ++++
tests/rustdoc/empty-impl-block.rs | 20 ++
tests/rustdoc/empty-impls.rs | 19 ++
tests/rustdoc/empty-mod-private.rs | 16 ++
tests/rustdoc/empty-mod-public.rs | 14 ++
tests/rustdoc/empty-section.rs | 13 ++
tests/rustdoc/ensure-src-link.rs | 6 +
tests/rustdoc/enum-headings.rs | 40 ++++
tests/rustdoc/escape-deref-methods.rs | 35 ++++
.../extern-default-method.no_href_on_anchor.html | 1 +
tests/rustdoc/extern-default-method.rs | 23 +++
tests/rustdoc/extern-html-root-url-precedence.rs | 7 +
tests/rustdoc/extern-html-root-url.rs | 18 ++
tests/rustdoc/extern-impl-trait.rs | 11 ++
tests/rustdoc/extern-impl.rs | 27 +++
tests/rustdoc/extern-links.rs | 21 +++
tests/rustdoc/extern-method.rs | 19 ++
tests/rustdoc/external-cross.rs | 10 +
tests/rustdoc/external-doc.rs | 14 ++
tests/rustdoc/external-macro-src.rs | 12 ++
tests/rustdoc/feature-gate-doc_auto_cfg.rs | 8 +
tests/rustdoc/ffi.rs | 12 ++
tests/rustdoc/fn-bound.rs | 21 +++
tests/rustdoc/fn-pointer-arg-name.rs | 5 +
tests/rustdoc/fn-sidebar.rs | 9 +
tests/rustdoc/fn-type.rs | 13 ++
tests/rustdoc/force-target-feature.rs | 11 ++
tests/rustdoc/foreigntype-reexport.rs | 56 ++++++
tests/rustdoc/foreigntype.rs | 18 ++
tests/rustdoc/generic-associated-types/gats.rs | 33 ++++
.../generic-associated-types/issue-94683.rs | 12 ++
tests/rustdoc/generic-impl.rs | 16 ++
tests/rustdoc/generic_const_exprs.rs | 24 +++
tests/rustdoc/glob-shadowing-const.rs | 20 ++
tests/rustdoc/glob-shadowing.rs | 86 +++++++++
tests/rustdoc/hidden-impls.rs | 17 ++
tests/rustdoc/hidden-line.rs | 19 ++
tests/rustdoc/hidden-methods.rs | 29 +++
...den-trait-methods-with-document-hidden-items.rs | 31 +++
tests/rustdoc/hidden-trait-methods.rs | 29 +++
tests/rustdoc/hidden-trait-struct-impls.rs | 22 +++
.../hide-complex-unevaluated-const-arguments.rs | 82 ++++++++
tests/rustdoc/hide-complex-unevaluated-consts.rs | 71 +++++++
tests/rustdoc/hide-unstable-trait.rs | 11 ++
tests/rustdoc/higher-ranked-trait-bounds.rs | 61 ++++++
tests/rustdoc/impl-box.rs | 16 ++
tests/rustdoc/impl-disambiguation.rs | 30 +++
tests/rustdoc/impl-everywhere.rs | 30 +++
tests/rustdoc/impl-in-const-block.rs | 43 +++++
tests/rustdoc/impl-parts-crosscrate.rs | 20 ++
tests/rustdoc/impl-parts.rs | 12 ++
tests/rustdoc/impl-trait-alias.rs | 14 ++
tests/rustdoc/implementor-stable-version.rs | 21 +++
tests/rustdoc/impossible-default.rs | 20 ++
tests/rustdoc/include_str_cut.rs | 7 +
tests/rustdoc/index-page.rs | 11 ++
tests/rustdoc/infinite-redirection.rs | 29 +++
tests/rustdoc/inline-default-methods.rs | 9 +
tests/rustdoc/inline_cross/add-docs.rs | 9 +
tests/rustdoc/inline_cross/assoc-items.rs | 42 +++++
.../inline_cross/assoc_item_trait_bounds.out0.html | 1 +
.../inline_cross/assoc_item_trait_bounds.out2.html | 1 +
.../inline_cross/assoc_item_trait_bounds.out9.html | 1 +
.../inline_cross/assoc_item_trait_bounds.rs | 44 +++++
tests/rustdoc/inline_cross/auxiliary/add-docs.rs | 4 +
.../rustdoc/inline_cross/auxiliary/assoc-items.rs | 38 ++++
.../auxiliary/assoc_item_trait_bounds.rs | 46 +++++
tests/rustdoc/inline_cross/auxiliary/cross-glob.rs | 5 +
.../inline_cross/auxiliary/default-trait-method.rs | 16 ++
tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs | 17 ++
.../auxiliary/impl-inline-without-trait.rs | 8 +
.../inline_cross/auxiliary/impl_trait_aux.rs | 41 ++++
.../inline_cross/auxiliary/implementors_inline.rs | 18 ++
.../rustdoc/inline_cross/auxiliary/issue-24183.rs | 14 ++
.../rustdoc/inline_cross/auxiliary/issue-33113.rs | 7 +
tests/rustdoc/inline_cross/auxiliary/macro-vis.rs | 25 +++
tests/rustdoc/inline_cross/auxiliary/macros.rs | 10 +
tests/rustdoc/inline_cross/auxiliary/proc_macro.rs | 47 +++++
.../inline_cross/auxiliary/renamed-via-module.rs | 9 +
.../inline_cross/auxiliary/rustdoc-hidden-sig.rs | 12 ++
.../inline_cross/auxiliary/rustdoc-hidden.rs | 4 +
.../auxiliary/rustdoc-nonreachable-impls.rs | 34 ++++
.../auxiliary/rustdoc-trait-object-impl.rs | 13 ++
tests/rustdoc/inline_cross/auxiliary/trait-vis.rs | 13 ++
tests/rustdoc/inline_cross/auxiliary/use_crate.rs | 5 +
.../rustdoc/inline_cross/auxiliary/use_crate_2.rs | 1 +
tests/rustdoc/inline_cross/cross-glob.rs | 11 ++
tests/rustdoc/inline_cross/default-trait-method.rs | 20 ++
tests/rustdoc/inline_cross/dyn_trait.rs | 31 +++
tests/rustdoc/inline_cross/hidden-use.rs | 12 ++
.../inline_cross/impl-inline-without-trait.rs | 12 ++
tests/rustdoc/inline_cross/impl_trait.rs | 47 +++++
tests/rustdoc/inline_cross/implementors-js.rs | 25 +++
tests/rustdoc/inline_cross/inline_hidden.rs | 12 ++
.../issue-24183.method_no_where_self_sized.html | 1 +
tests/rustdoc/inline_cross/issue-24183.rs | 18 ++
tests/rustdoc/inline_cross/issue-28480.rs | 13 ++
tests/rustdoc/inline_cross/issue-31948-1.rs | 27 +++
tests/rustdoc/inline_cross/issue-31948-2.rs | 21 +++
tests/rustdoc/inline_cross/issue-31948.rs | 29 +++
tests/rustdoc/inline_cross/issue-32881.rs | 11 ++
tests/rustdoc/inline_cross/issue-33113.rs | 10 +
tests/rustdoc/inline_cross/macro-vis.rs | 36 ++++
tests/rustdoc/inline_cross/macros.rs | 19 ++
tests/rustdoc/inline_cross/proc_macro.rs | 36 ++++
tests/rustdoc/inline_cross/renamed-via-module.rs | 24 +++
tests/rustdoc/inline_cross/trait-vis.rs | 7 +
tests/rustdoc/inline_cross/use_crate.rs | 27 +++
.../glob-extern-document-private-items.rs | 25 +++
tests/rustdoc/inline_local/glob-extern.rs | 21 +++
.../glob-private-document-private-items.rs | 48 +++++
tests/rustdoc/inline_local/glob-private.rs | 42 +++++
tests/rustdoc/inline_local/hidden-use.rs | 10 +
tests/rustdoc/inline_local/issue-28537.rs | 17 ++
tests/rustdoc/inline_local/issue-32343.rs | 23 +++
tests/rustdoc/inline_local/macro_by_example.rs | 17 ++
tests/rustdoc/inline_local/please_inline.rs | 19 ++
tests/rustdoc/inline_local/trait-vis.rs | 18 ++
tests/rustdoc/internal.rs | 18 ++
tests/rustdoc/intra-doc-crate/auxiliary/self.rs | 10 +
tests/rustdoc/intra-doc-crate/self.rs | 9 +
tests/rustdoc/intra-doc/anchors.rs | 24 +++
tests/rustdoc/intra-doc/assoc-reexport-super.rs | 20 ++
tests/rustdoc/intra-doc/associated-defaults.rs | 26 +++
tests/rustdoc/intra-doc/associated-items.rs | 68 +++++++
tests/rustdoc/intra-doc/auxiliary/empty.rs | 1 +
tests/rustdoc/intra-doc/auxiliary/empty2.rs | 1 +
.../auxiliary/extern-builtin-type-impl-dep.rs | 28 +++
.../auxiliary/extern-inherent-impl-dep.rs | 11 ++
.../intra-doc/auxiliary/intra-link-extern-crate.rs | 3 +
.../intra-doc/auxiliary/intra-link-pub-use.rs | 4 +
.../intra-link-reexport-additional-docs.rs | 6 +
.../auxiliary/intra-links-external-traits.rs | 6 +
.../intra-doc/auxiliary/issue-103463-aux.rs | 4 +
tests/rustdoc/intra-doc/auxiliary/issue-66159-1.rs | 2 +
tests/rustdoc/intra-doc/auxiliary/my-core.rs | 23 +++
.../intra-doc/auxiliary/proc-macro-macro.rs | 34 ++++
tests/rustdoc/intra-doc/auxiliary/pub-struct.rs | 1 +
tests/rustdoc/intra-doc/basic.rs | 84 +++++++++
tests/rustdoc/intra-doc/builtin-macros.rs | 3 +
tests/rustdoc/intra-doc/crate-relative-assoc.rs | 17 ++
tests/rustdoc/intra-doc/crate-relative.rs | 13 ++
.../intra-doc/cross-crate/additional_doc.rs | 10 +
.../cross-crate/auxiliary/additional_doc.rs | 6 +
.../intra-doc/cross-crate/auxiliary/hidden.rs | 19 ++
.../cross-crate/auxiliary/intra-doc-basic.rs | 7 +
.../auxiliary/intra-link-cross-crate-crate.rs | 5 +
.../intra-doc/cross-crate/auxiliary/macro_inner.rs | 10 +
.../intra-doc/cross-crate/auxiliary/module.rs | 7 +
.../intra-doc/cross-crate/auxiliary/proc_macro.rs | 20 ++
.../cross-crate/auxiliary/submodule-inner.rs | 12 ++
.../cross-crate/auxiliary/submodule-outer.rs | 13 ++
.../intra-doc/cross-crate/auxiliary/traits.rs | 16 ++
tests/rustdoc/intra-doc/cross-crate/basic.rs | 9 +
tests/rustdoc/intra-doc/cross-crate/crate.rs | 6 +
tests/rustdoc/intra-doc/cross-crate/hidden.rs | 10 +
tests/rustdoc/intra-doc/cross-crate/macro.rs | 11 ++
tests/rustdoc/intra-doc/cross-crate/module.rs | 8 +
.../intra-doc/cross-crate/submodule-inner.rs | 8 +
.../intra-doc/cross-crate/submodule-outer.rs | 16 ++
tests/rustdoc/intra-doc/cross-crate/traits.rs | 14 ++
tests/rustdoc/intra-doc/disambiguators-removed.rs | 50 +++++
tests/rustdoc/intra-doc/email-address.rs | 10 +
tests/rustdoc/intra-doc/enum-struct-field.rs | 14 ++
.../rustdoc/intra-doc/extern-builtin-type-impl.rs | 11 ++
.../intra-doc/extern-crate-only-used-in-link.rs | 19 ++
tests/rustdoc/intra-doc/extern-crate.rs | 9 +
tests/rustdoc/intra-doc/extern-inherent-impl.rs | 8 +
tests/rustdoc/intra-doc/extern-reference-link.rs | 7 +
tests/rustdoc/intra-doc/extern-type.rs | 37 ++++
tests/rustdoc/intra-doc/external-traits.rs | 12 ++
tests/rustdoc/intra-doc/field.rs | 4 +
tests/rustdoc/intra-doc/generic-params.rs | 62 ++++++
tests/rustdoc/intra-doc/generic-trait-impl.rs | 20 ++
tests/rustdoc/intra-doc/in-bodies.rs | 30 +++
tests/rustdoc/intra-doc/issue-103463.rs | 8 +
tests/rustdoc/intra-doc/issue-104145.rs | 14 ++
tests/rustdoc/intra-doc/issue-66159.rs | 10 +
tests/rustdoc/intra-doc/issue-82209.rs | 11 ++
tests/rustdoc/intra-doc/libstd-re-export.rs | 4 +
tests/rustdoc/intra-doc/macros-disambiguators.rs | 25 +++
tests/rustdoc/intra-doc/mod-ambiguity.rs | 16 ++
tests/rustdoc/intra-doc/mod-relative.rs | 17 ++
tests/rustdoc/intra-doc/no-doc-primitive.rs | 15 ++
tests/rustdoc/intra-doc/non-path-primitives.rs | 46 +++++
tests/rustdoc/intra-doc/prim-assoc.rs | 4 +
tests/rustdoc/intra-doc/prim-associated-traits.rs | 46 +++++
.../intra-doc/prim-methods-external-core.rs | 17 ++
tests/rustdoc/intra-doc/prim-methods-local.rs | 29 +++
tests/rustdoc/intra-doc/prim-methods.rs | 7 +
tests/rustdoc/intra-doc/prim-precedence.rs | 16 ++
tests/rustdoc/intra-doc/prim-self.rs | 41 ++++
.../rustdoc/intra-doc/primitive-disambiguators.rs | 4 +
.../intra-doc/primitive-non-default-impl.rs | 31 +++
.../rustdoc/intra-doc/private-failures-ignored.rs | 8 +
tests/rustdoc/intra-doc/private.rs | 20 ++
tests/rustdoc/intra-doc/proc-macro.rs | 27 +++
tests/rustdoc/intra-doc/pub-use.rs | 17 ++
tests/rustdoc/intra-doc/raw-ident-self.rs | 13 ++
.../rustdoc/intra-doc/reexport-additional-docs.rs | 23 +++
tests/rustdoc/intra-doc/self-cache.rs | 14 ++
tests/rustdoc/intra-doc/self.rs | 116 ++++++++++++
tests/rustdoc/intra-doc/trait-impl.rs | 34 ++++
tests/rustdoc/intra-doc/trait-item.rs | 11 ++
tests/rustdoc/intra-doc/true-false.rs | 8 +
tests/rustdoc/intra-doc/type-alias.rs | 19 ++
tests/rustdoc/invalid.crate.name.rs | 3 +
...issue-100204-inline-impl-through-glob-import.rs | 14 ++
tests/rustdoc/issue-100241.rs | 12 ++
tests/rustdoc/issue-100620.rs | 19 ++
tests/rustdoc/issue-100679-sidebar-links-deref.rs | 30 +++
tests/rustdoc/issue-101743-bold-tag.rs | 19 ++
tests/rustdoc/issue-102154.rs | 13 ++
tests/rustdoc/issue-105952.rs | 14 ++
tests/rustdoc/issue-12834.rs | 12 ++
tests/rustdoc/issue-13698.rs | 16 ++
tests/rustdoc/issue-15169.rs | 3 +
tests/rustdoc/issue-15318-2.rs | 12 ++
tests/rustdoc/issue-15318-3.rs | 7 +
tests/rustdoc/issue-15318.rs | 11 ++
tests/rustdoc/issue-15347.rs | 5 +
tests/rustdoc/issue-16019.rs | 9 +
tests/rustdoc/issue-16265-1.rs | 10 +
tests/rustdoc/issue-16265-2.rs | 4 +
tests/rustdoc/issue-17476.rs | 11 ++
tests/rustdoc/issue-18199.rs | 9 +
tests/rustdoc/issue-19181.rs | 5 +
tests/rustdoc/issue-19190-2.rs | 12 ++
tests/rustdoc/issue-19190-3.rs | 27 +++
tests/rustdoc/issue-19190.rs | 20 ++
tests/rustdoc/issue-20175.rs | 10 +
tests/rustdoc/issue-20646.rs | 26 +++
tests/rustdoc/issue-20727-2.rs | 22 +++
tests/rustdoc/issue-20727-3.rs | 24 +++
tests/rustdoc/issue-20727-4.rs | 40 ++++
tests/rustdoc/issue-20727.rs | 24 +++
tests/rustdoc/issue-21092.rs | 8 +
tests/rustdoc/issue-21474.rs | 11 ++
tests/rustdoc/issue-21801.rs | 9 +
tests/rustdoc/issue-22025.rs | 6 +
tests/rustdoc/issue-22038.rs | 19 ++
tests/rustdoc/issue-23106.rs | 7 +
tests/rustdoc/issue-23207.rs | 9 +
tests/rustdoc/issue-23511.rs | 13 ++
tests/rustdoc/issue-23744.rs | 12 ++
tests/rustdoc/issue-23812.rs | 36 ++++
tests/rustdoc/issue-25001.rs | 43 +++++
tests/rustdoc/issue-25944.rs | 11 ++
tests/rustdoc/issue-26606.rs | 11 ++
tests/rustdoc/issue-26995.rs | 7 +
tests/rustdoc/issue-27104.rs | 10 +
tests/rustdoc/issue-27362.rs | 10 +
tests/rustdoc/issue-27759.rs | 14 ++
tests/rustdoc/issue-27862.rs | 4 +
tests/rustdoc/issue-28478.rs | 31 +++
tests/rustdoc/issue-28927.rs | 6 +
tests/rustdoc/issue-29449.rs | 20 ++
tests/rustdoc/issue-29503.rs | 18 ++
tests/rustdoc/issue-29584.rs | 8 +
tests/rustdoc/issue-30109.rs | 14 ++
tests/rustdoc/issue-30252.rs | 6 +
tests/rustdoc/issue-30366.rs | 6 +
tests/rustdoc/issue-31808.rs | 11 ++
tests/rustdoc/issue-31899.rs | 59 ++++++
tests/rustdoc/issue-32374.rs | 31 +++
tests/rustdoc/issue-32395.rs | 15 ++
tests/rustdoc/issue-32556.rs | 5 +
tests/rustdoc/issue-32890.rs | 17 ++
tests/rustdoc/issue-33069.rs | 10 +
tests/rustdoc/issue-33178-1.rs | 10 +
tests/rustdoc/issue-33178.rs | 13 ++
tests/rustdoc/issue-33302.rs | 51 +++++
tests/rustdoc/issue-33592.rs | 13 ++
tests/rustdoc/issue-34025.rs | 12 ++
tests/rustdoc/issue-34274.rs | 10 +
tests/rustdoc/issue-34423.rs | 10 +
tests/rustdoc/issue-34473.rs | 11 ++
tests/rustdoc/issue-34928.rs | 6 +
tests/rustdoc/issue-35169-2.rs | 40 ++++
tests/rustdoc/issue-35169.rs | 35 ++++
tests/rustdoc/issue-35488.rs | 13 ++
tests/rustdoc/issue-36031.rs | 9 +
tests/rustdoc/issue-38129.rs | 99 ++++++++++
tests/rustdoc/issue-38219.rs | 8 +
tests/rustdoc/issue-40936.rs | 6 +
tests/rustdoc/issue-41783.codeblock.html | 5 +
tests/rustdoc/issue-41783.rs | 19 ++
tests/rustdoc/issue-42760.rs | 15 ++
tests/rustdoc/issue-43153.rs | 10 +
tests/rustdoc/issue-43701.rs | 5 +
tests/rustdoc/issue-43869.rs | 72 +++++++
tests/rustdoc/issue-43893.rs | 19 ++
tests/rustdoc/issue-45584.rs | 15 ++
tests/rustdoc/issue-46271.rs | 5 +
tests/rustdoc/issue-46377.rs | 3 +
tests/rustdoc/issue-46380-2.rs | 9 +
tests/rustdoc/issue-46727.rs | 7 +
tests/rustdoc/issue-46766.rs | 6 +
tests/rustdoc/issue-46767.rs | 9 +
tests/rustdoc/issue-46976.rs | 1 +
tests/rustdoc/issue-47038.rs | 10 +
.../rustdoc/issue-47197-blank-line-in-doc-block.rs | 8 +
tests/rustdoc/issue-47639.rs | 6 +
tests/rustdoc/issue-48377.rs | 13 ++
tests/rustdoc/issue-48414.rs | 11 ++
tests/rustdoc/issue-50159.rs | 20 ++
tests/rustdoc/issue-51236.rs | 14 ++
tests/rustdoc/issue-52873.rs | 171 +++++++++++++++++
tests/rustdoc/issue-53689.rs | 16 ++
tests/rustdoc/issue-53812.rs | 20 ++
tests/rustdoc/issue-54478-demo-allocator.rs | 42 +++++
tests/rustdoc/issue-54705.rs | 27 +++
tests/rustdoc/issue-55001.rs | 31 +++
tests/rustdoc/issue-55321.rs | 18 ++
tests/rustdoc/issue-55364.rs | 86 +++++++++
tests/rustdoc/issue-56701.rs | 33 ++++
tests/rustdoc/issue-56822.rs | 24 +++
tests/rustdoc/issue-57180.rs | 7 +
tests/rustdoc/issue-60482.rs | 9 +
tests/rustdoc/issue-60726.rs | 35 ++++
tests/rustdoc/issue-61592.rs | 15 ++
tests/rustdoc/issue-67851-both.rs | 8 +
tests/rustdoc/issue-67851-hidden.rs | 8 +
tests/rustdoc/issue-67851-neither.rs | 6 +
tests/rustdoc/issue-67851-private.rs | 8 +
tests/rustdoc/issue-72340.rs | 19 ++
.../issue-73061-cross-crate-opaque-assoc-type.rs | 14 ++
tests/rustdoc/issue-74083.rs | 21 +++
tests/rustdoc/issue-75588.rs | 17 ++
tests/rustdoc/issue-76501.rs | 17 ++
tests/rustdoc/issue-78673.rs | 24 +++
tests/rustdoc/issue-78701.rs | 20 ++
tests/rustdoc/issue-79201.rs | 41 ++++
tests/rustdoc/issue-80233-normalize-auto-trait.rs | 37 ++++
.../rustdoc/issue-82465-asref-for-and-of-local.rs | 16 ++
...ltiple-mods-w-same-name-doc-inline-last-item.rs | 16 ++
...e-83375-multiple-mods-w-same-name-doc-inline.rs | 16 ++
tests/rustdoc/issue-85454.rs | 29 +++
tests/rustdoc/issue-86620.rs | 9 +
tests/rustdoc/issue-88600.rs | 35 ++++
tests/rustdoc/issue-89309-heading-levels.rs | 29 +++
tests/rustdoc/issue-89852.rs | 14 ++
tests/rustdoc/issue-95633.rs | 7 +
tests/rustdoc/issue-95873.rs | 2 +
tests/rustdoc/issue-96381.rs | 16 ++
tests/rustdoc/issue-98697.rs | 17 ++
...1-multiple-macro-rules-w-same-name-submodule.rs | 19 ++
...issue-99221-multiple-macro-rules-w-same-name.rs | 17 ++
.../issue-99221-multiple-structs-w-same-name.rs | 14 ++
.../issue-99734-multiple-foreigns-w-same-name.rs | 16 ++
.../issue-99734-multiple-mods-w-same-name.rs | 14 ++
tests/rustdoc/keyword.rs | 23 +++
tests/rustdoc/legacy-const-generic.rs | 16 ++
tests/rustdoc/lifetime-name.rs | 5 +
tests/rustdoc/line-breaks.rs | 30 +++
tests/rustdoc/link-assoc-const.rs | 16 ++
tests/rustdoc/link-title-escape.rs | 9 +
tests/rustdoc/local-reexport-doc.rs | 16 ++
tests/rustdoc/logo-class-default.rs | 4 +
tests/rustdoc/logo-class.rs | 10 +
tests/rustdoc/macro-document-private-duplicate.rs | 25 +++
tests/rustdoc/macro-document-private.rs | 19 ++
.../macro-generated-macro.macro_linebreak_pre.html | 6 +
.../macro-generated-macro.macro_morestuff_pre.html | 15 ++
tests/rustdoc/macro-generated-macro.rs | 39 ++++
tests/rustdoc/macro-higher-kinded-function.rs | 21 +++
tests/rustdoc/macro-in-async-block.rs | 9 +
tests/rustdoc/macro-in-closure.rs | 16 ++
tests/rustdoc/macro-indirect-use.rs | 16 ++
tests/rustdoc/macro-private-not-documented.rs | 19 ++
tests/rustdoc/macro_pub_in_module.rs | 82 ++++++++
tests/rustdoc/macro_rules-matchers.rs | 34 ++++
tests/rustdoc/macros.rs | 24 +++
tests/rustdoc/manual_impl.rs | 77 ++++++++
tests/rustdoc/markdown-summaries.rs | 27 +++
tests/rustdoc/masked.rs | 31 +++
tests/rustdoc/method-list.rs | 18 ++
.../mixing-doc-comments-and-attrs.S1_top-doc.html | 4 +
.../mixing-doc-comments-and-attrs.S2_top-doc.html | 4 +
.../mixing-doc-comments-and-attrs.S3_top-doc.html | 3 +
tests/rustdoc/mixing-doc-comments-and-attrs.rs | 25 +++
tests/rustdoc/mod-stackoverflow.rs | 6 +
tests/rustdoc/module-impls.rs | 5 +
tests/rustdoc/multiple-import-levels.rs | 34 ++++
tests/rustdoc/must_implement_one_of.rs | 10 +
tests/rustdoc/mut-params.rs | 18 ++
tests/rustdoc/namespaces.rs | 16 ++
tests/rustdoc/negative-impl-sidebar.rs | 9 +
tests/rustdoc/negative-impl.rs | 14 ++
tests/rustdoc/nested-modules.rs | 42 +++++
tests/rustdoc/no-compiler-reexport.rs | 7 +
tests/rustdoc/no-crate-filter.rs | 6 +
tests/rustdoc/no-run-still-checks-lints.rs | 9 +
tests/rustdoc/no-stack-overflow-25295.rs | 35 ++++
tests/rustdoc/no-unit-struct-field.rs | 18 ++
tests/rustdoc/no_std-primitive.rs | 6 +
tests/rustdoc/normalize-assoc-item.rs | 82 ++++++++
tests/rustdoc/not-wf-ambiguous-normalization.rs | 24 +++
tests/rustdoc/nul-error.rs | 8 +
tests/rustdoc/playground-arg.rs | 13 ++
tests/rustdoc/playground-empty.rs | 13 ++
tests/rustdoc/playground-none.rs | 9 +
tests/rustdoc/playground-syntax-error.rs | 21 +++
tests/rustdoc/playground.rs | 27 +++
tests/rustdoc/primitive-link.rs | 14 ++
tests/rustdoc/primitive-reexport.rs | 28 +++
tests/rustdoc/primitive-reference.rs | 37 ++++
tests/rustdoc/primitive-slice-auto-trait.rs | 14 ++
tests/rustdoc/primitive-tuple-auto-trait.rs | 22 +++
tests/rustdoc/primitive-tuple-variadic.rs | 18 ++
tests/rustdoc/primitive-unit-auto-trait.rs | 14 ++
tests/rustdoc/primitive.rs | 21 +++
tests/rustdoc/primitive/no_std.rs | 16 ++
tests/rustdoc/primitive/primitive-generic-impl.rs | 8 +
tests/rustdoc/private-type-alias.rs | 31 +++
tests/rustdoc/proc-macro.rs | 72 +++++++
tests/rustdoc/process-termination.rs | 24 +++
tests/rustdoc/pub-extern-crate.rs | 9 +
tests/rustdoc/pub-method.rs | 20 ++
tests/rustdoc/pub-use-extern-macros.rs | 17 ++
tests/rustdoc/range-arg-pattern.rs | 5 +
tests/rustdoc/raw-ident-eliminate-r-hashtag.rs | 21 +++
tests/rustdoc/read-more-unneeded.rs | 34 ++++
tests/rustdoc/recursion1.rs | 13 ++
tests/rustdoc/recursion2.rs | 13 ++
tests/rustdoc/recursion3.rs | 13 ++
tests/rustdoc/recursive-deref-sidebar.rs | 22 +++
tests/rustdoc/recursive-deref.rs | 120 ++++++++++++
tests/rustdoc/redirect-const.rs | 13 ++
tests/rustdoc/redirect-map-empty.rs | 6 +
tests/rustdoc/redirect-map.rs | 23 +++
tests/rustdoc/redirect-rename.rs | 34 ++++
tests/rustdoc/redirect.rs | 39 ++++
tests/rustdoc/reexport-check.rs | 18 ++
tests/rustdoc/reexport-dep-foreign-fn.rs | 12 ++
tests/rustdoc/reexport-doc.rs | 8 +
...rt-stability-tags-deprecated-and-portability.rs | 48 +++++
...port-stability-tags-unstable-and-portability.rs | 61 ++++++
tests/rustdoc/reexports-priv.rs | 135 ++++++++++++++
tests/rustdoc/reexports.rs | 129 +++++++++++++
tests/rustdoc/remove-duplicates.rs | 14 ++
tests/rustdoc/remove-url-from-headings.rs | 17 ++
tests/rustdoc/return-impl-trait.rs | 15 ++
tests/rustdoc/rfc-2632-const-trait-impl.rs | 70 +++++++
tests/rustdoc/rustc-incoherent-impls.rs | 28 +++
tests/rustdoc/rustc-macro-crate.rs | 14 ++
tests/rustdoc/safe-intrinsic.rs | 22 +++
tests/rustdoc/same-crate-hidden-impl-parameter.rs | 36 ++++
tests/rustdoc/sanitizer-option.rs | 18 ++
tests/rustdoc/search-index-summaries.rs | 10 +
tests/rustdoc/search-index.rs | 26 +++
tests/rustdoc/short-docblock-codeblock.rs | 10 +
tests/rustdoc/short-docblock.rs | 25 +++
tests/rustdoc/short-line.md | 2 +
tests/rustdoc/show-const-contents.rs | 68 +++++++
tests/rustdoc/sidebar-all-page.rs | 35 ++++
tests/rustdoc/sidebar-items.rs | 56 ++++++
tests/rustdoc/sidebar-link-generation.rs | 13 ++
tests/rustdoc/sidebar-links-to-foreign-impl.rs | 16 ++
tests/rustdoc/sized_trait.rs | 17 ++
tests/rustdoc/slice-links.link_box_generic.html | 1 +
tests/rustdoc/slice-links.link_box_u32.html | 1 +
tests/rustdoc/slice-links.link_slice_generic.html | 1 +
tests/rustdoc/slice-links.link_slice_u32.html | 1 +
tests/rustdoc/slice-links.rs | 28 +++
tests/rustdoc/smart-punct.rs | 28 +++
tests/rustdoc/smoke.rs | 25 +++
tests/rustdoc/sort-modules-by-appearance.rs | 13 ++
tests/rustdoc/source-file.rs | 5 +
tests/rustdoc/source-version-separator.rs | 30 +++
tests/rustdoc/spotlight-from-dependency.odd.html | 1 +
tests/rustdoc/spotlight-from-dependency.rs | 25 +++
tests/rustdoc/src-links-auto-impls.rs | 12 ++
tests/rustdoc/src-links-external.rs | 13 ++
tests/rustdoc/src-links.rs | 51 +++++
tests/rustdoc/src-links/compiletest-ignore-dir | 0
tests/rustdoc/src-links/fizz.rs | 1 +
tests/rustdoc/src-links/mod.rs | 19 ++
tests/rustdoc/stability.rs | 12 ++
tests/rustdoc/static-root-path.rs | 18 ++
tests/rustdoc/static.rs | 12 ++
.../strip-block-doc-comments-stars.docblock.html | 2 +
tests/rustdoc/strip-block-doc-comments-stars.rs | 11 ++
tests/rustdoc/strip-enum-variant.no-not-shown.html | 1 +
tests/rustdoc/strip-enum-variant.rs | 11 ++
tests/rustdoc/struct-arg-pattern.rs | 10 +
tests/rustdoc/struct-field.rs | 22 +++
tests/rustdoc/struct-implementations-title.rs | 9 +
tests/rustdoc/structfields.rs | 44 +++++
tests/rustdoc/synthetic_auto/basic.rs | 8 +
tests/rustdoc/synthetic_auto/complex.rs | 42 +++++
tests/rustdoc/synthetic_auto/crate-local.rs | 9 +
.../issue-72213-projection-lifetime.rs | 25 +++
tests/rustdoc/synthetic_auto/lifetimes.rs | 19 ++
tests/rustdoc/synthetic_auto/manual.rs | 14 ++
tests/rustdoc/synthetic_auto/negative.rs | 13 ++
tests/rustdoc/synthetic_auto/nested.rs | 19 ++
tests/rustdoc/synthetic_auto/no-redundancy.rs | 16 ++
tests/rustdoc/synthetic_auto/overflow.rs | 35 ++++
tests/rustdoc/synthetic_auto/project.rs | 34 ++++
tests/rustdoc/synthetic_auto/self-referential.rs | 29 +++
tests/rustdoc/synthetic_auto/static-region.rs | 10 +
tests/rustdoc/tab_title.rs | 44 +++++
tests/rustdoc/table-in-docblock.rs | 16 ++
tests/rustdoc/task-lists.rs | 13 ++
tests/rustdoc/test-lists.rs | 26 +++
tests/rustdoc/test-parens.rs | 5 +
tests/rustdoc/test-strikethrough.rs | 6 +
tests/rustdoc/test_option_check/bar.rs | 9 +
tests/rustdoc/test_option_check/test.rs | 18 ++
tests/rustdoc/thread-local-src.rs | 6 +
tests/rustdoc/titles.rs | 56 ++++++
tests/rustdoc/toggle-item-contents.rs | 185 ++++++++++++++++++
tests/rustdoc/toggle-method.rs | 18 ++
tests/rustdoc/toggle-trait-fn.rs | 30 +++
tests/rustdoc/trait-alias-mention.rs | 10 +
.../rustdoc/trait-impl-items-links-and-anchors.rs | 65 +++++++
tests/rustdoc/trait-impl.rs | 45 +++++
tests/rustdoc/trait-self-link.rs | 6 +
tests/rustdoc/trait-src-link.rs | 26 +++
tests/rustdoc/trait-visibility.rs | 8 +
tests/rustdoc/trait_alias.rs | 26 +++
tests/rustdoc/traits-in-bodies-private.rs | 13 ++
tests/rustdoc/traits-in-bodies.rs | 52 ++++++
tests/rustdoc/tuple-struct-fields-doc.rs | 50 +++++
tests/rustdoc/tuples.link1_i32.html | 1 +
tests/rustdoc/tuples.link1_t.html | 1 +
tests/rustdoc/tuples.link2_i32.html | 1 +
tests/rustdoc/tuples.link2_t.html | 1 +
tests/rustdoc/tuples.link2_tu.html | 1 +
tests/rustdoc/tuples.link_unit.html | 1 +
tests/rustdoc/tuples.rs | 20 ++
tests/rustdoc/type-layout-flag-required.rs | 4 +
tests/rustdoc/type-layout.rs | 85 +++++++++
tests/rustdoc/typedef.rs | 25 +++
tests/rustdoc/unindent.md | 1 +
tests/rustdoc/unindent.rs | 62 ++++++
tests/rustdoc/union.rs | 8 +
tests/rustdoc/unit-return.rs | 17 ++
tests/rustdoc/universal-impl-trait.rs | 55 ++++++
.../unneeded-trait-implementations-title.rs | 5 +
tests/rustdoc/use-attr.rs | 8 +
tests/rustdoc/useless_lifetime_bound.rs | 13 ++
tests/rustdoc/variadic.rs | 4 +
tests/rustdoc/version-separator-without-source.rs | 23 +++
tests/rustdoc/viewpath-rename.rs | 21 +++
tests/rustdoc/viewpath-self.rs | 21 +++
tests/rustdoc/visibility.rs | 105 +++++++++++
tests/rustdoc/where-clause-order.rs | 19 ++
tests/rustdoc/where-sized.rs | 6 +
tests/rustdoc/where.SWhere_Simd_item-decl.html | 1 +
.../rustdoc/where.SWhere_TraitWhere_item-decl.html | 8 +
tests/rustdoc/where.rs | 62 ++++++
.../whitespace-after-where-clause.enum.html | 4 +
.../whitespace-after-where-clause.enum2.html | 4 +
tests/rustdoc/whitespace-after-where-clause.rs | 77 ++++++++
.../whitespace-after-where-clause.struct.html | 4 +
.../whitespace-after-where-clause.struct2.html | 4 +
.../whitespace-after-where-clause.trait.html | 6 +
.../whitespace-after-where-clause.trait2.html | 6 +
.../whitespace-after-where-clause.union.html | 3 +
.../whitespace-after-where-clause.union2.html | 3 +
tests/rustdoc/without-redirect.rs | 13 ++
tests/rustdoc/wrapping.rs | 5 +
764 files changed, 15735 insertions(+)
create mode 100644 tests/rustdoc/all.rs
create mode 100644 tests/rustdoc/anchors.no_const_anchor.html
create mode 100644 tests/rustdoc/anchors.no_const_anchor2.html
create mode 100644 tests/rustdoc/anchors.no_method_anchor.html
create mode 100644 tests/rustdoc/anchors.no_trait_method_anchor.html
create mode 100644 tests/rustdoc/anchors.no_tymethod_anchor.html
create mode 100644 tests/rustdoc/anchors.no_type_anchor.html
create mode 100644 tests/rustdoc/anchors.no_type_anchor2.html
create mode 100644 tests/rustdoc/anchors.rs
create mode 100644 tests/rustdoc/anonymous-lifetime.rs
create mode 100644 tests/rustdoc/anonymous-reexport.rs
create mode 100644 tests/rustdoc/array-links.link_box_generic.html
create mode 100644 tests/rustdoc/array-links.link_box_u32.html
create mode 100644 tests/rustdoc/array-links.link_slice_generic.html
create mode 100644 tests/rustdoc/array-links.link_slice_u32.html
create mode 100644 tests/rustdoc/array-links.rs
create mode 100644 tests/rustdoc/asm-foreign.rs
create mode 100644 tests/rustdoc/asm-foreign2.rs
create mode 100644 tests/rustdoc/assoc-consts-version.rs
create mode 100644 tests/rustdoc/assoc-consts.rs
create mode 100644 tests/rustdoc/assoc-item-cast.rs
create mode 100644 tests/rustdoc/assoc-types.rs
create mode 100644 tests/rustdoc/associated-consts.rs
create mode 100644 tests/rustdoc/async-fn.rs
create mode 100644 tests/rustdoc/async-move-doctest.rs
create mode 100644 tests/rustdoc/async-trait-sig.rs
create mode 100644 tests/rustdoc/async-trait.rs
create mode 100644 tests/rustdoc/attribute-rendering.rs
create mode 100644 tests/rustdoc/attributes.rs
create mode 100644 tests/rustdoc/auto-impl-for-trait.rs
create mode 100644 tests/rustdoc/auto-impl-primitive.rs
create mode 100644 tests/rustdoc/auto-trait-not-send.rs
create mode 100644 tests/rustdoc/auto-traits.rs
create mode 100644 tests/rustdoc/auto_aliases.rs
create mode 100644 tests/rustdoc/auxiliary/all-item-types.rs
create mode 100644 tests/rustdoc/auxiliary/async-trait-dep.rs
create mode 100644 tests/rustdoc/auxiliary/auto-traits.rs
create mode 100644 tests/rustdoc/auxiliary/cross-crate-hidden-assoc-trait-items.rs
create mode 100644 tests/rustdoc/auxiliary/cross-crate-hidden-impl-parameter.rs
create mode 100644 tests/rustdoc/auxiliary/elided-lifetime.rs
create mode 100644 tests/rustdoc/auxiliary/empty.rs
create mode 100644 tests/rustdoc/auxiliary/enum-primitive.rs
create mode 100644 tests/rustdoc/auxiliary/extern-impl-trait.rs
create mode 100644 tests/rustdoc/auxiliary/extern-links.rs
create mode 100644 tests/rustdoc/auxiliary/external-cross-doc.md
create mode 100644 tests/rustdoc/auxiliary/external-cross.rs
create mode 100644 tests/rustdoc/auxiliary/external-doc.md
create mode 100644 tests/rustdoc/auxiliary/external-macro-src.rs
create mode 100644 tests/rustdoc/auxiliary/html_root.rs
create mode 100644 tests/rustdoc/auxiliary/incoherent-impl-types.rs
create mode 100644 tests/rustdoc/auxiliary/inline-default-methods.rs
create mode 100644 tests/rustdoc/auxiliary/issue-100204-aux.rs
create mode 100644 tests/rustdoc/auxiliary/issue-13698.rs
create mode 100644 tests/rustdoc/auxiliary/issue-15318.rs
create mode 100644 tests/rustdoc/auxiliary/issue-17476.rs
create mode 100644 tests/rustdoc/auxiliary/issue-19190-3.rs
create mode 100644 tests/rustdoc/auxiliary/issue-20646.rs
create mode 100644 tests/rustdoc/auxiliary/issue-20727.rs
create mode 100644 tests/rustdoc/auxiliary/issue-21092.rs
create mode 100644 tests/rustdoc/auxiliary/issue-21801.rs
create mode 100644 tests/rustdoc/auxiliary/issue-22025.rs
create mode 100644 tests/rustdoc/auxiliary/issue-23207-1.rs
create mode 100644 tests/rustdoc/auxiliary/issue-23207-2.rs
create mode 100644 tests/rustdoc/auxiliary/issue-26606-macro.rs
create mode 100644 tests/rustdoc/auxiliary/issue-27362-aux.rs
create mode 100644 tests/rustdoc/auxiliary/issue-28927-1.rs
create mode 100644 tests/rustdoc/auxiliary/issue-28927-2.rs
create mode 100644 tests/rustdoc/auxiliary/issue-29584.rs
create mode 100644 tests/rustdoc/auxiliary/issue-30109-1.rs
create mode 100644 tests/rustdoc/auxiliary/issue-34274.rs
create mode 100644 tests/rustdoc/auxiliary/issue-36031.rs
create mode 100644 tests/rustdoc/auxiliary/issue-40936.rs
create mode 100644 tests/rustdoc/auxiliary/issue-46727.rs
create mode 100644 tests/rustdoc/auxiliary/issue-48414.rs
create mode 100644 tests/rustdoc/auxiliary/issue-53689.rs
create mode 100644 tests/rustdoc/auxiliary/issue-57180.rs
create mode 100644 tests/rustdoc/auxiliary/issue-61592.rs
create mode 100644 tests/rustdoc/auxiliary/issue-73061.rs
create mode 100644 tests/rustdoc/auxiliary/issue-85454.rs
create mode 100644 tests/rustdoc/auxiliary/issue-86620-1.rs
create mode 100644 tests/rustdoc/auxiliary/issue-98697-reexport-with-anonymous-lifetime.rs
create mode 100644 tests/rustdoc/auxiliary/issue-99221-aux.rs
create mode 100644 tests/rustdoc/auxiliary/issue-99734-aux.rs
create mode 100644 tests/rustdoc/auxiliary/macro_pub_in_module.rs
create mode 100644 tests/rustdoc/auxiliary/masked.rs
create mode 100644 tests/rustdoc/auxiliary/mod-stackoverflow.rs
create mode 100644 tests/rustdoc/auxiliary/no_html_root.rs
create mode 100644 tests/rustdoc/auxiliary/normalize-assoc-item.rs
create mode 100644 tests/rustdoc/auxiliary/primitive-doc.rs
create mode 100644 tests/rustdoc/auxiliary/primitive-reexport.rs
create mode 100644 tests/rustdoc/auxiliary/pub-extern-crate.rs
create mode 100644 tests/rustdoc/auxiliary/pub-use-extern-macros.rs
create mode 100644 tests/rustdoc/auxiliary/real_gimli.rs
create mode 100644 tests/rustdoc/auxiliary/realcore.rs
create mode 100644 tests/rustdoc/auxiliary/reexp-stripped.rs
create mode 100644 tests/rustdoc/auxiliary/reexport-check.rs
create mode 100644 tests/rustdoc/auxiliary/reexport-doc-aux.rs
create mode 100644 tests/rustdoc/auxiliary/reexports.rs
create mode 100644 tests/rustdoc/auxiliary/rustdoc-default-impl.rs
create mode 100644 tests/rustdoc/auxiliary/rustdoc-extern-default-method.rs
create mode 100644 tests/rustdoc/auxiliary/rustdoc-extern-method.rs
create mode 100644 tests/rustdoc/auxiliary/rustdoc-ffi.rs
create mode 100644 tests/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs
create mode 100644 tests/rustdoc/auxiliary/source-code-bar.rs
create mode 100644 tests/rustdoc/auxiliary/source_code.rs
create mode 100644 tests/rustdoc/auxiliary/src-links-external.rs
create mode 100644 tests/rustdoc/auxiliary/trait-alias-mention.rs
create mode 100644 tests/rustdoc/auxiliary/trait-visibility.rs
create mode 100644 tests/rustdoc/auxiliary/unit-return.rs
create mode 100644 tests/rustdoc/auxiliary/unstable-trait.rs
create mode 100644 tests/rustdoc/auxiliary/variant-struct.rs
create mode 100644 tests/rustdoc/bad-codeblock-syntax.rs
create mode 100644 tests/rustdoc/blanket-reexport-item.rs
create mode 100644 tests/rustdoc/bounds-in-multiple-parts.rs
create mode 100644 tests/rustdoc/cap-lints.rs
create mode 100644 tests/rustdoc/cfg-doctest.rs
create mode 100644 tests/rustdoc/cfg_doc_reexport.rs
create mode 100644 tests/rustdoc/check-source-code-urls-to-def-std.rs
create mode 100644 tests/rustdoc/check-source-code-urls-to-def.rs
create mode 100644 tests/rustdoc/check-styled-link.rs
create mode 100644 tests/rustdoc/check.rs
create mode 100644 tests/rustdoc/codeblock-title.rs
create mode 100644 tests/rustdoc/comment-in-doctest.rs
create mode 100644 tests/rustdoc/const-display.rs
create mode 100644 tests/rustdoc/const-doc.rs
create mode 100644 tests/rustdoc/const-fn.rs
create mode 100644 tests/rustdoc/const-generics/add-impl.rs
create mode 100644 tests/rustdoc/const-generics/auxiliary/extern_crate.rs
create mode 100644 tests/rustdoc/const-generics/const-generic-defaults.rs
create mode 100644 tests/rustdoc/const-generics/const-generic-slice.rs
create mode 100644 tests/rustdoc/const-generics/const-generics-docs.rs
create mode 100644 tests/rustdoc/const-generics/const-impl.rs
create mode 100644 tests/rustdoc/const-generics/generic_const_exprs.rs
create mode 100644 tests/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs
create mode 100644 tests/rustdoc/const-generics/type-alias.rs
create mode 100644 tests/rustdoc/const-underscore.rs
create mode 100644 tests/rustdoc/const-value-display.rs
create mode 100644 tests/rustdoc/const.rs
create mode 100644 tests/rustdoc/constructor-imports.rs
create mode 100644 tests/rustdoc/crate-version-escape.rs
create mode 100644 tests/rustdoc/crate-version.rs
create mode 100644 tests/rustdoc/cross-crate-hidden-assoc-trait-items.rs
create mode 100644 tests/rustdoc/cross-crate-hidden-impl-parameter.rs
create mode 100644 tests/rustdoc/cross-crate-links.rs
create mode 100644 tests/rustdoc/cross-crate-primitive-doc.rs
create mode 100644 tests/rustdoc/decl-trailing-whitespace.declaration.html
create mode 100644 tests/rustdoc/decl-trailing-whitespace.rs
create mode 100644 tests/rustdoc/decl_macro.rs
create mode 100644 tests/rustdoc/decl_macro_priv.rs
create mode 100644 tests/rustdoc/deep-structures.rs
create mode 100644 tests/rustdoc/default-impl.rs
create mode 100644 tests/rustdoc/default-theme.rs
create mode 100644 tests/rustdoc/default-trait-method-link.rs
create mode 100644 tests/rustdoc/default-trait-method.rs
create mode 100644 tests/rustdoc/deprecated-future-staged-api.rs
create mode 100644 tests/rustdoc/deprecated-future.rs
create mode 100644 tests/rustdoc/deprecated-impls.rs
create mode 100644 tests/rustdoc/deprecated.rs
create mode 100644 tests/rustdoc/deref-const-fn.rs
create mode 100644 tests/rustdoc/deref-mut-methods.rs
create mode 100644 tests/rustdoc/deref-recursive-pathbuf.rs
create mode 100644 tests/rustdoc/deref-recursive.rs
create mode 100644 tests/rustdoc/deref-slice-core.rs
create mode 100644 tests/rustdoc/deref-to-primitive.rs
create mode 100644 tests/rustdoc/deref-typedef.rs
create mode 100644 tests/rustdoc/description.rs
create mode 100644 tests/rustdoc/description_default.rs
create mode 100644 tests/rustdoc/doc-assoc-item.rs
create mode 100644 tests/rustdoc/doc-auto-cfg.rs
create mode 100644 tests/rustdoc/doc-cfg-hide.rs
create mode 100644 tests/rustdoc/doc-cfg-implicit-gate.rs
create mode 100644 tests/rustdoc/doc-cfg-implicit.rs
create mode 100644 tests/rustdoc/doc-cfg-simplification.rs
create mode 100644 tests/rustdoc/doc-cfg-target-feature.rs
create mode 100644 tests/rustdoc/doc-cfg-traits.rs
create mode 100644 tests/rustdoc/doc-cfg.rs
create mode 100644 tests/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs
create mode 100644 tests/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs
create mode 100644 tests/rustdoc/doc-notable_trait-slice.bare_fn_matches.html
create mode 100644 tests/rustdoc/doc-notable_trait-slice.rs
create mode 100644 tests/rustdoc/doc-notable_trait.bare-fn.html
create mode 100644 tests/rustdoc/doc-notable_trait.rs
create mode 100644 tests/rustdoc/doc-notable_trait.some-struct-new.html
create mode 100644 tests/rustdoc/doc-notable_trait.wrap-me.html
create mode 100644 tests/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs
create mode 100644 tests/rustdoc/doc-proc-macro.rs
create mode 100644 tests/rustdoc/doc_auto_cfg_nested_impl.rs
create mode 100644 tests/rustdoc/doctest-manual-crate-name.rs
create mode 100644 tests/rustdoc/double-quote-escape.rs
create mode 100644 tests/rustdoc/duplicate-cfg.rs
create mode 100644 tests/rustdoc/duplicate-flags.rs
create mode 100644 tests/rustdoc/duplicate_impls/impls.rs
create mode 100644 tests/rustdoc/duplicate_impls/issue-33054.rs
create mode 100644 tests/rustdoc/duplicated_impl.rs
create mode 100644 tests/rustdoc/early-unindent.rs
create mode 100644 tests/rustdoc/edition-doctest.rs
create mode 100644 tests/rustdoc/edition-flag.rs
create mode 100644 tests/rustdoc/elided-lifetime.rs
create mode 100644 tests/rustdoc/empty-doc-comment.rs
create mode 100644 tests/rustdoc/empty-impl-block-private-with-doc.rs
create mode 100644 tests/rustdoc/empty-impl-block-private.rs
create mode 100644 tests/rustdoc/empty-impl-block.rs
create mode 100644 tests/rustdoc/empty-impls.rs
create mode 100644 tests/rustdoc/empty-mod-private.rs
create mode 100644 tests/rustdoc/empty-mod-public.rs
create mode 100644 tests/rustdoc/empty-section.rs
create mode 100644 tests/rustdoc/ensure-src-link.rs
create mode 100644 tests/rustdoc/enum-headings.rs
create mode 100644 tests/rustdoc/escape-deref-methods.rs
create mode 100644 tests/rustdoc/extern-default-method.no_href_on_anchor.html
create mode 100644 tests/rustdoc/extern-default-method.rs
create mode 100644 tests/rustdoc/extern-html-root-url-precedence.rs
create mode 100644 tests/rustdoc/extern-html-root-url.rs
create mode 100644 tests/rustdoc/extern-impl-trait.rs
create mode 100644 tests/rustdoc/extern-impl.rs
create mode 100644 tests/rustdoc/extern-links.rs
create mode 100644 tests/rustdoc/extern-method.rs
create mode 100644 tests/rustdoc/external-cross.rs
create mode 100644 tests/rustdoc/external-doc.rs
create mode 100644 tests/rustdoc/external-macro-src.rs
create mode 100644 tests/rustdoc/feature-gate-doc_auto_cfg.rs
create mode 100644 tests/rustdoc/ffi.rs
create mode 100644 tests/rustdoc/fn-bound.rs
create mode 100644 tests/rustdoc/fn-pointer-arg-name.rs
create mode 100644 tests/rustdoc/fn-sidebar.rs
create mode 100644 tests/rustdoc/fn-type.rs
create mode 100644 tests/rustdoc/force-target-feature.rs
create mode 100644 tests/rustdoc/foreigntype-reexport.rs
create mode 100644 tests/rustdoc/foreigntype.rs
create mode 100644 tests/rustdoc/generic-associated-types/gats.rs
create mode 100644 tests/rustdoc/generic-associated-types/issue-94683.rs
create mode 100644 tests/rustdoc/generic-impl.rs
create mode 100644 tests/rustdoc/generic_const_exprs.rs
create mode 100644 tests/rustdoc/glob-shadowing-const.rs
create mode 100644 tests/rustdoc/glob-shadowing.rs
create mode 100644 tests/rustdoc/hidden-impls.rs
create mode 100644 tests/rustdoc/hidden-line.rs
create mode 100644 tests/rustdoc/hidden-methods.rs
create mode 100644 tests/rustdoc/hidden-trait-methods-with-document-hidden-items.rs
create mode 100644 tests/rustdoc/hidden-trait-methods.rs
create mode 100644 tests/rustdoc/hidden-trait-struct-impls.rs
create mode 100644 tests/rustdoc/hide-complex-unevaluated-const-arguments.rs
create mode 100644 tests/rustdoc/hide-complex-unevaluated-consts.rs
create mode 100644 tests/rustdoc/hide-unstable-trait.rs
create mode 100644 tests/rustdoc/higher-ranked-trait-bounds.rs
create mode 100644 tests/rustdoc/impl-box.rs
create mode 100644 tests/rustdoc/impl-disambiguation.rs
create mode 100644 tests/rustdoc/impl-everywhere.rs
create mode 100644 tests/rustdoc/impl-in-const-block.rs
create mode 100644 tests/rustdoc/impl-parts-crosscrate.rs
create mode 100644 tests/rustdoc/impl-parts.rs
create mode 100644 tests/rustdoc/impl-trait-alias.rs
create mode 100644 tests/rustdoc/implementor-stable-version.rs
create mode 100644 tests/rustdoc/impossible-default.rs
create mode 100644 tests/rustdoc/include_str_cut.rs
create mode 100644 tests/rustdoc/index-page.rs
create mode 100644 tests/rustdoc/infinite-redirection.rs
create mode 100644 tests/rustdoc/inline-default-methods.rs
create mode 100644 tests/rustdoc/inline_cross/add-docs.rs
create mode 100644 tests/rustdoc/inline_cross/assoc-items.rs
create mode 100644 tests/rustdoc/inline_cross/assoc_item_trait_bounds.out0.html
create mode 100644 tests/rustdoc/inline_cross/assoc_item_trait_bounds.out2.html
create mode 100644 tests/rustdoc/inline_cross/assoc_item_trait_bounds.out9.html
create mode 100644 tests/rustdoc/inline_cross/assoc_item_trait_bounds.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/add-docs.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/assoc-items.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/cross-glob.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/default-trait-method.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/dyn_trait.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/impl-inline-without-trait.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/implementors_inline.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/issue-24183.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/issue-33113.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/macro-vis.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/macros.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/proc_macro.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/renamed-via-module.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden-sig.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/rustdoc-hidden.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/rustdoc-trait-object-impl.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/trait-vis.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/use_crate.rs
create mode 100644 tests/rustdoc/inline_cross/auxiliary/use_crate_2.rs
create mode 100644 tests/rustdoc/inline_cross/cross-glob.rs
create mode 100644 tests/rustdoc/inline_cross/default-trait-method.rs
create mode 100644 tests/rustdoc/inline_cross/dyn_trait.rs
create mode 100644 tests/rustdoc/inline_cross/hidden-use.rs
create mode 100644 tests/rustdoc/inline_cross/impl-inline-without-trait.rs
create mode 100644 tests/rustdoc/inline_cross/impl_trait.rs
create mode 100644 tests/rustdoc/inline_cross/implementors-js.rs
create mode 100644 tests/rustdoc/inline_cross/inline_hidden.rs
create mode 100644 tests/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html
create mode 100644 tests/rustdoc/inline_cross/issue-24183.rs
create mode 100644 tests/rustdoc/inline_cross/issue-28480.rs
create mode 100644 tests/rustdoc/inline_cross/issue-31948-1.rs
create mode 100644 tests/rustdoc/inline_cross/issue-31948-2.rs
create mode 100644 tests/rustdoc/inline_cross/issue-31948.rs
create mode 100644 tests/rustdoc/inline_cross/issue-32881.rs
create mode 100644 tests/rustdoc/inline_cross/issue-33113.rs
create mode 100644 tests/rustdoc/inline_cross/macro-vis.rs
create mode 100644 tests/rustdoc/inline_cross/macros.rs
create mode 100644 tests/rustdoc/inline_cross/proc_macro.rs
create mode 100644 tests/rustdoc/inline_cross/renamed-via-module.rs
create mode 100644 tests/rustdoc/inline_cross/trait-vis.rs
create mode 100644 tests/rustdoc/inline_cross/use_crate.rs
create mode 100644 tests/rustdoc/inline_local/glob-extern-document-private-items.rs
create mode 100644 tests/rustdoc/inline_local/glob-extern.rs
create mode 100644 tests/rustdoc/inline_local/glob-private-document-private-items.rs
create mode 100644 tests/rustdoc/inline_local/glob-private.rs
create mode 100644 tests/rustdoc/inline_local/hidden-use.rs
create mode 100644 tests/rustdoc/inline_local/issue-28537.rs
create mode 100644 tests/rustdoc/inline_local/issue-32343.rs
create mode 100644 tests/rustdoc/inline_local/macro_by_example.rs
create mode 100644 tests/rustdoc/inline_local/please_inline.rs
create mode 100644 tests/rustdoc/inline_local/trait-vis.rs
create mode 100644 tests/rustdoc/internal.rs
create mode 100644 tests/rustdoc/intra-doc-crate/auxiliary/self.rs
create mode 100644 tests/rustdoc/intra-doc-crate/self.rs
create mode 100644 tests/rustdoc/intra-doc/anchors.rs
create mode 100644 tests/rustdoc/intra-doc/assoc-reexport-super.rs
create mode 100644 tests/rustdoc/intra-doc/associated-defaults.rs
create mode 100644 tests/rustdoc/intra-doc/associated-items.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/empty.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/empty2.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/extern-builtin-type-impl-dep.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/extern-inherent-impl-dep.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/intra-link-extern-crate.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/intra-link-pub-use.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/intra-link-reexport-additional-docs.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/intra-links-external-traits.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/issue-66159-1.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/my-core.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/proc-macro-macro.rs
create mode 100644 tests/rustdoc/intra-doc/auxiliary/pub-struct.rs
create mode 100644 tests/rustdoc/intra-doc/basic.rs
create mode 100644 tests/rustdoc/intra-doc/builtin-macros.rs
create mode 100644 tests/rustdoc/intra-doc/crate-relative-assoc.rs
create mode 100644 tests/rustdoc/intra-doc/crate-relative.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/additional_doc.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/auxiliary/additional_doc.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/auxiliary/hidden.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/auxiliary/intra-doc-basic.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/auxiliary/intra-link-cross-crate-crate.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/auxiliary/macro_inner.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/auxiliary/module.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/auxiliary/proc_macro.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/auxiliary/submodule-inner.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/auxiliary/submodule-outer.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/auxiliary/traits.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/basic.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/crate.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/hidden.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/macro.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/module.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/submodule-inner.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/submodule-outer.rs
create mode 100644 tests/rustdoc/intra-doc/cross-crate/traits.rs
create mode 100644 tests/rustdoc/intra-doc/disambiguators-removed.rs
create mode 100644 tests/rustdoc/intra-doc/email-address.rs
create mode 100644 tests/rustdoc/intra-doc/enum-struct-field.rs
create mode 100644 tests/rustdoc/intra-doc/extern-builtin-type-impl.rs
create mode 100644 tests/rustdoc/intra-doc/extern-crate-only-used-in-link.rs
create mode 100644 tests/rustdoc/intra-doc/extern-crate.rs
create mode 100644 tests/rustdoc/intra-doc/extern-inherent-impl.rs
create mode 100644 tests/rustdoc/intra-doc/extern-reference-link.rs
create mode 100644 tests/rustdoc/intra-doc/extern-type.rs
create mode 100644 tests/rustdoc/intra-doc/external-traits.rs
create mode 100644 tests/rustdoc/intra-doc/field.rs
create mode 100644 tests/rustdoc/intra-doc/generic-params.rs
create mode 100644 tests/rustdoc/intra-doc/generic-trait-impl.rs
create mode 100644 tests/rustdoc/intra-doc/in-bodies.rs
create mode 100644 tests/rustdoc/intra-doc/issue-103463.rs
create mode 100644 tests/rustdoc/intra-doc/issue-104145.rs
create mode 100644 tests/rustdoc/intra-doc/issue-66159.rs
create mode 100644 tests/rustdoc/intra-doc/issue-82209.rs
create mode 100644 tests/rustdoc/intra-doc/libstd-re-export.rs
create mode 100644 tests/rustdoc/intra-doc/macros-disambiguators.rs
create mode 100644 tests/rustdoc/intra-doc/mod-ambiguity.rs
create mode 100644 tests/rustdoc/intra-doc/mod-relative.rs
create mode 100644 tests/rustdoc/intra-doc/no-doc-primitive.rs
create mode 100644 tests/rustdoc/intra-doc/non-path-primitives.rs
create mode 100644 tests/rustdoc/intra-doc/prim-assoc.rs
create mode 100644 tests/rustdoc/intra-doc/prim-associated-traits.rs
create mode 100644 tests/rustdoc/intra-doc/prim-methods-external-core.rs
create mode 100644 tests/rustdoc/intra-doc/prim-methods-local.rs
create mode 100644 tests/rustdoc/intra-doc/prim-methods.rs
create mode 100644 tests/rustdoc/intra-doc/prim-precedence.rs
create mode 100644 tests/rustdoc/intra-doc/prim-self.rs
create mode 100644 tests/rustdoc/intra-doc/primitive-disambiguators.rs
create mode 100644 tests/rustdoc/intra-doc/primitive-non-default-impl.rs
create mode 100644 tests/rustdoc/intra-doc/private-failures-ignored.rs
create mode 100644 tests/rustdoc/intra-doc/private.rs
create mode 100644 tests/rustdoc/intra-doc/proc-macro.rs
create mode 100644 tests/rustdoc/intra-doc/pub-use.rs
create mode 100644 tests/rustdoc/intra-doc/raw-ident-self.rs
create mode 100644 tests/rustdoc/intra-doc/reexport-additional-docs.rs
create mode 100644 tests/rustdoc/intra-doc/self-cache.rs
create mode 100644 tests/rustdoc/intra-doc/self.rs
create mode 100644 tests/rustdoc/intra-doc/trait-impl.rs
create mode 100644 tests/rustdoc/intra-doc/trait-item.rs
create mode 100644 tests/rustdoc/intra-doc/true-false.rs
create mode 100644 tests/rustdoc/intra-doc/type-alias.rs
create mode 100644 tests/rustdoc/invalid.crate.name.rs
create mode 100644 tests/rustdoc/issue-100204-inline-impl-through-glob-import.rs
create mode 100644 tests/rustdoc/issue-100241.rs
create mode 100644 tests/rustdoc/issue-100620.rs
create mode 100644 tests/rustdoc/issue-100679-sidebar-links-deref.rs
create mode 100644 tests/rustdoc/issue-101743-bold-tag.rs
create mode 100644 tests/rustdoc/issue-102154.rs
create mode 100644 tests/rustdoc/issue-105952.rs
create mode 100644 tests/rustdoc/issue-12834.rs
create mode 100644 tests/rustdoc/issue-13698.rs
create mode 100644 tests/rustdoc/issue-15169.rs
create mode 100644 tests/rustdoc/issue-15318-2.rs
create mode 100644 tests/rustdoc/issue-15318-3.rs
create mode 100644 tests/rustdoc/issue-15318.rs
create mode 100644 tests/rustdoc/issue-15347.rs
create mode 100644 tests/rustdoc/issue-16019.rs
create mode 100644 tests/rustdoc/issue-16265-1.rs
create mode 100644 tests/rustdoc/issue-16265-2.rs
create mode 100644 tests/rustdoc/issue-17476.rs
create mode 100644 tests/rustdoc/issue-18199.rs
create mode 100644 tests/rustdoc/issue-19181.rs
create mode 100644 tests/rustdoc/issue-19190-2.rs
create mode 100644 tests/rustdoc/issue-19190-3.rs
create mode 100644 tests/rustdoc/issue-19190.rs
create mode 100644 tests/rustdoc/issue-20175.rs
create mode 100644 tests/rustdoc/issue-20646.rs
create mode 100644 tests/rustdoc/issue-20727-2.rs
create mode 100644 tests/rustdoc/issue-20727-3.rs
create mode 100644 tests/rustdoc/issue-20727-4.rs
create mode 100644 tests/rustdoc/issue-20727.rs
create mode 100644 tests/rustdoc/issue-21092.rs
create mode 100644 tests/rustdoc/issue-21474.rs
create mode 100644 tests/rustdoc/issue-21801.rs
create mode 100644 tests/rustdoc/issue-22025.rs
create mode 100644 tests/rustdoc/issue-22038.rs
create mode 100644 tests/rustdoc/issue-23106.rs
create mode 100644 tests/rustdoc/issue-23207.rs
create mode 100644 tests/rustdoc/issue-23511.rs
create mode 100644 tests/rustdoc/issue-23744.rs
create mode 100644 tests/rustdoc/issue-23812.rs
create mode 100644 tests/rustdoc/issue-25001.rs
create mode 100644 tests/rustdoc/issue-25944.rs
create mode 100644 tests/rustdoc/issue-26606.rs
create mode 100644 tests/rustdoc/issue-26995.rs
create mode 100644 tests/rustdoc/issue-27104.rs
create mode 100644 tests/rustdoc/issue-27362.rs
create mode 100644 tests/rustdoc/issue-27759.rs
create mode 100644 tests/rustdoc/issue-27862.rs
create mode 100644 tests/rustdoc/issue-28478.rs
create mode 100644 tests/rustdoc/issue-28927.rs
create mode 100644 tests/rustdoc/issue-29449.rs
create mode 100644 tests/rustdoc/issue-29503.rs
create mode 100644 tests/rustdoc/issue-29584.rs
create mode 100644 tests/rustdoc/issue-30109.rs
create mode 100644 tests/rustdoc/issue-30252.rs
create mode 100644 tests/rustdoc/issue-30366.rs
create mode 100644 tests/rustdoc/issue-31808.rs
create mode 100644 tests/rustdoc/issue-31899.rs
create mode 100644 tests/rustdoc/issue-32374.rs
create mode 100644 tests/rustdoc/issue-32395.rs
create mode 100644 tests/rustdoc/issue-32556.rs
create mode 100644 tests/rustdoc/issue-32890.rs
create mode 100644 tests/rustdoc/issue-33069.rs
create mode 100644 tests/rustdoc/issue-33178-1.rs
create mode 100644 tests/rustdoc/issue-33178.rs
create mode 100644 tests/rustdoc/issue-33302.rs
create mode 100644 tests/rustdoc/issue-33592.rs
create mode 100644 tests/rustdoc/issue-34025.rs
create mode 100644 tests/rustdoc/issue-34274.rs
create mode 100644 tests/rustdoc/issue-34423.rs
create mode 100644 tests/rustdoc/issue-34473.rs
create mode 100644 tests/rustdoc/issue-34928.rs
create mode 100644 tests/rustdoc/issue-35169-2.rs
create mode 100644 tests/rustdoc/issue-35169.rs
create mode 100644 tests/rustdoc/issue-35488.rs
create mode 100644 tests/rustdoc/issue-36031.rs
create mode 100644 tests/rustdoc/issue-38129.rs
create mode 100644 tests/rustdoc/issue-38219.rs
create mode 100644 tests/rustdoc/issue-40936.rs
create mode 100644 tests/rustdoc/issue-41783.codeblock.html
create mode 100644 tests/rustdoc/issue-41783.rs
create mode 100644 tests/rustdoc/issue-42760.rs
create mode 100644 tests/rustdoc/issue-43153.rs
create mode 100644 tests/rustdoc/issue-43701.rs
create mode 100644 tests/rustdoc/issue-43869.rs
create mode 100644 tests/rustdoc/issue-43893.rs
create mode 100644 tests/rustdoc/issue-45584.rs
create mode 100644 tests/rustdoc/issue-46271.rs
create mode 100644 tests/rustdoc/issue-46377.rs
create mode 100644 tests/rustdoc/issue-46380-2.rs
create mode 100644 tests/rustdoc/issue-46727.rs
create mode 100644 tests/rustdoc/issue-46766.rs
create mode 100644 tests/rustdoc/issue-46767.rs
create mode 100644 tests/rustdoc/issue-46976.rs
create mode 100644 tests/rustdoc/issue-47038.rs
create mode 100644 tests/rustdoc/issue-47197-blank-line-in-doc-block.rs
create mode 100644 tests/rustdoc/issue-47639.rs
create mode 100644 tests/rustdoc/issue-48377.rs
create mode 100644 tests/rustdoc/issue-48414.rs
create mode 100644 tests/rustdoc/issue-50159.rs
create mode 100644 tests/rustdoc/issue-51236.rs
create mode 100644 tests/rustdoc/issue-52873.rs
create mode 100644 tests/rustdoc/issue-53689.rs
create mode 100644 tests/rustdoc/issue-53812.rs
create mode 100644 tests/rustdoc/issue-54478-demo-allocator.rs
create mode 100644 tests/rustdoc/issue-54705.rs
create mode 100644 tests/rustdoc/issue-55001.rs
create mode 100644 tests/rustdoc/issue-55321.rs
create mode 100644 tests/rustdoc/issue-55364.rs
create mode 100644 tests/rustdoc/issue-56701.rs
create mode 100644 tests/rustdoc/issue-56822.rs
create mode 100644 tests/rustdoc/issue-57180.rs
create mode 100644 tests/rustdoc/issue-60482.rs
create mode 100644 tests/rustdoc/issue-60726.rs
create mode 100644 tests/rustdoc/issue-61592.rs
create mode 100644 tests/rustdoc/issue-67851-both.rs
create mode 100644 tests/rustdoc/issue-67851-hidden.rs
create mode 100644 tests/rustdoc/issue-67851-neither.rs
create mode 100644 tests/rustdoc/issue-67851-private.rs
create mode 100644 tests/rustdoc/issue-72340.rs
create mode 100644 tests/rustdoc/issue-73061-cross-crate-opaque-assoc-type.rs
create mode 100644 tests/rustdoc/issue-74083.rs
create mode 100644 tests/rustdoc/issue-75588.rs
create mode 100644 tests/rustdoc/issue-76501.rs
create mode 100644 tests/rustdoc/issue-78673.rs
create mode 100644 tests/rustdoc/issue-78701.rs
create mode 100644 tests/rustdoc/issue-79201.rs
create mode 100644 tests/rustdoc/issue-80233-normalize-auto-trait.rs
create mode 100644 tests/rustdoc/issue-82465-asref-for-and-of-local.rs
create mode 100644 tests/rustdoc/issue-83375-multiple-mods-w-same-name-doc-inline-last-item.rs
create mode 100644 tests/rustdoc/issue-83375-multiple-mods-w-same-name-doc-inline.rs
create mode 100644 tests/rustdoc/issue-85454.rs
create mode 100644 tests/rustdoc/issue-86620.rs
create mode 100644 tests/rustdoc/issue-88600.rs
create mode 100644 tests/rustdoc/issue-89309-heading-levels.rs
create mode 100644 tests/rustdoc/issue-89852.rs
create mode 100644 tests/rustdoc/issue-95633.rs
create mode 100644 tests/rustdoc/issue-95873.rs
create mode 100644 tests/rustdoc/issue-96381.rs
create mode 100644 tests/rustdoc/issue-98697.rs
create mode 100644 tests/rustdoc/issue-99221-multiple-macro-rules-w-same-name-submodule.rs
create mode 100644 tests/rustdoc/issue-99221-multiple-macro-rules-w-same-name.rs
create mode 100644 tests/rustdoc/issue-99221-multiple-structs-w-same-name.rs
create mode 100644 tests/rustdoc/issue-99734-multiple-foreigns-w-same-name.rs
create mode 100644 tests/rustdoc/issue-99734-multiple-mods-w-same-name.rs
create mode 100644 tests/rustdoc/keyword.rs
create mode 100644 tests/rustdoc/legacy-const-generic.rs
create mode 100644 tests/rustdoc/lifetime-name.rs
create mode 100644 tests/rustdoc/line-breaks.rs
create mode 100644 tests/rustdoc/link-assoc-const.rs
create mode 100644 tests/rustdoc/link-title-escape.rs
create mode 100644 tests/rustdoc/local-reexport-doc.rs
create mode 100644 tests/rustdoc/logo-class-default.rs
create mode 100644 tests/rustdoc/logo-class.rs
create mode 100644 tests/rustdoc/macro-document-private-duplicate.rs
create mode 100644 tests/rustdoc/macro-document-private.rs
create mode 100644 tests/rustdoc/macro-generated-macro.macro_linebreak_pre.html
create mode 100644 tests/rustdoc/macro-generated-macro.macro_morestuff_pre.html
create mode 100644 tests/rustdoc/macro-generated-macro.rs
create mode 100644 tests/rustdoc/macro-higher-kinded-function.rs
create mode 100644 tests/rustdoc/macro-in-async-block.rs
create mode 100644 tests/rustdoc/macro-in-closure.rs
create mode 100644 tests/rustdoc/macro-indirect-use.rs
create mode 100644 tests/rustdoc/macro-private-not-documented.rs
create mode 100644 tests/rustdoc/macro_pub_in_module.rs
create mode 100644 tests/rustdoc/macro_rules-matchers.rs
create mode 100644 tests/rustdoc/macros.rs
create mode 100644 tests/rustdoc/manual_impl.rs
create mode 100644 tests/rustdoc/markdown-summaries.rs
create mode 100644 tests/rustdoc/masked.rs
create mode 100644 tests/rustdoc/method-list.rs
create mode 100644 tests/rustdoc/mixing-doc-comments-and-attrs.S1_top-doc.html
create mode 100644 tests/rustdoc/mixing-doc-comments-and-attrs.S2_top-doc.html
create mode 100644 tests/rustdoc/mixing-doc-comments-and-attrs.S3_top-doc.html
create mode 100644 tests/rustdoc/mixing-doc-comments-and-attrs.rs
create mode 100644 tests/rustdoc/mod-stackoverflow.rs
create mode 100644 tests/rustdoc/module-impls.rs
create mode 100644 tests/rustdoc/multiple-import-levels.rs
create mode 100644 tests/rustdoc/must_implement_one_of.rs
create mode 100644 tests/rustdoc/mut-params.rs
create mode 100644 tests/rustdoc/namespaces.rs
create mode 100644 tests/rustdoc/negative-impl-sidebar.rs
create mode 100644 tests/rustdoc/negative-impl.rs
create mode 100644 tests/rustdoc/nested-modules.rs
create mode 100644 tests/rustdoc/no-compiler-reexport.rs
create mode 100644 tests/rustdoc/no-crate-filter.rs
create mode 100644 tests/rustdoc/no-run-still-checks-lints.rs
create mode 100644 tests/rustdoc/no-stack-overflow-25295.rs
create mode 100644 tests/rustdoc/no-unit-struct-field.rs
create mode 100644 tests/rustdoc/no_std-primitive.rs
create mode 100644 tests/rustdoc/normalize-assoc-item.rs
create mode 100644 tests/rustdoc/not-wf-ambiguous-normalization.rs
create mode 100644 tests/rustdoc/nul-error.rs
create mode 100644 tests/rustdoc/playground-arg.rs
create mode 100644 tests/rustdoc/playground-empty.rs
create mode 100644 tests/rustdoc/playground-none.rs
create mode 100644 tests/rustdoc/playground-syntax-error.rs
create mode 100644 tests/rustdoc/playground.rs
create mode 100644 tests/rustdoc/primitive-link.rs
create mode 100644 tests/rustdoc/primitive-reexport.rs
create mode 100644 tests/rustdoc/primitive-reference.rs
create mode 100644 tests/rustdoc/primitive-slice-auto-trait.rs
create mode 100644 tests/rustdoc/primitive-tuple-auto-trait.rs
create mode 100644 tests/rustdoc/primitive-tuple-variadic.rs
create mode 100644 tests/rustdoc/primitive-unit-auto-trait.rs
create mode 100644 tests/rustdoc/primitive.rs
create mode 100644 tests/rustdoc/primitive/no_std.rs
create mode 100644 tests/rustdoc/primitive/primitive-generic-impl.rs
create mode 100644 tests/rustdoc/private-type-alias.rs
create mode 100644 tests/rustdoc/proc-macro.rs
create mode 100644 tests/rustdoc/process-termination.rs
create mode 100644 tests/rustdoc/pub-extern-crate.rs
create mode 100644 tests/rustdoc/pub-method.rs
create mode 100644 tests/rustdoc/pub-use-extern-macros.rs
create mode 100644 tests/rustdoc/range-arg-pattern.rs
create mode 100644 tests/rustdoc/raw-ident-eliminate-r-hashtag.rs
create mode 100644 tests/rustdoc/read-more-unneeded.rs
create mode 100644 tests/rustdoc/recursion1.rs
create mode 100644 tests/rustdoc/recursion2.rs
create mode 100644 tests/rustdoc/recursion3.rs
create mode 100644 tests/rustdoc/recursive-deref-sidebar.rs
create mode 100644 tests/rustdoc/recursive-deref.rs
create mode 100644 tests/rustdoc/redirect-const.rs
create mode 100644 tests/rustdoc/redirect-map-empty.rs
create mode 100644 tests/rustdoc/redirect-map.rs
create mode 100644 tests/rustdoc/redirect-rename.rs
create mode 100644 tests/rustdoc/redirect.rs
create mode 100644 tests/rustdoc/reexport-check.rs
create mode 100644 tests/rustdoc/reexport-dep-foreign-fn.rs
create mode 100644 tests/rustdoc/reexport-doc.rs
create mode 100644 tests/rustdoc/reexport-stability-tags-deprecated-and-portability.rs
create mode 100644 tests/rustdoc/reexport-stability-tags-unstable-and-portability.rs
create mode 100644 tests/rustdoc/reexports-priv.rs
create mode 100644 tests/rustdoc/reexports.rs
create mode 100644 tests/rustdoc/remove-duplicates.rs
create mode 100644 tests/rustdoc/remove-url-from-headings.rs
create mode 100644 tests/rustdoc/return-impl-trait.rs
create mode 100644 tests/rustdoc/rfc-2632-const-trait-impl.rs
create mode 100644 tests/rustdoc/rustc-incoherent-impls.rs
create mode 100644 tests/rustdoc/rustc-macro-crate.rs
create mode 100644 tests/rustdoc/safe-intrinsic.rs
create mode 100644 tests/rustdoc/same-crate-hidden-impl-parameter.rs
create mode 100644 tests/rustdoc/sanitizer-option.rs
create mode 100644 tests/rustdoc/search-index-summaries.rs
create mode 100644 tests/rustdoc/search-index.rs
create mode 100644 tests/rustdoc/short-docblock-codeblock.rs
create mode 100644 tests/rustdoc/short-docblock.rs
create mode 100644 tests/rustdoc/short-line.md
create mode 100644 tests/rustdoc/show-const-contents.rs
create mode 100644 tests/rustdoc/sidebar-all-page.rs
create mode 100644 tests/rustdoc/sidebar-items.rs
create mode 100644 tests/rustdoc/sidebar-link-generation.rs
create mode 100644 tests/rustdoc/sidebar-links-to-foreign-impl.rs
create mode 100644 tests/rustdoc/sized_trait.rs
create mode 100644 tests/rustdoc/slice-links.link_box_generic.html
create mode 100644 tests/rustdoc/slice-links.link_box_u32.html
create mode 100644 tests/rustdoc/slice-links.link_slice_generic.html
create mode 100644 tests/rustdoc/slice-links.link_slice_u32.html
create mode 100644 tests/rustdoc/slice-links.rs
create mode 100644 tests/rustdoc/smart-punct.rs
create mode 100644 tests/rustdoc/smoke.rs
create mode 100644 tests/rustdoc/sort-modules-by-appearance.rs
create mode 100644 tests/rustdoc/source-file.rs
create mode 100644 tests/rustdoc/source-version-separator.rs
create mode 100644 tests/rustdoc/spotlight-from-dependency.odd.html
create mode 100644 tests/rustdoc/spotlight-from-dependency.rs
create mode 100644 tests/rustdoc/src-links-auto-impls.rs
create mode 100644 tests/rustdoc/src-links-external.rs
create mode 100644 tests/rustdoc/src-links.rs
create mode 100644 tests/rustdoc/src-links/compiletest-ignore-dir
create mode 100644 tests/rustdoc/src-links/fizz.rs
create mode 100644 tests/rustdoc/src-links/mod.rs
create mode 100644 tests/rustdoc/stability.rs
create mode 100644 tests/rustdoc/static-root-path.rs
create mode 100644 tests/rustdoc/static.rs
create mode 100644 tests/rustdoc/strip-block-doc-comments-stars.docblock.html
create mode 100644 tests/rustdoc/strip-block-doc-comments-stars.rs
create mode 100644 tests/rustdoc/strip-enum-variant.no-not-shown.html
create mode 100644 tests/rustdoc/strip-enum-variant.rs
create mode 100644 tests/rustdoc/struct-arg-pattern.rs
create mode 100644 tests/rustdoc/struct-field.rs
create mode 100644 tests/rustdoc/struct-implementations-title.rs
create mode 100644 tests/rustdoc/structfields.rs
create mode 100644 tests/rustdoc/synthetic_auto/basic.rs
create mode 100644 tests/rustdoc/synthetic_auto/complex.rs
create mode 100644 tests/rustdoc/synthetic_auto/crate-local.rs
create mode 100644 tests/rustdoc/synthetic_auto/issue-72213-projection-lifetime.rs
create mode 100644 tests/rustdoc/synthetic_auto/lifetimes.rs
create mode 100644 tests/rustdoc/synthetic_auto/manual.rs
create mode 100644 tests/rustdoc/synthetic_auto/negative.rs
create mode 100644 tests/rustdoc/synthetic_auto/nested.rs
create mode 100644 tests/rustdoc/synthetic_auto/no-redundancy.rs
create mode 100644 tests/rustdoc/synthetic_auto/overflow.rs
create mode 100644 tests/rustdoc/synthetic_auto/project.rs
create mode 100644 tests/rustdoc/synthetic_auto/self-referential.rs
create mode 100644 tests/rustdoc/synthetic_auto/static-region.rs
create mode 100644 tests/rustdoc/tab_title.rs
create mode 100644 tests/rustdoc/table-in-docblock.rs
create mode 100644 tests/rustdoc/task-lists.rs
create mode 100644 tests/rustdoc/test-lists.rs
create mode 100644 tests/rustdoc/test-parens.rs
create mode 100644 tests/rustdoc/test-strikethrough.rs
create mode 100644 tests/rustdoc/test_option_check/bar.rs
create mode 100644 tests/rustdoc/test_option_check/test.rs
create mode 100644 tests/rustdoc/thread-local-src.rs
create mode 100644 tests/rustdoc/titles.rs
create mode 100644 tests/rustdoc/toggle-item-contents.rs
create mode 100644 tests/rustdoc/toggle-method.rs
create mode 100644 tests/rustdoc/toggle-trait-fn.rs
create mode 100644 tests/rustdoc/trait-alias-mention.rs
create mode 100644 tests/rustdoc/trait-impl-items-links-and-anchors.rs
create mode 100644 tests/rustdoc/trait-impl.rs
create mode 100644 tests/rustdoc/trait-self-link.rs
create mode 100644 tests/rustdoc/trait-src-link.rs
create mode 100644 tests/rustdoc/trait-visibility.rs
create mode 100644 tests/rustdoc/trait_alias.rs
create mode 100644 tests/rustdoc/traits-in-bodies-private.rs
create mode 100644 tests/rustdoc/traits-in-bodies.rs
create mode 100644 tests/rustdoc/tuple-struct-fields-doc.rs
create mode 100644 tests/rustdoc/tuples.link1_i32.html
create mode 100644 tests/rustdoc/tuples.link1_t.html
create mode 100644 tests/rustdoc/tuples.link2_i32.html
create mode 100644 tests/rustdoc/tuples.link2_t.html
create mode 100644 tests/rustdoc/tuples.link2_tu.html
create mode 100644 tests/rustdoc/tuples.link_unit.html
create mode 100644 tests/rustdoc/tuples.rs
create mode 100644 tests/rustdoc/type-layout-flag-required.rs
create mode 100644 tests/rustdoc/type-layout.rs
create mode 100644 tests/rustdoc/typedef.rs
create mode 100644 tests/rustdoc/unindent.md
create mode 100644 tests/rustdoc/unindent.rs
create mode 100644 tests/rustdoc/union.rs
create mode 100644 tests/rustdoc/unit-return.rs
create mode 100644 tests/rustdoc/universal-impl-trait.rs
create mode 100644 tests/rustdoc/unneeded-trait-implementations-title.rs
create mode 100644 tests/rustdoc/use-attr.rs
create mode 100644 tests/rustdoc/useless_lifetime_bound.rs
create mode 100644 tests/rustdoc/variadic.rs
create mode 100644 tests/rustdoc/version-separator-without-source.rs
create mode 100644 tests/rustdoc/viewpath-rename.rs
create mode 100644 tests/rustdoc/viewpath-self.rs
create mode 100644 tests/rustdoc/visibility.rs
create mode 100644 tests/rustdoc/where-clause-order.rs
create mode 100644 tests/rustdoc/where-sized.rs
create mode 100644 tests/rustdoc/where.SWhere_Simd_item-decl.html
create mode 100644 tests/rustdoc/where.SWhere_TraitWhere_item-decl.html
create mode 100644 tests/rustdoc/where.rs
create mode 100644 tests/rustdoc/whitespace-after-where-clause.enum.html
create mode 100644 tests/rustdoc/whitespace-after-where-clause.enum2.html
create mode 100644 tests/rustdoc/whitespace-after-where-clause.rs
create mode 100644 tests/rustdoc/whitespace-after-where-clause.struct.html
create mode 100644 tests/rustdoc/whitespace-after-where-clause.struct2.html
create mode 100644 tests/rustdoc/whitespace-after-where-clause.trait.html
create mode 100644 tests/rustdoc/whitespace-after-where-clause.trait2.html
create mode 100644 tests/rustdoc/whitespace-after-where-clause.union.html
create mode 100644 tests/rustdoc/whitespace-after-where-clause.union2.html
create mode 100644 tests/rustdoc/without-redirect.rs
create mode 100644 tests/rustdoc/wrapping.rs
(limited to 'tests/rustdoc')
diff --git a/tests/rustdoc/all.rs b/tests/rustdoc/all.rs
new file mode 100644
index 00000000000..4c8d0231095
--- /dev/null
+++ b/tests/rustdoc/all.rs
@@ -0,0 +1,28 @@
+#![crate_name = "foo"]
+
+// @has foo/all.html '//a[@href="struct.Struct.html"]' 'Struct'
+// @has foo/all.html '//a[@href="enum.Enum.html"]' 'Enum'
+// @has foo/all.html '//a[@href="union.Union.html"]' 'Union'
+// @has foo/all.html '//a[@href="constant.CONST.html"]' 'CONST'
+// @has foo/all.html '//a[@href="static.STATIC.html"]' 'STATIC'
+// @has foo/all.html '//a[@href="fn.function.html"]' 'function'
+
+pub struct Struct;
+pub enum Enum {
+ X,
+ Y,
+}
+pub union Union {
+ x: u32,
+}
+pub const CONST: u32 = 0;
+pub static STATIC: &str = "baguette";
+pub fn function() {}
+
+mod private_module {
+ pub struct ReexportedStruct;
+}
+
+// @has foo/all.html '//a[@href="struct.ReexportedStruct.html"]' 'ReexportedStruct'
+// @!hasraw foo/all.html 'private_module'
+pub use private_module::ReexportedStruct;
diff --git a/tests/rustdoc/anchors.no_const_anchor.html b/tests/rustdoc/anchors.no_const_anchor.html
new file mode 100644
index 00000000000..75e67330a3e
--- /dev/null
+++ b/tests/rustdoc/anchors.no_const_anchor.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/rustdoc/anchors.no_const_anchor2.html b/tests/rustdoc/anchors.no_const_anchor2.html
new file mode 100644
index 00000000000..c0025197602
--- /dev/null
+++ b/tests/rustdoc/anchors.no_const_anchor2.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/rustdoc/anchors.no_method_anchor.html b/tests/rustdoc/anchors.no_method_anchor.html
new file mode 100644
index 00000000000..b9ec8bf4c09
--- /dev/null
+++ b/tests/rustdoc/anchors.no_method_anchor.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/rustdoc/anchors.no_trait_method_anchor.html b/tests/rustdoc/anchors.no_trait_method_anchor.html
new file mode 100644
index 00000000000..4308ddad412
--- /dev/null
+++ b/tests/rustdoc/anchors.no_trait_method_anchor.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/rustdoc/anchors.no_tymethod_anchor.html b/tests/rustdoc/anchors.no_tymethod_anchor.html
new file mode 100644
index 00000000000..91eed8a3742
--- /dev/null
+++ b/tests/rustdoc/anchors.no_tymethod_anchor.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/rustdoc/anchors.no_type_anchor.html b/tests/rustdoc/anchors.no_type_anchor.html
new file mode 100644
index 00000000000..2c66d5aa315
--- /dev/null
+++ b/tests/rustdoc/anchors.no_type_anchor.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/rustdoc/anchors.no_type_anchor2.html b/tests/rustdoc/anchors.no_type_anchor2.html
new file mode 100644
index 00000000000..72a1186bf7e
--- /dev/null
+++ b/tests/rustdoc/anchors.no_type_anchor2.html
@@ -0,0 +1 @@
+
diff --git a/tests/rustdoc/anchors.rs b/tests/rustdoc/anchors.rs
new file mode 100644
index 00000000000..034cf8eaf4f
--- /dev/null
+++ b/tests/rustdoc/anchors.rs
@@ -0,0 +1,49 @@
+// This test ensures that anchors are generated in the right places.
+
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+#![crate_name = "foo"]
+
+pub struct Foo;
+
+// @has 'foo/trait.Bar.html'
+pub trait Bar {
+ // There should be no anchors here.
+ // @snapshot no_type_anchor - '//*[@id="associatedtype.T"]'
+ type T;
+ // There should be no anchors here.
+ // @snapshot no_const_anchor - '//*[@id="associatedconstant.YOLO"]'
+ const YOLO: u32;
+
+ // There should be no anchors here.
+ // @snapshot no_tymethod_anchor - '//*[@id="tymethod.foo"]'
+ fn foo();
+ // There should be no anchors here.
+ // @snapshot no_trait_method_anchor - '//*[@id="method.bar"]'
+ fn bar() {}
+}
+
+// @has 'foo/struct.Foo.html'
+impl Bar for Foo {
+ // @has - '//*[@id="associatedtype.T"]/a[@class="anchor"]' ''
+ type T = u32;
+ // @has - '//*[@id="associatedconstant.YOLO"]/a[@class="anchor"]' ''
+ const YOLO: u32 = 0;
+
+ // @has - '//*[@id="method.foo"]/a[@class="anchor"]' ''
+ fn foo() {}
+ // Same check for provided "bar" method.
+ // @has - '//*[@id="method.bar"]/a[@class="anchor"]' ''
+}
+
+impl Foo {
+ // @snapshot no_const_anchor2 - '//*[@id="associatedconstant.X"]'
+ // There should be no anchors here.
+ pub const X: i32 = 0;
+ // @snapshot no_type_anchor2 - '//*[@id="associatedtype.Y"]'
+ // There should be no anchors here.
+ pub type Y = u32;
+ // @snapshot no_method_anchor - '//*[@id="method.new"]'
+ // There should be no anchors here.
+ pub fn new() -> Self { Self }
+}
diff --git a/tests/rustdoc/anonymous-lifetime.rs b/tests/rustdoc/anonymous-lifetime.rs
new file mode 100644
index 00000000000..390ed5a1f93
--- /dev/null
+++ b/tests/rustdoc/anonymous-lifetime.rs
@@ -0,0 +1,28 @@
+// Regression test for https://github.com/rust-lang/rust/issues/84634
+#![crate_name = "foo"]
+
+use std::pin::Pin;
+use std::task::Poll;
+
+pub trait Stream {
+ type Item;
+
+ fn poll_next(mut self: Pin<&mut Self>) -> Poll>;
+ fn size_hint(&self) -> (usize, Option);
+}
+
+// @has 'foo/trait.Stream.html'
+// @has - '//*[@class="code-header"]' 'impl Stream for &mut S'
+impl Stream for &mut S {
+ type Item = S::Item;
+
+ fn poll_next(
+ mut self: Pin<&mut Self>,
+ ) -> Poll> {
+ S::poll_next(Pin::new(&mut **self), cx)
+ }
+
+ fn size_hint(&self) -> (usize, Option) {
+ (**self).size_hint()
+ }
+}
diff --git a/tests/rustdoc/anonymous-reexport.rs b/tests/rustdoc/anonymous-reexport.rs
new file mode 100644
index 00000000000..6b884ff14df
--- /dev/null
+++ b/tests/rustdoc/anonymous-reexport.rs
@@ -0,0 +1,22 @@
+#![crate_name = "foo"]
+
+// This test ensures we don't display anonymous (non-inline) re-exports of public items.
+
+// @has 'foo/index.html'
+// @has - '//*[@id="main-content"]' ''
+// We check that the only "h2" present is for "Bla".
+// @count - '//*[@id="main-content"]/h2' 1
+// @has - '//*[@id="main-content"]/h2' 'Structs'
+// @count - '//*[@id="main-content"]//a[@class="struct"]' 1
+
+mod ext {
+ pub trait Foo {}
+ pub trait Bar {}
+ pub struct S;
+}
+
+pub use crate::ext::Foo as _;
+pub use crate::ext::Bar as _;
+pub use crate::ext::S as _;
+
+pub struct Bla;
diff --git a/tests/rustdoc/array-links.link_box_generic.html b/tests/rustdoc/array-links.link_box_generic.html
new file mode 100644
index 00000000000..3481bb6a025
--- /dev/null
+++ b/tests/rustdoc/array-links.link_box_generic.html
@@ -0,0 +1 @@
+pub fn delta<T>() -> MyBox <[T; 1] >
\ No newline at end of file
diff --git a/tests/rustdoc/array-links.link_box_u32.html b/tests/rustdoc/array-links.link_box_u32.html
new file mode 100644
index 00000000000..e864ae55c9f
--- /dev/null
+++ b/tests/rustdoc/array-links.link_box_u32.html
@@ -0,0 +1 @@
+pub fn gamma() -> MyBox <[u32 ; 1 ]>
\ No newline at end of file
diff --git a/tests/rustdoc/array-links.link_slice_generic.html b/tests/rustdoc/array-links.link_slice_generic.html
new file mode 100644
index 00000000000..f1ca2f59bd7
--- /dev/null
+++ b/tests/rustdoc/array-links.link_slice_generic.html
@@ -0,0 +1 @@
+pub fn beta<T>() -> &'static [T; 1]
\ No newline at end of file
diff --git a/tests/rustdoc/array-links.link_slice_u32.html b/tests/rustdoc/array-links.link_slice_u32.html
new file mode 100644
index 00000000000..c3943e8d321
--- /dev/null
+++ b/tests/rustdoc/array-links.link_slice_u32.html
@@ -0,0 +1 @@
+pub fn alpha() -> &'static [u32 ; 1 ]
\ No newline at end of file
diff --git a/tests/rustdoc/array-links.rs b/tests/rustdoc/array-links.rs
new file mode 100644
index 00000000000..07f92ac51b9
--- /dev/null
+++ b/tests/rustdoc/array-links.rs
@@ -0,0 +1,28 @@
+#![crate_name = "foo"]
+#![no_std]
+
+pub struct MyBox(*const T);
+
+// @has 'foo/fn.alpha.html'
+// @snapshot link_slice_u32 - '//pre[@class="rust fn"]/code'
+pub fn alpha() -> &'static [u32; 1] {
+ loop {}
+}
+
+// @has 'foo/fn.beta.html'
+// @snapshot link_slice_generic - '//pre[@class="rust fn"]/code'
+pub fn beta() -> &'static [T; 1] {
+ loop {}
+}
+
+// @has 'foo/fn.gamma.html'
+// @snapshot link_box_u32 - '//pre[@class="rust fn"]/code'
+pub fn gamma() -> MyBox<[u32; 1]> {
+ loop {}
+}
+
+// @has 'foo/fn.delta.html'
+// @snapshot link_box_generic - '//pre[@class="rust fn"]/code'
+pub fn delta() -> MyBox<[T; 1]> {
+ loop {}
+}
diff --git a/tests/rustdoc/asm-foreign.rs b/tests/rustdoc/asm-foreign.rs
new file mode 100644
index 00000000000..d7550ca5aca
--- /dev/null
+++ b/tests/rustdoc/asm-foreign.rs
@@ -0,0 +1,20 @@
+// Make sure rustdoc accepts asm! for a foreign architecture.
+
+use std::arch::asm;
+
+// @has asm_foreign/fn.aarch64.html
+pub unsafe fn aarch64(a: f64, b: f64) -> f64 {
+ let c;
+ asm!("add {:d}, {:d}, d0", out(vreg) c, in(vreg) a, in("d0") {
+ || {};
+ b
+ });
+ c
+}
+
+// @has asm_foreign/fn.x86.html
+pub unsafe fn x86(a: f64, b: f64) -> f64 {
+ let c;
+ asm!("addsd {}, {}, xmm0", out(xmm_reg) c, in(xmm_reg) a, in("xmm0") b);
+ c
+}
diff --git a/tests/rustdoc/asm-foreign2.rs b/tests/rustdoc/asm-foreign2.rs
new file mode 100644
index 00000000000..87306901eb7
--- /dev/null
+++ b/tests/rustdoc/asm-foreign2.rs
@@ -0,0 +1,11 @@
+// only-aarch64
+// Make sure rustdoc accepts options(att_syntax) asm! on non-x86 targets.
+
+use std::arch::asm;
+
+// @has asm_foreign2/fn.x86.html
+pub unsafe fn x86(x: i64) -> i64 {
+ let y;
+ asm!("movq {}, {}", in(reg) x, out(reg) y, options(att_syntax));
+ y
+}
diff --git a/tests/rustdoc/assoc-consts-version.rs b/tests/rustdoc/assoc-consts-version.rs
new file mode 100644
index 00000000000..6060bc0a6fd
--- /dev/null
+++ b/tests/rustdoc/assoc-consts-version.rs
@@ -0,0 +1,15 @@
+#![crate_name = "foo"]
+
+#![feature(staged_api)]
+
+#![stable(since="1.1.1", feature="rust1")]
+
+#[stable(since="1.1.1", feature="rust1")]
+pub struct SomeStruct;
+
+impl SomeStruct {
+ // @has 'foo/struct.SomeStruct.html' \
+ // '//*[@id="associatedconstant.SOME_CONST"]//span[@class="since"]' '1.1.2'
+ #[stable(since="1.1.2", feature="rust2")]
+ pub const SOME_CONST: usize = 0;
+}
diff --git a/tests/rustdoc/assoc-consts.rs b/tests/rustdoc/assoc-consts.rs
new file mode 100644
index 00000000000..3da19a13e53
--- /dev/null
+++ b/tests/rustdoc/assoc-consts.rs
@@ -0,0 +1,104 @@
+pub trait Foo {
+ // @has assoc_consts/trait.Foo.html '//*[@class="rust trait"]' \
+ // 'const FOO: usize = 13usize;'
+ // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
+ const FOO: usize = 12 + 1;
+ // @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
+ const FOO_NO_DEFAULT: bool;
+ // @!hasraw - FOO_HIDDEN
+ #[doc(hidden)]
+ const FOO_HIDDEN: u8 = 0;
+}
+
+pub struct Bar;
+
+impl Foo for Bar {
+ // @has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Foo for Bar'
+ // @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
+ const FOO: usize = 12;
+ // @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
+ const FOO_NO_DEFAULT: bool = false;
+ // @!hasraw - FOO_HIDDEN
+ #[doc(hidden)]
+ const FOO_HIDDEN: u8 = 0;
+}
+
+impl Bar {
+ // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.BAR"]' \
+ // 'const BAR: usize'
+ pub const BAR: usize = 3;
+
+ // @has - '//*[@id="associatedconstant.BAR_ESCAPED"]' \
+ // "const BAR_ESCAPED: &'static str = \"markup \""
+ pub const BAR_ESCAPED: &'static str = "markup ";
+}
+
+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>"
+ pub const BAZ: Baz<'static, u8, u32> = Baz(321, &[1, 2, 3]);
+}
+
+pub fn f(_: &(ToString + 'static)) {}
+
+impl Bar {
+ // @has assoc_consts/struct.Bar.html '//*[@id="associatedconstant.F"]' \
+ // "const F: fn(_: &(dyn ToString + 'static))"
+ // FIXME(fmease): Hide default lifetime, render "const F: fn(_: &dyn ToString)"
+ pub const F: fn(_: &(ToString + 'static)) = f;
+}
+
+impl Bar {
+ // @!hasraw assoc_consts/struct.Bar.html 'BAR_PRIVATE'
+ const BAR_PRIVATE: char = 'a';
+ // @!hasraw assoc_consts/struct.Bar.html 'BAR_HIDDEN'
+ #[doc(hidden)]
+ pub const BAR_HIDDEN: &'static str = "a";
+}
+
+// @has assoc_consts/trait.Qux.html
+pub trait Qux {
+ // @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8'
+ // @has - '//*[@class="docblock"]' "Docs for QUX0 in trait."
+ /// Docs for QUX0 in trait.
+ const QUX0: u8;
+ // @has - '//*[@id="associatedconstant.QUX1"]' 'const QUX1: i8'
+ // @has - '//*[@class="docblock"]' "Docs for QUX1 in trait."
+ /// Docs for QUX1 in trait.
+ const QUX1: i8;
+ // @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16'
+ // @has - '//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait."
+ /// Docs for QUX_DEFAULT12 in trait.
+ const QUX_DEFAULT0: u16 = 1;
+ // @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16'
+ // @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"]' "Docs for QUX_DEFAULT2 in trait."
+ /// Docs for QUX_DEFAULT2 in trait.
+ const QUX_DEFAULT2: u32 = 3;
+}
+
+// @has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Qux for Bar'
+impl Qux for Bar {
+ // @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8'
+ // @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"]' "Docs for QUX1 in impl."
+ /// Docs for QUX1 in impl.
+ const QUX1: i8 = 5;
+ // @has - '//*[@id="associatedconstant.QUX_DEFAULT0"]' 'const QUX_DEFAULT0: u16'
+ // @has - '//div[@class="impl-items"]//*[@class="docblock"]' "Docs for QUX_DEFAULT12 in trait."
+ const QUX_DEFAULT0: u16 = 6;
+ // @has - '//*[@id="associatedconstant.QUX_DEFAULT1"]' 'const QUX_DEFAULT1: i16'
+ // @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 - '//div[@class="impl-items"]//*[@class="docblock"]' "Docs for QUX_DEFAULT2 in trait."
+}
diff --git a/tests/rustdoc/assoc-item-cast.rs b/tests/rustdoc/assoc-item-cast.rs
new file mode 100644
index 00000000000..a409d64131a
--- /dev/null
+++ b/tests/rustdoc/assoc-item-cast.rs
@@ -0,0 +1,14 @@
+#![crate_name = "foo"]
+
+pub trait Expression {
+ type SqlType;
+}
+
+pub trait AsExpression {
+ type Expression: Expression;
+ fn as_expression(self) -> Self::Expression;
+}
+
+// @has foo/type.AsExprOf.html
+// @has - '//pre[@class="rust typedef"]' 'type AsExprOf- =
- >::Expression;'
+pub type AsExprOf
- =
- >::Expression;
diff --git a/tests/rustdoc/assoc-types.rs b/tests/rustdoc/assoc-types.rs
new file mode 100644
index 00000000000..a9e5b8d0019
--- /dev/null
+++ b/tests/rustdoc/assoc-types.rs
@@ -0,0 +1,37 @@
+#![crate_type="lib"]
+
+// @has assoc_types/trait.Index.html
+pub trait Index
{
+ // @has - '//*[@id="associatedtype.Output"]//h4[@class="code-header"]' 'type Output: ?Sized'
+ type Output: ?Sized;
+ // @has - '//*[@id="tymethod.index"]//h4[@class="code-header"]' \
+ // "fn index<'a>(&'a self, index: I) -> &'a Self::Output"
+ // @has - '//*[@id="tymethod.index"]//h4[@class="code-header"]//a[@href="trait.Index.html#associatedtype.Output"]' \
+ // "Output"
+ fn index<'a>(&'a self, index: I) -> &'a Self::Output;
+}
+
+// @has assoc_types/fn.use_output.html
+// @has - '//*[@class="rust fn"]' '-> &T::Output'
+// @has - '//*[@class="rust fn"]//a[@href="trait.Index.html#associatedtype.Output"]' 'Output'
+pub fn use_output>(obj: &T, index: usize) -> &T::Output {
+ obj.index(index)
+}
+
+pub trait Feed {
+ type Input;
+}
+
+// @has assoc_types/fn.use_input.html
+// @has - '//*[@class="rust fn"]' 'T::Input'
+// @has - '//*[@class="rust fn"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input'
+pub fn use_input(_feed: &T, _element: T::Input) { }
+
+// @has assoc_types/fn.cmp_input.html
+// @has - '//*[@class="rust fn"]' 'where T::Input: PartialEq'
+// @has - '//*[@class="rust fn"]//a[@href="trait.Feed.html#associatedtype.Input"]' 'Input'
+pub fn cmp_input(a: &T::Input, b: &U::Input) -> bool
+ where T::Input: PartialEq
+{
+ a == b
+}
diff --git a/tests/rustdoc/associated-consts.rs b/tests/rustdoc/associated-consts.rs
new file mode 100644
index 00000000000..adb155bb525
--- /dev/null
+++ b/tests/rustdoc/associated-consts.rs
@@ -0,0 +1,51 @@
+#![crate_name = "foo"]
+
+pub trait Trait {
+ const FOO: u32 = 12;
+
+ fn foo();
+}
+
+pub struct Bar;
+
+// @has 'foo/struct.Bar.html'
+// @!has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
+// @!has - '//div[@class="sidebar-elems"]//a' 'FOO'
+impl Trait for Bar {
+ const FOO: u32 = 1;
+
+ fn foo() {}
+}
+
+pub enum Foo {
+ A,
+}
+
+// @has 'foo/enum.Foo.html'
+// @!has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
+// @!has - '//div[@class="sidebar-elems"]//a' 'FOO'
+impl Trait for Foo {
+ const FOO: u32 = 1;
+
+ fn foo() {}
+}
+
+pub struct Baz;
+
+// @has 'foo/struct.Baz.html'
+// @has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
+// @has - '//div[@class="sidebar-elems"]//a' 'FOO'
+impl Baz {
+ pub const FOO: u32 = 42;
+}
+
+pub enum Quux {
+ B,
+}
+
+// @has 'foo/enum.Quux.html'
+// @has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
+// @has - '//div[@class="sidebar-elems"]//a' 'FOO'
+impl Quux {
+ pub const FOO: u32 = 42;
+}
diff --git a/tests/rustdoc/async-fn.rs b/tests/rustdoc/async-fn.rs
new file mode 100644
index 00000000000..af765c51ace
--- /dev/null
+++ b/tests/rustdoc/async-fn.rs
@@ -0,0 +1,95 @@
+// edition:2018
+// @has async_fn/fn.foo.html '//pre[@class="rust fn"]' 'pub async fn foo() -> Option'
+pub async fn foo() -> Option {
+ None
+}
+
+// @has async_fn/fn.bar.html '//pre[@class="rust fn"]' 'pub async fn bar(a: i32, b: i32) -> i32'
+pub async fn bar(a: i32, b: i32) -> i32 {
+ 0
+}
+
+// @has async_fn/fn.baz.html '//pre[@class="rust fn"]' 'pub async fn baz(a: T) -> T'
+pub async fn baz(a: T) -> T {
+ a
+}
+
+// @has async_fn/fn.qux.html '//pre[@class="rust fn"]' 'pub async unsafe fn qux() -> char'
+pub async unsafe fn qux() -> char {
+ '⚠'
+}
+
+// @has async_fn/fn.mut_args.html '//pre[@class="rust fn"]' 'pub async fn mut_args(a: usize)'
+pub async fn mut_args(mut a: usize) {}
+
+// @has async_fn/fn.mut_ref.html '//pre[@class="rust fn"]' 'pub async fn mut_ref(x: i32)'
+pub async fn mut_ref(ref mut x: i32) {}
+
+trait Bar {}
+
+impl Bar for () {}
+
+// @has async_fn/fn.quux.html '//pre[@class="rust fn"]' 'pub async fn quux() -> impl Bar'
+pub async fn quux() -> impl Bar {
+ ()
+}
+
+// @has async_fn/struct.Foo.html
+// @matches - '//h4[@class="code-header"]' 'pub async fn f\(\)$'
+// @matches - '//h4[@class="code-header"]' 'pub async unsafe fn g\(\)$'
+// @matches - '//h4[@class="code-header"]' 'pub async fn mut_self\(self, first: usize\)$'
+pub struct Foo;
+
+impl Foo {
+ pub async fn f() {}
+ pub async unsafe fn g() {}
+ pub async fn mut_self(mut self, mut first: usize) {}
+}
+
+pub trait Pattern<'a> {}
+
+pub trait Trait {}
+// @has async_fn/fn.const_generics.html
+// @has - '//pre[@class="rust fn"]' 'pub async fn const_generics(_: impl Trait)'
+pub async fn const_generics(_: impl Trait) {}
+
+// test that elided lifetimes are properly elided and not displayed as `'_`
+// regression test for #63037
+// @has async_fn/fn.elided.html
+// @has - '//pre[@class="rust fn"]' 'pub async fn elided(foo: &str) -> &str'
+pub async fn elided(foo: &str) -> &str {}
+// This should really be shown as written, but for implementation reasons it's difficult.
+// See `impl Clean for TyKind::Ref`.
+// @has async_fn/fn.user_elided.html
+// @has - '//pre[@class="rust fn"]' 'pub async fn user_elided(foo: &str) -> &str'
+pub async fn user_elided(foo: &'_ str) -> &str {}
+// @has async_fn/fn.static_trait.html
+// @has - '//pre[@class="rust fn"]' 'pub async fn static_trait(foo: &str) -> Box'
+pub async fn static_trait(foo: &str) -> Box {}
+// @has async_fn/fn.lifetime_for_trait.html
+// @has - '//pre[@class="rust fn"]' "pub async fn lifetime_for_trait(foo: &str) -> Box"
+pub async fn lifetime_for_trait(foo: &str) -> Box {}
+// @has async_fn/fn.elided_in_input_trait.html
+// @has - '//pre[@class="rust fn"]' "pub async fn elided_in_input_trait(t: impl Pattern<'_>)"
+pub async fn elided_in_input_trait(t: impl Pattern<'_>) {}
+
+struct AsyncFdReadyGuard<'a, T> { x: &'a T }
+
+impl Foo {
+ // @has async_fn/struct.Foo.html
+ // @has - '//*[@class="method has-srclink"]' 'pub async fn complicated_lifetimes( &self, context: &impl Bar) -> impl Iterator- '
+ pub async fn complicated_lifetimes(&self, context: &impl Bar) -> impl Iterator
- {}
+ // taken from `tokio` as an example of a method that was particularly bad before
+ // @has - '//*[@class="method has-srclink"]' "pub async fn readable
(&self) -> Result, ()>"
+ pub async fn readable(&self) -> Result, ()> {}
+ // @has - '//*[@class="method has-srclink"]' "pub async fn mut_self(&mut self)"
+ pub async fn mut_self(&mut self) {}
+}
+
+// test named lifetimes, just in case
+// @has async_fn/fn.named.html
+// @has - '//pre[@class="rust fn"]' "pub async fn named<'a, 'b>(foo: &'a str) -> &'b str"
+pub async fn named<'a, 'b>(foo: &'a str) -> &'b str {}
+// @has async_fn/fn.named_trait.html
+// @has - '//pre[@class="rust fn"]' "pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b>"
+pub async fn named_trait<'a, 'b>(foo: impl Pattern<'a>) -> impl Pattern<'b> {}
diff --git a/tests/rustdoc/async-move-doctest.rs b/tests/rustdoc/async-move-doctest.rs
new file mode 100644
index 00000000000..2ba61388c9e
--- /dev/null
+++ b/tests/rustdoc/async-move-doctest.rs
@@ -0,0 +1,12 @@
+// compile-flags:--test
+// edition:2018
+
+// Prior to setting the default edition for the doctest pre-parser,
+// this doctest would fail due to a fatal parsing error.
+// see https://github.com/rust-lang/rust/issues/59313
+
+//! ```
+//! fn foo() {
+//! drop(async move {});
+//! }
+//! ```
diff --git a/tests/rustdoc/async-trait-sig.rs b/tests/rustdoc/async-trait-sig.rs
new file mode 100644
index 00000000000..2578bc8f7a1
--- /dev/null
+++ b/tests/rustdoc/async-trait-sig.rs
@@ -0,0 +1,14 @@
+// edition:2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+pub trait Foo {
+ // @has async_trait_sig/trait.Foo.html '//h4[@class="code-header"]' "async fn bar() -> i32"
+ async fn bar() -> i32;
+
+ // @has async_trait_sig/trait.Foo.html '//h4[@class="code-header"]' "async fn baz() -> i32"
+ async fn baz() -> i32 {
+ 1
+ }
+}
diff --git a/tests/rustdoc/async-trait.rs b/tests/rustdoc/async-trait.rs
new file mode 100644
index 00000000000..a473e467473
--- /dev/null
+++ b/tests/rustdoc/async-trait.rs
@@ -0,0 +1,16 @@
+// aux-build:async-trait-dep.rs
+// edition:2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+extern crate async_trait_dep;
+
+pub struct Oink {}
+
+// @has 'async_trait/struct.Oink.html' '//h4[@class="code-header"]' "async fn woof()"
+impl async_trait_dep::Meow for Oink {
+ async fn woof() {
+ todo!()
+ }
+}
diff --git a/tests/rustdoc/attribute-rendering.rs b/tests/rustdoc/attribute-rendering.rs
new file mode 100644
index 00000000000..36e10923c85
--- /dev/null
+++ b/tests/rustdoc/attribute-rendering.rs
@@ -0,0 +1,7 @@
+#![crate_name = "foo"]
+
+// @has 'foo/fn.f.html'
+// @has - //*[@'class="item-decl"]' '#[export_name = "f"] pub fn f()'
+#[export_name = "\
+f"]
+pub fn f() {}
diff --git a/tests/rustdoc/attributes.rs b/tests/rustdoc/attributes.rs
new file mode 100644
index 00000000000..a36dadced87
--- /dev/null
+++ b/tests/rustdoc/attributes.rs
@@ -0,0 +1,13 @@
+#![crate_name = "foo"]
+
+// @has foo/fn.f.html '//*[@class="rust fn"]' '#[no_mangle]'
+#[no_mangle]
+pub extern "C" fn f() {}
+
+// @has foo/fn.g.html '//*[@class="rust fn"]' '#[export_name = "bar"]'
+#[export_name = "bar"]
+pub extern "C" fn g() {}
+
+// @has foo/struct.Repr.html '//*[@class="item-decl"]' '#[repr(C, align(8))]'
+#[repr(C, align(8))]
+pub struct Repr;
diff --git a/tests/rustdoc/auto-impl-for-trait.rs b/tests/rustdoc/auto-impl-for-trait.rs
new file mode 100644
index 00000000000..bc658fbfc8c
--- /dev/null
+++ b/tests/rustdoc/auto-impl-for-trait.rs
@@ -0,0 +1,16 @@
+// Test for https://github.com/rust-lang/rust/issues/48463 issue.
+
+use std::any::Any;
+use std::ops::Deref;
+
+pub struct AnyValue {
+ val: Box,
+}
+
+impl Deref for AnyValue {
+ type Target = Any;
+
+ fn deref(&self) -> &Any {
+ &*self.val
+ }
+}
diff --git a/tests/rustdoc/auto-impl-primitive.rs b/tests/rustdoc/auto-impl-primitive.rs
new file mode 100644
index 00000000000..172333d445d
--- /dev/null
+++ b/tests/rustdoc/auto-impl-primitive.rs
@@ -0,0 +1,10 @@
+#![feature(rustdoc_internals)]
+
+#![crate_name = "foo"]
+
+pub use std::fs::File;
+
+// @has 'foo/primitive.i16.html' '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementation'
+#[doc(primitive = "i16")]
+/// I love poneys!
+mod prim {}
diff --git a/tests/rustdoc/auto-trait-not-send.rs b/tests/rustdoc/auto-trait-not-send.rs
new file mode 100644
index 00000000000..661d905ab63
--- /dev/null
+++ b/tests/rustdoc/auto-trait-not-send.rs
@@ -0,0 +1,8 @@
+#![crate_name = "foo"]
+
+// @has 'foo/struct.Foo.html'
+// @has - '//*[@id="impl-Send-for-Foo"]' 'impl !Send for Foo'
+// @has - '//*[@id="impl-Sync-for-Foo"]' 'impl !Sync for Foo'
+pub struct Foo(*const i8);
+pub trait Whatever: Send {}
+impl Whatever for T {}
diff --git a/tests/rustdoc/auto-traits.rs b/tests/rustdoc/auto-traits.rs
new file mode 100644
index 00000000000..93d4bf2f656
--- /dev/null
+++ b/tests/rustdoc/auto-traits.rs
@@ -0,0 +1,13 @@
+// aux-build:auto-traits.rs
+
+#![feature(auto_traits)]
+
+#![crate_name = "foo"]
+
+extern crate auto_traits;
+
+// @has 'foo/trait.Foo.html' '//pre' 'pub unsafe auto trait Foo'
+pub unsafe auto trait Foo {}
+
+// @has 'foo/trait.Bar.html' '//pre' 'pub unsafe auto trait Bar'
+pub use auto_traits::Bar;
diff --git a/tests/rustdoc/auto_aliases.rs b/tests/rustdoc/auto_aliases.rs
new file mode 100644
index 00000000000..a047c76b637
--- /dev/null
+++ b/tests/rustdoc/auto_aliases.rs
@@ -0,0 +1,6 @@
+#![feature(auto_traits)]
+
+// @has auto_aliases/trait.Bar.html '//*[@data-aliases="auto_aliases::Foo"]' 'impl Bar for Foo'
+pub struct Foo;
+
+pub auto trait Bar {}
diff --git a/tests/rustdoc/auxiliary/all-item-types.rs b/tests/rustdoc/auxiliary/all-item-types.rs
new file mode 100644
index 00000000000..f94bd998717
--- /dev/null
+++ b/tests/rustdoc/auxiliary/all-item-types.rs
@@ -0,0 +1,22 @@
+#![feature(extern_types)]
+
+pub mod foo_mod {}
+extern "C" {
+ pub fn foo_ffn();
+ pub static FOO_FSTATIC: FooStruct;
+ pub type FooFType;
+}
+pub fn foo_fn() {}
+pub trait FooTrait {}
+pub struct FooStruct;
+pub enum FooEnum {}
+pub union FooUnion {
+ x: (),
+}
+pub type FooType = FooStruct;
+pub static FOO_STATIC: FooStruct = FooStruct;
+pub const FOO_CONSTANT: FooStruct = FooStruct;
+#[macro_export]
+macro_rules! foo_macro {
+ () => ();
+}
diff --git a/tests/rustdoc/auxiliary/async-trait-dep.rs b/tests/rustdoc/auxiliary/async-trait-dep.rs
new file mode 100644
index 00000000000..10a55dd0260
--- /dev/null
+++ b/tests/rustdoc/auxiliary/async-trait-dep.rs
@@ -0,0 +1,9 @@
+// edition:2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+pub trait Meow {
+ /// Who's a good dog?
+ async fn woof();
+}
diff --git a/tests/rustdoc/auxiliary/auto-traits.rs b/tests/rustdoc/auxiliary/auto-traits.rs
new file mode 100644
index 00000000000..84976c73bee
--- /dev/null
+++ b/tests/rustdoc/auxiliary/auto-traits.rs
@@ -0,0 +1,3 @@
+#![feature(auto_traits)]
+
+pub unsafe auto trait Bar {}
diff --git a/tests/rustdoc/auxiliary/cross-crate-hidden-assoc-trait-items.rs b/tests/rustdoc/auxiliary/cross-crate-hidden-assoc-trait-items.rs
new file mode 100644
index 00000000000..3baf8a6c07e
--- /dev/null
+++ b/tests/rustdoc/auxiliary/cross-crate-hidden-assoc-trait-items.rs
@@ -0,0 +1,19 @@
+pub trait Tr {
+ type VisibleAssoc;
+ #[doc(hidden)]
+ type HiddenAssoc;
+
+ const VISIBLE_ASSOC: ();
+ #[doc(hidden)]
+ const HIDDEN_ASSOC: ();
+}
+
+pub struct Ty;
+
+impl Tr for Ty {
+ type VisibleAssoc = ();
+ type HiddenAssoc = ();
+
+ const VISIBLE_ASSOC: () = ();
+ const HIDDEN_ASSOC: () = ();
+}
diff --git a/tests/rustdoc/auxiliary/cross-crate-hidden-impl-parameter.rs b/tests/rustdoc/auxiliary/cross-crate-hidden-impl-parameter.rs
new file mode 100644
index 00000000000..15953122280
--- /dev/null
+++ b/tests/rustdoc/auxiliary/cross-crate-hidden-impl-parameter.rs
@@ -0,0 +1,5 @@
+#[doc(hidden)]
+pub enum HiddenType {}
+
+#[doc(hidden)]
+pub trait HiddenTrait {}
diff --git a/tests/rustdoc/auxiliary/elided-lifetime.rs b/tests/rustdoc/auxiliary/elided-lifetime.rs
new file mode 100644
index 00000000000..4f2c93379d8
--- /dev/null
+++ b/tests/rustdoc/auxiliary/elided-lifetime.rs
@@ -0,0 +1,11 @@
+#![crate_name = "bar"]
+
+pub struct Ref<'a>(&'a u32);
+
+pub fn test5(a: &u32) -> Ref {
+ Ref(a)
+}
+
+pub fn test6(a: &u32) -> Ref<'_> {
+ Ref(a)
+}
diff --git a/tests/rustdoc/auxiliary/empty.rs b/tests/rustdoc/auxiliary/empty.rs
new file mode 100644
index 00000000000..d11c69f812a
--- /dev/null
+++ b/tests/rustdoc/auxiliary/empty.rs
@@ -0,0 +1 @@
+// intentionally empty
diff --git a/tests/rustdoc/auxiliary/enum-primitive.rs b/tests/rustdoc/auxiliary/enum-primitive.rs
new file mode 100644
index 00000000000..ed1da253a97
--- /dev/null
+++ b/tests/rustdoc/auxiliary/enum-primitive.rs
@@ -0,0 +1,207 @@
+// Copyright (c) 2015 Anders Kaseorg
+
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// “Software”), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+
+// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+//! This crate exports a macro `enum_from_primitive!` that wraps an
+//! `enum` declaration and automatically adds an implementation of
+//! `num::FromPrimitive` (reexported here), to allow conversion from
+//! primitive integers to the enum. It therefore provides an
+//! alternative to the built-in `#[derive(FromPrimitive)]`, which
+//! requires the unstable `std::num::FromPrimitive` and is disabled in
+//! Rust 1.0.
+//!
+//! # Example
+//!
+//! ```
+//! #[macro_use] extern crate enum_primitive;
+//! extern crate num_traits;
+//! use num_traits::FromPrimitive;
+//!
+//! enum_from_primitive! {
+//! #[derive(Debug, PartialEq)]
+//! enum FooBar {
+//! Foo = 17,
+//! Bar = 42,
+//! Baz,
+//! }
+//! }
+//!
+//! fn main() {
+//! assert_eq!(FooBar::from_i32(17), Some(FooBar::Foo));
+//! assert_eq!(FooBar::from_i32(42), Some(FooBar::Bar));
+//! assert_eq!(FooBar::from_i32(43), Some(FooBar::Baz));
+//! assert_eq!(FooBar::from_i32(91), None);
+//! }
+//! ```
+
+pub mod num_traits {
+ pub trait FromPrimitive: Sized {
+ fn from_i64(n: i64) -> Option;
+ fn from_u64(n: u64) -> Option;
+ }
+}
+
+pub use std::option::Option;
+pub use num_traits::FromPrimitive;
+
+/// Helper macro for internal use by `enum_from_primitive!`.
+#[macro_export]
+macro_rules! enum_from_primitive_impl_ty {
+ ($meth:ident, $ty:ty, $name:ident, $( $variant:ident )*) => {
+ #[allow(non_upper_case_globals, unused)]
+ fn $meth(n: $ty) -> $crate::Option {
+ $( if n == $name::$variant as $ty {
+ $crate::Option::Some($name::$variant)
+ } else )* {
+ $crate::Option::None
+ }
+ }
+ };
+}
+
+/// Helper macro for internal use by `enum_from_primitive!`.
+#[macro_export]
+#[macro_use(enum_from_primitive_impl_ty)]
+macro_rules! enum_from_primitive_impl {
+ ($name:ident, $( $variant:ident )*) => {
+ impl $crate::FromPrimitive for $name {
+ enum_from_primitive_impl_ty! { from_i64, i64, $name, $( $variant )* }
+ enum_from_primitive_impl_ty! { from_u64, u64, $name, $( $variant )* }
+ }
+ };
+}
+
+/// Wrap this macro around an `enum` declaration to get an
+/// automatically generated implementation of `num::FromPrimitive`.
+#[macro_export]
+#[macro_use(enum_from_primitive_impl)]
+macro_rules! enum_from_primitive {
+ (
+ $( #[$enum_attr:meta] )*
+ enum $name:ident {
+ $( $( #[$variant_attr:meta] )* $variant:ident ),+
+ $( = $discriminator:expr, $( $( #[$variant_two_attr:meta] )* $variant_two:ident ),+ )*
+ }
+ ) => {
+ $( #[$enum_attr] )*
+ enum $name {
+ $( $( #[$variant_attr] )* $variant ),+
+ $( = $discriminator, $( $( #[$variant_two_attr] )* $variant_two ),+ )*
+ }
+ enum_from_primitive_impl! { $name, $( $variant )+ $( $( $variant_two )+ )* }
+ };
+
+ (
+ $( #[$enum_attr:meta] )*
+ enum $name:ident {
+ $( $( $( #[$variant_attr:meta] )* $variant:ident ),+ = $discriminator:expr ),*
+ }
+ ) => {
+ $( #[$enum_attr] )*
+ enum $name {
+ $( $( $( #[$variant_attr] )* $variant ),+ = $discriminator ),*
+ }
+ enum_from_primitive_impl! { $name, $( $( $variant )+ )* }
+ };
+
+ (
+ $( #[$enum_attr:meta] )*
+ enum $name:ident {
+ $( $( #[$variant_attr:meta] )* $variant:ident ),+
+ $( = $discriminator:expr, $( $( #[$variant_two_attr:meta] )* $variant_two:ident ),+ )*,
+ }
+ ) => {
+ $( #[$enum_attr] )*
+ enum $name {
+ $( $( #[$variant_attr] )* $variant ),+
+ $( = $discriminator, $( $( #[$variant_two_attr] )* $variant_two ),+ )*,
+ }
+ enum_from_primitive_impl! { $name, $( $variant )+ $( $( $variant_two )+ )* }
+ };
+
+ (
+ $( #[$enum_attr:meta] )*
+ enum $name:ident {
+ $( $( $( #[$variant_attr:meta] )* $variant:ident ),+ = $discriminator:expr ),+,
+ }
+ ) => {
+ $( #[$enum_attr] )*
+ enum $name {
+ $( $( $( #[$variant_attr] )* $variant ),+ = $discriminator ),+,
+ }
+ enum_from_primitive_impl! { $name, $( $( $variant )+ )+ }
+ };
+
+ (
+ $( #[$enum_attr:meta] )*
+ pub enum $name:ident {
+ $( $( #[$variant_attr:meta] )* $variant:ident ),+
+ $( = $discriminator:expr, $( $( #[$variant_two_attr:meta] )* $variant_two:ident ),+ )*
+ }
+ ) => {
+ $( #[$enum_attr] )*
+ pub enum $name {
+ $( $( #[$variant_attr] )* $variant ),+
+ $( = $discriminator, $( $( #[$variant_two_attr] )* $variant_two ),+ )*
+ }
+ enum_from_primitive_impl! { $name, $( $variant )+ $( $( $variant_two )+ )* }
+ };
+
+ (
+ $( #[$enum_attr:meta] )*
+ pub enum $name:ident {
+ $( $( $( #[$variant_attr:meta] )* $variant:ident ),+ = $discriminator:expr ),*
+ }
+ ) => {
+ $( #[$enum_attr] )*
+ pub enum $name {
+ $( $( $( #[$variant_attr] )* $variant ),+ = $discriminator ),*
+ }
+ enum_from_primitive_impl! { $name, $( $( $variant )+ )* }
+ };
+
+ (
+ $( #[$enum_attr:meta] )*
+ pub enum $name:ident {
+ $( $( #[$variant_attr:meta] )* $variant:ident ),+
+ $( = $discriminator:expr, $( $( #[$variant_two_attr:meta] )* $variant_two:ident ),+ )*,
+ }
+ ) => {
+ $( #[$enum_attr] )*
+ pub enum $name {
+ $( $( #[$variant_attr] )* $variant ),+
+ $( = $discriminator, $( $( #[$variant_two_attr] )* $variant_two ),+ )*,
+ }
+ enum_from_primitive_impl! { $name, $( $variant )+ $( $( $variant_two )+ )* }
+ };
+
+ (
+ $( #[$enum_attr:meta] )*
+ pub enum $name:ident {
+ $( $( $( #[$variant_attr:meta] )* $variant:ident ),+ = $discriminator:expr ),+,
+ }
+ ) => {
+ $( #[$enum_attr] )*
+ pub enum $name {
+ $( $( $( #[$variant_attr] )* $variant ),+ = $discriminator ),+,
+ }
+ enum_from_primitive_impl! { $name, $( $( $variant )+ )+ }
+ };
+}
diff --git a/tests/rustdoc/auxiliary/extern-impl-trait.rs b/tests/rustdoc/auxiliary/extern-impl-trait.rs
new file mode 100644
index 00000000000..dbd54393098
--- /dev/null
+++ b/tests/rustdoc/auxiliary/extern-impl-trait.rs
@@ -0,0 +1,27 @@
+pub trait Foo {
+ type Associated;
+}
+
+pub struct X;
+pub struct Y;
+
+
+impl Foo for X {
+ type Associated = ();
+}
+
+impl Foo for Y {
+ type Associated = ();
+}
+
+impl X {
+ pub fn returns_sized<'a>(&'a self) -> impl Foo + 'a {
+ X
+ }
+}
+
+impl Y {
+ pub fn returns_unsized<'a>(&'a self) -> Box + 'a> {
+ Box::new(X)
+ }
+}
diff --git a/tests/rustdoc/auxiliary/extern-links.rs b/tests/rustdoc/auxiliary/extern-links.rs
new file mode 100644
index 00000000000..4a835673a59
--- /dev/null
+++ b/tests/rustdoc/auxiliary/extern-links.rs
@@ -0,0 +1 @@
+pub struct Foo;
diff --git a/tests/rustdoc/auxiliary/external-cross-doc.md b/tests/rustdoc/auxiliary/external-cross-doc.md
new file mode 100644
index 00000000000..d3c85326559
--- /dev/null
+++ b/tests/rustdoc/auxiliary/external-cross-doc.md
@@ -0,0 +1,4 @@
+# Cross-crate imported docs
+
+This file is to make sure `#[doc = include_str!("file.md")]` works when you re-export an item with included
+docs.
diff --git a/tests/rustdoc/auxiliary/external-cross.rs b/tests/rustdoc/auxiliary/external-cross.rs
new file mode 100644
index 00000000000..5de63cdabc6
--- /dev/null
+++ b/tests/rustdoc/auxiliary/external-cross.rs
@@ -0,0 +1,3 @@
+#[deny(missing_docs)]
+#[doc = include_str!("external-cross-doc.md")]
+pub struct NeedMoreDocs;
diff --git a/tests/rustdoc/auxiliary/external-doc.md b/tests/rustdoc/auxiliary/external-doc.md
new file mode 100644
index 00000000000..babde0a05ad
--- /dev/null
+++ b/tests/rustdoc/auxiliary/external-doc.md
@@ -0,0 +1,3 @@
+# External Docs
+
+This file is here to test the `#[doc = include_str!("file")]` attribute.
diff --git a/tests/rustdoc/auxiliary/external-macro-src.rs b/tests/rustdoc/auxiliary/external-macro-src.rs
new file mode 100644
index 00000000000..ce20ca5c91e
--- /dev/null
+++ b/tests/rustdoc/auxiliary/external-macro-src.rs
@@ -0,0 +1,15 @@
+// compile-flags:--remap-path-prefix={{src-base}}=/does-not-exist
+
+#![doc(html_root_url = "https://example.com/")]
+
+#[macro_export]
+macro_rules! make_foo {
+ () => {
+ pub struct Foo;
+ impl Foo {
+ pub fn new() -> Foo {
+ Foo
+ }
+ }
+ }
+}
diff --git a/tests/rustdoc/auxiliary/html_root.rs b/tests/rustdoc/auxiliary/html_root.rs
new file mode 100644
index 00000000000..4eb0b700f8f
--- /dev/null
+++ b/tests/rustdoc/auxiliary/html_root.rs
@@ -0,0 +1,2 @@
+#![doc(html_root_url="https://example.com/html_root")]
+pub fn foo() {}
diff --git a/tests/rustdoc/auxiliary/incoherent-impl-types.rs b/tests/rustdoc/auxiliary/incoherent-impl-types.rs
new file mode 100644
index 00000000000..fc51e42e500
--- /dev/null
+++ b/tests/rustdoc/auxiliary/incoherent-impl-types.rs
@@ -0,0 +1,7 @@
+#![feature(rustc_attrs)]
+
+#[rustc_has_incoherent_inherent_impls]
+pub trait FooTrait {}
+
+#[rustc_has_incoherent_inherent_impls]
+pub struct FooStruct;
diff --git a/tests/rustdoc/auxiliary/inline-default-methods.rs b/tests/rustdoc/auxiliary/inline-default-methods.rs
new file mode 100644
index 00000000000..8a636f44921
--- /dev/null
+++ b/tests/rustdoc/auxiliary/inline-default-methods.rs
@@ -0,0 +1,6 @@
+// compile-flags: -Cmetadata=aux
+
+pub trait Foo {
+ fn bar(&self);
+ fn foo(&mut self) {}
+}
diff --git a/tests/rustdoc/auxiliary/issue-100204-aux.rs b/tests/rustdoc/auxiliary/issue-100204-aux.rs
new file mode 100644
index 00000000000..df1b59069be
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-100204-aux.rs
@@ -0,0 +1,13 @@
+#![crate_name="first"]
+
+pub mod prelude {
+ pub use crate::Bot;
+}
+
+pub struct Bot;
+
+impl Bot {
+ pub fn new() -> Bot {
+ Bot
+ }
+}
diff --git a/tests/rustdoc/auxiliary/issue-13698.rs b/tests/rustdoc/auxiliary/issue-13698.rs
new file mode 100644
index 00000000000..a65ebfe36a4
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-13698.rs
@@ -0,0 +1,8 @@
+// compile-flags: -Cmetadata=aux
+
+pub trait Foo {
+ #[doc(hidden)]
+ fn foo(&self) {}
+}
+
+impl Foo for i32 {}
diff --git a/tests/rustdoc/auxiliary/issue-15318.rs b/tests/rustdoc/auxiliary/issue-15318.rs
new file mode 100644
index 00000000000..695fa58ef1d
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-15318.rs
@@ -0,0 +1,16 @@
+// no-prefer-dynamic
+// compile-flags: -Cmetadata=aux
+#![crate_type = "rlib"]
+#![doc(html_root_url = "http://example.com/")]
+#![feature(lang_items)]
+#![no_std]
+
+#[lang = "eh_personality"]
+fn foo() {}
+
+#[panic_handler]
+fn bar(_: &core::panic::PanicInfo) -> ! { loop {} }
+
+/// dox
+#[doc(primitive = "pointer")]
+pub mod ptr {}
diff --git a/tests/rustdoc/auxiliary/issue-17476.rs b/tests/rustdoc/auxiliary/issue-17476.rs
new file mode 100644
index 00000000000..80c915eb7cf
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-17476.rs
@@ -0,0 +1,7 @@
+// compile-flags: -Cmetadata=aux
+
+#![doc(html_root_url = "http://example.com")]
+
+pub trait Foo {
+ fn foo(&self) {}
+}
diff --git a/tests/rustdoc/auxiliary/issue-19190-3.rs b/tests/rustdoc/auxiliary/issue-19190-3.rs
new file mode 100644
index 00000000000..8c526a89a88
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-19190-3.rs
@@ -0,0 +1,23 @@
+// compile-flags: -Cmetadata=aux
+
+use std::ops::Deref;
+
+pub struct Foo;
+
+impl Deref for Foo {
+ type Target = String;
+ fn deref(&self) -> &String { loop {} }
+}
+
+pub struct Bar;
+pub struct Baz;
+
+impl Baz {
+ pub fn baz(&self) {}
+ pub fn static_baz() {}
+}
+
+impl Deref for Bar {
+ type Target = Baz;
+ fn deref(&self) -> &Baz { loop {} }
+}
diff --git a/tests/rustdoc/auxiliary/issue-20646.rs b/tests/rustdoc/auxiliary/issue-20646.rs
new file mode 100644
index 00000000000..8e16f2de0d9
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-20646.rs
@@ -0,0 +1,7 @@
+// compile-flags: -Cmetadata=aux
+
+pub trait Trait {
+ type Output;
+}
+
+pub fn fun(_: T) where T: Trait {}
diff --git a/tests/rustdoc/auxiliary/issue-20727.rs b/tests/rustdoc/auxiliary/issue-20727.rs
new file mode 100644
index 00000000000..7ffc1985b05
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-20727.rs
@@ -0,0 +1,30 @@
+// compile-flags: -Cmetadata=aux
+
+pub trait Deref {
+ type Target: ?Sized;
+
+ fn deref<'a>(&'a self) -> &'a Self::Target;
+}
+
+pub trait Add {
+ type Output;
+
+ fn add(self, rhs: RHS) -> Self::Output;
+}
+
+
+pub trait Bar {}
+pub trait Deref2 {
+ type Target: Bar;
+
+ fn deref(&self) -> Self::Target;
+}
+
+pub trait Index {
+ type Output: ?Sized;
+ fn index(&self, index: Idx) -> &Self::Output;
+}
+
+pub trait IndexMut: Index {
+ fn index_mut(&mut self, index: Idx) -> &mut Self::Output;
+}
diff --git a/tests/rustdoc/auxiliary/issue-21092.rs b/tests/rustdoc/auxiliary/issue-21092.rs
new file mode 100644
index 00000000000..51ab7de1c54
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-21092.rs
@@ -0,0 +1,12 @@
+// compile-flags: -Cmetadata=aux
+
+pub trait Foo {
+ type Bar;
+ fn foo(&self) {}
+}
+
+pub struct Bar;
+
+impl Foo for Bar {
+ type Bar = i32;
+}
diff --git a/tests/rustdoc/auxiliary/issue-21801.rs b/tests/rustdoc/auxiliary/issue-21801.rs
new file mode 100644
index 00000000000..732612ff000
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-21801.rs
@@ -0,0 +1,9 @@
+// compile-flags: -Cmetadata=aux
+
+pub struct Foo;
+
+impl Foo {
+ pub fn new(f: F) -> Foo where F: FnMut() -> i32 {
+ loop {}
+ }
+}
diff --git a/tests/rustdoc/auxiliary/issue-22025.rs b/tests/rustdoc/auxiliary/issue-22025.rs
new file mode 100644
index 00000000000..5346c0e92bd
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-22025.rs
@@ -0,0 +1,10 @@
+// compile-flags: -Cmetadata=aux
+
+pub mod foo {
+
+ pub trait Foo {}
+ pub struct Bar;
+
+ impl Foo for Bar {}
+
+}
diff --git a/tests/rustdoc/auxiliary/issue-23207-1.rs b/tests/rustdoc/auxiliary/issue-23207-1.rs
new file mode 100644
index 00000000000..8531d5f1acd
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-23207-1.rs
@@ -0,0 +1,3 @@
+pub mod fmt {
+ pub struct Error;
+}
diff --git a/tests/rustdoc/auxiliary/issue-23207-2.rs b/tests/rustdoc/auxiliary/issue-23207-2.rs
new file mode 100644
index 00000000000..b92b1665316
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-23207-2.rs
@@ -0,0 +1,5 @@
+extern crate issue_23207_1;
+
+pub mod fmt {
+ pub use issue_23207_1::fmt::Error;
+}
diff --git a/tests/rustdoc/auxiliary/issue-26606-macro.rs b/tests/rustdoc/auxiliary/issue-26606-macro.rs
new file mode 100644
index 00000000000..d60d32526aa
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-26606-macro.rs
@@ -0,0 +1,4 @@
+#[macro_export]
+macro_rules! make_item (
+ ($name: ident) => (pub const $name: usize = 42;)
+);
diff --git a/tests/rustdoc/auxiliary/issue-27362-aux.rs b/tests/rustdoc/auxiliary/issue-27362-aux.rs
new file mode 100644
index 00000000000..077bdc33e66
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-27362-aux.rs
@@ -0,0 +1,10 @@
+// compile-flags: -Cmetadata=aux
+
+pub const fn foo() {}
+pub const unsafe fn bar() {}
+
+pub struct Foo;
+
+impl Foo {
+ pub const unsafe fn baz() {}
+}
diff --git a/tests/rustdoc/auxiliary/issue-28927-1.rs b/tests/rustdoc/auxiliary/issue-28927-1.rs
new file mode 100644
index 00000000000..688c73428dd
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-28927-1.rs
@@ -0,0 +1,4 @@
+mod detail {
+ pub extern crate issue_28927_2 as inner2;
+}
+pub use detail::inner2 as bar;
diff --git a/tests/rustdoc/auxiliary/issue-28927-2.rs b/tests/rustdoc/auxiliary/issue-28927-2.rs
new file mode 100644
index 00000000000..7c0937fce20
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-28927-2.rs
@@ -0,0 +1 @@
+pub struct Baz;
diff --git a/tests/rustdoc/auxiliary/issue-29584.rs b/tests/rustdoc/auxiliary/issue-29584.rs
new file mode 100644
index 00000000000..a9b8796c0fe
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-29584.rs
@@ -0,0 +1,10 @@
+// compile-flags: -Cmetadata=aux
+
+pub struct Foo;
+
+#[doc(hidden)]
+mod bar {
+ trait Bar {}
+
+ impl Bar for ::Foo {}
+}
diff --git a/tests/rustdoc/auxiliary/issue-30109-1.rs b/tests/rustdoc/auxiliary/issue-30109-1.rs
new file mode 100644
index 00000000000..ca05a6a9076
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-30109-1.rs
@@ -0,0 +1 @@
+pub struct Bar;
diff --git a/tests/rustdoc/auxiliary/issue-34274.rs b/tests/rustdoc/auxiliary/issue-34274.rs
new file mode 100644
index 00000000000..c46660579a8
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-34274.rs
@@ -0,0 +1,3 @@
+extern "C" {
+ pub fn extern_c_fn();
+}
diff --git a/tests/rustdoc/auxiliary/issue-36031.rs b/tests/rustdoc/auxiliary/issue-36031.rs
new file mode 100644
index 00000000000..da688139e34
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-36031.rs
@@ -0,0 +1,9 @@
+pub trait Foo {
+ const FOO: usize;
+}
+
+pub struct Bar;
+
+impl Bar {
+ pub const BAR: usize = 3;
+}
diff --git a/tests/rustdoc/auxiliary/issue-40936.rs b/tests/rustdoc/auxiliary/issue-40936.rs
new file mode 100644
index 00000000000..b921e520173
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-40936.rs
@@ -0,0 +1,5 @@
+pub mod outermod {
+ pub mod innermod {
+ pub use super::*;
+ }
+}
diff --git a/tests/rustdoc/auxiliary/issue-46727.rs b/tests/rustdoc/auxiliary/issue-46727.rs
new file mode 100644
index 00000000000..30dccfa77b5
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-46727.rs
@@ -0,0 +1,7 @@
+// compile-flags: -Cmetadata=aux
+
+pub trait Foo {}
+
+pub struct Bar { x: T }
+
+impl Foo for Bar<[T; 1 + 1 + 1]> {}
diff --git a/tests/rustdoc/auxiliary/issue-48414.rs b/tests/rustdoc/auxiliary/issue-48414.rs
new file mode 100644
index 00000000000..f442ac72212
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-48414.rs
@@ -0,0 +1,5 @@
+/// Woah, this trait links to [OtherTrait](OtherTrait)!
+pub trait SomeTrait {}
+
+/// Woah, this trait links to [SomeTrait](SomeTrait)!
+pub trait OtherTrait {}
diff --git a/tests/rustdoc/auxiliary/issue-53689.rs b/tests/rustdoc/auxiliary/issue-53689.rs
new file mode 100644
index 00000000000..5003c2c00f4
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-53689.rs
@@ -0,0 +1 @@
+pub struct MyStruct;
diff --git a/tests/rustdoc/auxiliary/issue-57180.rs b/tests/rustdoc/auxiliary/issue-57180.rs
new file mode 100644
index 00000000000..4e2f4b87c02
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-57180.rs
@@ -0,0 +1,16 @@
+// compile-flags: -Cmetadata=aux
+
+pub trait Trait {
+}
+
+pub struct Struct
+{
+ _p: ::std::marker::PhantomData,
+}
+
+impl u32>
+Trait for Struct
+ where
+ F: Fn() -> u32,
+{
+}
diff --git a/tests/rustdoc/auxiliary/issue-61592.rs b/tests/rustdoc/auxiliary/issue-61592.rs
new file mode 100644
index 00000000000..6e16a4caf59
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-61592.rs
@@ -0,0 +1,4 @@
+#![crate_name = "foo"]
+
+pub trait FooTrait {}
+pub struct FooStruct;
diff --git a/tests/rustdoc/auxiliary/issue-73061.rs b/tests/rustdoc/auxiliary/issue-73061.rs
new file mode 100644
index 00000000000..e05a3bc6d91
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-73061.rs
@@ -0,0 +1,17 @@
+//edition:2018
+
+#![feature(type_alias_impl_trait)]
+
+pub trait Foo {
+ type X: std::future::Future;
+ fn x(&self) -> Self::X;
+}
+
+pub struct F;
+
+impl Foo for F {
+ type X = impl std::future::Future;
+ fn x(&self) -> Self::X {
+ async {}
+ }
+}
diff --git a/tests/rustdoc/auxiliary/issue-85454.rs b/tests/rustdoc/auxiliary/issue-85454.rs
new file mode 100644
index 00000000000..45664dfc382
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-85454.rs
@@ -0,0 +1,17 @@
+// @has issue_85454/trait.FromResidual.html
+// @has - '//pre[@class="rust trait"]' 'pub trait FromResidual::Residual> { fn from_residual(residual: R) -> Self; }'
+pub trait FromResidual::Residual> {
+ fn from_residual(residual: R) -> Self;
+}
+
+pub trait Try: FromResidual {
+ type Output;
+ type Residual;
+ fn from_output(output: Self::Output) -> Self;
+ fn branch(self) -> ControlFlow;
+}
+
+pub enum ControlFlow {
+ Continue(C),
+ Break(B),
+}
diff --git a/tests/rustdoc/auxiliary/issue-86620-1.rs b/tests/rustdoc/auxiliary/issue-86620-1.rs
new file mode 100644
index 00000000000..f6debf6fb4e
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-86620-1.rs
@@ -0,0 +1,11 @@
+#![crate_name = "issue_86620_1"]
+
+pub trait VZip {
+ fn vzip() -> usize;
+}
+
+impl VZip for T {
+ fn vzip() -> usize {
+ 0
+ }
+}
diff --git a/tests/rustdoc/auxiliary/issue-98697-reexport-with-anonymous-lifetime.rs b/tests/rustdoc/auxiliary/issue-98697-reexport-with-anonymous-lifetime.rs
new file mode 100644
index 00000000000..4e55e7ed576
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-98697-reexport-with-anonymous-lifetime.rs
@@ -0,0 +1,17 @@
+/// When reexporting this function, make sure the anonymous lifetimes are not rendered.
+///
+/// https://github.com/rust-lang/rust/issues/98697
+pub fn repro()
+where
+ F: Fn(&str),
+{
+ unimplemented!()
+}
+
+pub struct Extra;
+
+pub trait MyTrait {
+ fn run() {}
+}
+
+impl MyTrait<&Extra> for Extra {}
diff --git a/tests/rustdoc/auxiliary/issue-99221-aux.rs b/tests/rustdoc/auxiliary/issue-99221-aux.rs
new file mode 100644
index 00000000000..e061e42b29d
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-99221-aux.rs
@@ -0,0 +1,20 @@
+pub struct Option;
+impl Option {
+ pub fn unwrap(self) {}
+}
+
+mod macros {
+ use crate::Option;
+ /// [`Option::unwrap`]
+ #[macro_export]
+ macro_rules! print {
+ () => ()
+ }
+}
+
+mod structs {
+ use crate::Option;
+ /// [`Option::unwrap`]
+ pub struct Print;
+}
+pub use structs::Print;
diff --git a/tests/rustdoc/auxiliary/issue-99734-aux.rs b/tests/rustdoc/auxiliary/issue-99734-aux.rs
new file mode 100644
index 00000000000..234d55efb55
--- /dev/null
+++ b/tests/rustdoc/auxiliary/issue-99734-aux.rs
@@ -0,0 +1,11 @@
+pub struct Option;
+impl Option {
+ pub fn unwrap(self) {}
+}
+
+/// [`Option::unwrap`]
+pub mod task {}
+
+extern "C" {
+ pub fn main() -> std::ffi::c_int;
+}
diff --git a/tests/rustdoc/auxiliary/macro_pub_in_module.rs b/tests/rustdoc/auxiliary/macro_pub_in_module.rs
new file mode 100644
index 00000000000..137b1238600
--- /dev/null
+++ b/tests/rustdoc/auxiliary/macro_pub_in_module.rs
@@ -0,0 +1,13 @@
+// edition:2018
+
+#![feature(decl_macro)]
+#![crate_name = "external_crate"]
+
+pub mod some_module {
+ /* == Make sure the logic is not affected by a re-export == */
+ mod private {
+ pub macro external_macro() {}
+ }
+
+ pub use private::external_macro;
+}
diff --git a/tests/rustdoc/auxiliary/masked.rs b/tests/rustdoc/auxiliary/masked.rs
new file mode 100644
index 00000000000..3d722d5e0c2
--- /dev/null
+++ b/tests/rustdoc/auxiliary/masked.rs
@@ -0,0 +1,14 @@
+#[derive(Clone)]
+pub struct MaskedStruct;
+
+pub trait MaskedTrait {
+ fn masked_method();
+}
+
+impl MaskedTrait for String {
+ fn masked_method() {}
+}
+
+pub trait MaskedBlanketTrait {}
+
+impl MaskedBlanketTrait for T {}
diff --git a/tests/rustdoc/auxiliary/mod-stackoverflow.rs b/tests/rustdoc/auxiliary/mod-stackoverflow.rs
new file mode 100644
index 00000000000..e0b90f180ee
--- /dev/null
+++ b/tests/rustdoc/auxiliary/mod-stackoverflow.rs
@@ -0,0 +1,11 @@
+// compile-flags: -Cmetadata=aux
+
+pub mod tree {
+ pub use tree;
+}
+
+pub mod tree2 {
+ pub mod prelude {
+ pub use tree2;
+ }
+}
diff --git a/tests/rustdoc/auxiliary/no_html_root.rs b/tests/rustdoc/auxiliary/no_html_root.rs
new file mode 100644
index 00000000000..c5c0bc606cd
--- /dev/null
+++ b/tests/rustdoc/auxiliary/no_html_root.rs
@@ -0,0 +1 @@
+pub fn bar() {}
diff --git a/tests/rustdoc/auxiliary/normalize-assoc-item.rs b/tests/rustdoc/auxiliary/normalize-assoc-item.rs
new file mode 100644
index 00000000000..fbd111c3035
--- /dev/null
+++ b/tests/rustdoc/auxiliary/normalize-assoc-item.rs
@@ -0,0 +1,12 @@
+#![crate_name = "inner"]
+pub trait MyTrait {
+ type Y;
+}
+
+impl MyTrait for u32 {
+ type Y = i32;
+}
+
+pub fn foo() -> ::Y {
+ 0
+}
diff --git a/tests/rustdoc/auxiliary/primitive-doc.rs b/tests/rustdoc/auxiliary/primitive-doc.rs
new file mode 100644
index 00000000000..e8da852a57e
--- /dev/null
+++ b/tests/rustdoc/auxiliary/primitive-doc.rs
@@ -0,0 +1,9 @@
+// compile-flags: --crate-type lib --edition 2018
+
+#![feature(no_core)]
+#![no_core]
+
+#[doc(primitive = "usize")]
+/// This is the built-in type `usize`.
+mod usize {
+}
diff --git a/tests/rustdoc/auxiliary/primitive-reexport.rs b/tests/rustdoc/auxiliary/primitive-reexport.rs
new file mode 100644
index 00000000000..b2e9fa43b39
--- /dev/null
+++ b/tests/rustdoc/auxiliary/primitive-reexport.rs
@@ -0,0 +1,8 @@
+// compile-flags: --emit metadata --crate-type lib --edition 2018
+
+#![crate_name = "foo"]
+
+pub mod bar {
+ pub use bool;
+ pub use char as my_char;
+}
diff --git a/tests/rustdoc/auxiliary/pub-extern-crate.rs b/tests/rustdoc/auxiliary/pub-extern-crate.rs
new file mode 100644
index 00000000000..8c89c8d6c76
--- /dev/null
+++ b/tests/rustdoc/auxiliary/pub-extern-crate.rs
@@ -0,0 +1,2 @@
+#![crate_name = "inner"]
+pub struct SomeStruct;
diff --git a/tests/rustdoc/auxiliary/pub-use-extern-macros.rs b/tests/rustdoc/auxiliary/pub-use-extern-macros.rs
new file mode 100644
index 00000000000..7934e07339a
--- /dev/null
+++ b/tests/rustdoc/auxiliary/pub-use-extern-macros.rs
@@ -0,0 +1,21 @@
+#![crate_name="macros"]
+
+#[macro_export]
+macro_rules! foo {
+ () => {};
+}
+
+#[macro_export]
+macro_rules! bar {
+ () => {};
+}
+
+#[macro_export]
+macro_rules! baz {
+ () => {};
+}
+
+#[macro_export]
+macro_rules! quux {
+ () => {};
+}
diff --git a/tests/rustdoc/auxiliary/real_gimli.rs b/tests/rustdoc/auxiliary/real_gimli.rs
new file mode 100644
index 00000000000..80d5c4ba8bb
--- /dev/null
+++ b/tests/rustdoc/auxiliary/real_gimli.rs
@@ -0,0 +1,13 @@
+// aux-build:realcore.rs
+
+#![crate_name = "real_gimli"]
+#![feature(staged_api, extremely_unstable)]
+#![unstable(feature = "rustc_private", issue = "none")]
+
+extern crate realcore;
+
+#[unstable(feature = "rustc_private", issue = "none")]
+pub struct EndianSlice;
+
+#[unstable(feature = "rustc_private", issue = "none")]
+impl realcore::Deref for EndianSlice {}
diff --git a/tests/rustdoc/auxiliary/realcore.rs b/tests/rustdoc/auxiliary/realcore.rs
new file mode 100644
index 00000000000..e0a906df002
--- /dev/null
+++ b/tests/rustdoc/auxiliary/realcore.rs
@@ -0,0 +1,15 @@
+#![crate_name = "realcore"]
+#![feature(staged_api)]
+#![unstable(feature = "extremely_unstable", issue = "none")]
+
+#[unstable(feature = "extremely_unstable_foo", issue = "none")]
+pub struct Foo {}
+
+#[unstable(feature = "extremely_unstable_foo", issue = "none")]
+pub trait Join {}
+
+#[unstable(feature = "extremely_unstable_foo", issue = "none")]
+impl Join for Foo {}
+
+#[stable(feature = "faked_deref", since = "1.47.0")]
+pub trait Deref {}
diff --git a/tests/rustdoc/auxiliary/reexp-stripped.rs b/tests/rustdoc/auxiliary/reexp-stripped.rs
new file mode 100644
index 00000000000..ccc3dc11fd1
--- /dev/null
+++ b/tests/rustdoc/auxiliary/reexp-stripped.rs
@@ -0,0 +1,11 @@
+pub use private::Quz;
+pub use hidden::Bar;
+
+mod private {
+ pub struct Quz;
+}
+
+#[doc(hidden)]
+pub mod hidden {
+ pub struct Bar;
+}
diff --git a/tests/rustdoc/auxiliary/reexport-check.rs b/tests/rustdoc/auxiliary/reexport-check.rs
new file mode 100644
index 00000000000..672ccb1cf0e
--- /dev/null
+++ b/tests/rustdoc/auxiliary/reexport-check.rs
@@ -0,0 +1,2 @@
+/// Docs in original
+pub struct S;
diff --git a/tests/rustdoc/auxiliary/reexport-doc-aux.rs b/tests/rustdoc/auxiliary/reexport-doc-aux.rs
new file mode 100644
index 00000000000..3400717eba1
--- /dev/null
+++ b/tests/rustdoc/auxiliary/reexport-doc-aux.rs
@@ -0,0 +1,5 @@
+pub struct Foo;
+
+impl Foo {
+ pub fn foo() {}
+}
diff --git a/tests/rustdoc/auxiliary/reexports.rs b/tests/rustdoc/auxiliary/reexports.rs
new file mode 100644
index 00000000000..4336993a36e
--- /dev/null
+++ b/tests/rustdoc/auxiliary/reexports.rs
@@ -0,0 +1,66 @@
+#![feature(decl_macro)]
+
+pub macro addr_of($place:expr) {
+ &raw const $place
+}
+
+pub macro addr_of_crate($place:expr) {
+ &raw const $place
+}
+
+pub macro addr_of_super($place:expr) {
+ &raw const $place
+}
+
+pub macro addr_of_self($place:expr) {
+ &raw const $place
+}
+
+pub macro addr_of_local($place:expr) {
+ &raw const $place
+}
+
+pub struct Foo;
+pub struct FooCrate;
+pub struct FooSuper;
+pub struct FooSelf;
+pub struct FooLocal;
+
+pub enum Bar { Foo, }
+pub enum BarCrate { Foo, }
+pub enum BarSuper { Foo, }
+pub enum BarSelf { Foo, }
+pub enum BarLocal { Foo, }
+
+pub fn foo() {}
+pub fn foo_crate() {}
+pub fn foo_super() {}
+pub fn foo_self() {}
+pub fn foo_local() {}
+
+pub type Type = i32;
+pub type TypeCrate = i32;
+pub type TypeSuper = i32;
+pub type TypeSelf = i32;
+pub type TypeLocal = i32;
+
+pub union Union {
+ a: i8,
+ b: i8,
+}
+pub union UnionCrate {
+ a: i8,
+ b: i8,
+}
+pub union UnionSuper {
+ a: i8,
+ b: i8,
+}
+pub union UnionSelf {
+ a: i8,
+ b: i8,
+}
+pub union UnionLocal {
+ a: i8,
+ b: i8,
+}
diff --git a/tests/rustdoc/auxiliary/rustdoc-default-impl.rs b/tests/rustdoc/auxiliary/rustdoc-default-impl.rs
new file mode 100644
index 00000000000..032db3b25e6
--- /dev/null
+++ b/tests/rustdoc/auxiliary/rustdoc-default-impl.rs
@@ -0,0 +1,23 @@
+#![feature(auto_traits)]
+
+pub mod bar {
+ use std::marker;
+
+ pub auto trait Bar {}
+
+ pub trait Foo {
+ fn foo(&self) {}
+ }
+
+ impl Foo {
+ pub fn test(&self) {}
+ }
+
+ pub struct TypeId;
+
+ impl TypeId {
+ pub fn of() -> TypeId {
+ panic!()
+ }
+ }
+}
diff --git a/tests/rustdoc/auxiliary/rustdoc-extern-default-method.rs b/tests/rustdoc/auxiliary/rustdoc-extern-default-method.rs
new file mode 100644
index 00000000000..12934238a8e
--- /dev/null
+++ b/tests/rustdoc/auxiliary/rustdoc-extern-default-method.rs
@@ -0,0 +1,11 @@
+#![crate_type="lib"]
+
+pub trait Trait {
+ fn provided(&self) {}
+}
+
+pub struct Struct;
+
+impl Trait for Struct {
+ fn provided(&self) {}
+}
diff --git a/tests/rustdoc/auxiliary/rustdoc-extern-method.rs b/tests/rustdoc/auxiliary/rustdoc-extern-method.rs
new file mode 100644
index 00000000000..e493048d9da
--- /dev/null
+++ b/tests/rustdoc/auxiliary/rustdoc-extern-method.rs
@@ -0,0 +1,7 @@
+#![crate_type="lib"]
+#![feature(unboxed_closures)]
+
+pub trait Foo {
+ extern "rust-call" fn foo(&self, _: ()) -> i32;
+ extern "rust-call" fn foo_(&self, _: ()) -> i32 { 0 }
+}
diff --git a/tests/rustdoc/auxiliary/rustdoc-ffi.rs b/tests/rustdoc/auxiliary/rustdoc-ffi.rs
new file mode 100644
index 00000000000..b74d190b526
--- /dev/null
+++ b/tests/rustdoc/auxiliary/rustdoc-ffi.rs
@@ -0,0 +1,6 @@
+#![crate_type="lib"]
+
+extern "C" {
+ // @has lib/fn.foreigner.html //pre 'pub unsafe fn foreigner(cold_as_ice: u32)'
+ pub fn foreigner(cold_as_ice: u32);
+}
diff --git a/tests/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs b/tests/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs
new file mode 100644
index 00000000000..135987fc00d
--- /dev/null
+++ b/tests/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs
@@ -0,0 +1,3 @@
+#![feature(auto_traits)]
+
+pub auto trait AnAutoTrait {}
diff --git a/tests/rustdoc/auxiliary/source-code-bar.rs b/tests/rustdoc/auxiliary/source-code-bar.rs
new file mode 100644
index 00000000000..8700d688ef7
--- /dev/null
+++ b/tests/rustdoc/auxiliary/source-code-bar.rs
@@ -0,0 +1,17 @@
+//! just some other file. :)
+
+use crate::Foo;
+
+pub struct Bar {
+ field: Foo,
+}
+
+pub struct Bar2 {
+ field: crate::Foo,
+}
+
+pub mod sub {
+ pub trait Trait {
+ fn tadam() {}
+ }
+}
diff --git a/tests/rustdoc/auxiliary/source_code.rs b/tests/rustdoc/auxiliary/source_code.rs
new file mode 100644
index 00000000000..72a5c1a0ae9
--- /dev/null
+++ b/tests/rustdoc/auxiliary/source_code.rs
@@ -0,0 +1 @@
+pub struct SourceCode;
diff --git a/tests/rustdoc/auxiliary/src-links-external.rs b/tests/rustdoc/auxiliary/src-links-external.rs
new file mode 100644
index 00000000000..4a835673a59
--- /dev/null
+++ b/tests/rustdoc/auxiliary/src-links-external.rs
@@ -0,0 +1 @@
+pub struct Foo;
diff --git a/tests/rustdoc/auxiliary/trait-alias-mention.rs b/tests/rustdoc/auxiliary/trait-alias-mention.rs
new file mode 100644
index 00000000000..6df06c87a09
--- /dev/null
+++ b/tests/rustdoc/auxiliary/trait-alias-mention.rs
@@ -0,0 +1,3 @@
+#![feature(trait_alias)]
+
+pub trait SomeAlias = std::fmt::Debug + std::marker::Copy;
diff --git a/tests/rustdoc/auxiliary/trait-visibility.rs b/tests/rustdoc/auxiliary/trait-visibility.rs
new file mode 100644
index 00000000000..1e8d0b8e02a
--- /dev/null
+++ b/tests/rustdoc/auxiliary/trait-visibility.rs
@@ -0,0 +1,3 @@
+pub trait Bar {
+ fn foo();
+}
diff --git a/tests/rustdoc/auxiliary/unit-return.rs b/tests/rustdoc/auxiliary/unit-return.rs
new file mode 100644
index 00000000000..7b9986162c6
--- /dev/null
+++ b/tests/rustdoc/auxiliary/unit-return.rs
@@ -0,0 +1,3 @@
+pub fn f2(f: F) {}
+
+pub fn f3 () + Clone>(f: F) {}
diff --git a/tests/rustdoc/auxiliary/unstable-trait.rs b/tests/rustdoc/auxiliary/unstable-trait.rs
new file mode 100644
index 00000000000..6f06a6e2656
--- /dev/null
+++ b/tests/rustdoc/auxiliary/unstable-trait.rs
@@ -0,0 +1,26 @@
+#![feature(staged_api)]
+#![stable(feature = "private_general", since = "1.0.0")]
+
+#[unstable(feature = "private_trait", issue = "none")]
+pub trait Bar {}
+
+#[stable(feature = "private_general", since = "1.0.0")]
+pub struct Foo {
+ // nothing
+}
+
+impl Foo {
+ #[stable(feature = "private_general", since = "1.0.0")]
+ pub fn stable_impl() {}
+}
+
+impl Foo {
+ #[unstable(feature = "private_trait", issue = "none")]
+ pub fn bar() {}
+
+ #[stable(feature = "private_general", since = "1.0.0")]
+ pub fn bar2() {}
+}
+
+#[stable(feature = "private_general", since = "1.0.0")]
+impl Bar for Foo {}
diff --git a/tests/rustdoc/auxiliary/variant-struct.rs b/tests/rustdoc/auxiliary/variant-struct.rs
new file mode 100644
index 00000000000..0f3d2e5f1b7
--- /dev/null
+++ b/tests/rustdoc/auxiliary/variant-struct.rs
@@ -0,0 +1,5 @@
+pub enum Foo {
+ Bar {
+ qux: (),
+ }
+}
diff --git a/tests/rustdoc/bad-codeblock-syntax.rs b/tests/rustdoc/bad-codeblock-syntax.rs
new file mode 100644
index 00000000000..9ec089fd7ad
--- /dev/null
+++ b/tests/rustdoc/bad-codeblock-syntax.rs
@@ -0,0 +1,44 @@
+#![allow(rustdoc::invalid_rust_codeblocks)]
+
+// @has bad_codeblock_syntax/fn.foo.html
+// @has - '//*[@class="docblock"]' '\_'
+/// ```
+/// \_
+/// ```
+pub fn foo() {}
+
+// @has bad_codeblock_syntax/fn.bar.html
+// @has - '//*[@class="docblock"]' '`baz::foobar`'
+/// ```
+/// `baz::foobar`
+/// ```
+pub fn bar() {}
+
+// @has bad_codeblock_syntax/fn.quux.html
+// @has - '//*[@class="docblock"]' '\_'
+/// ```rust
+/// \_
+/// ```
+pub fn quux() {}
+
+// @has bad_codeblock_syntax/fn.ok.html
+// @has - '//*[@class="docblock"]' '\_'
+/// ```text
+/// \_
+/// ```
+pub fn ok() {}
+
+// @has bad_codeblock_syntax/fn.escape.html
+// @has - '//*[@class="docblock"]' '\_ '
+/// ```
+/// \_
+///
+/// ```
+pub fn escape() {}
+
+// @has bad_codeblock_syntax/fn.unterminated.html
+// @has - '//*[@class="docblock"]' '"unterminated'
+/// ```
+/// "unterminated
+/// ```
+pub fn unterminated() {}
diff --git a/tests/rustdoc/blanket-reexport-item.rs b/tests/rustdoc/blanket-reexport-item.rs
new file mode 100644
index 00000000000..437f0001fcf
--- /dev/null
+++ b/tests/rustdoc/blanket-reexport-item.rs
@@ -0,0 +1,8 @@
+#![crate_name = "foo"]
+
+// @has foo/struct.S.html '//*[@id="impl-Into%3CU%3E-for-S"]//h3[@class="code-header"]' 'impl Into for T'
+pub struct S2 {}
+mod m {
+ pub struct S {}
+}
+pub use m::*;
diff --git a/tests/rustdoc/bounds-in-multiple-parts.rs b/tests/rustdoc/bounds-in-multiple-parts.rs
new file mode 100644
index 00000000000..279e3c14888
--- /dev/null
+++ b/tests/rustdoc/bounds-in-multiple-parts.rs
@@ -0,0 +1,20 @@
+#![crate_name = "foo"]
+
+pub trait Eq {}
+pub trait Eq2 {}
+
+// Checking that "where predicates" and "generics params" are merged.
+// @has 'foo/trait.T.html'
+// @has - "//*[@id='tymethod.f']/h4" "fn f<'a, 'b, 'c, T>()where Self: Eq, T: Eq + 'a, 'c: 'b + 'a,"
+pub trait T {
+ fn f<'a, 'b, 'c: 'a, T: Eq + 'a>()
+ where Self: Eq, Self: Eq, T: Eq, 'c: 'b;
+}
+
+// Checking that a duplicated "where predicate" is removed.
+// @has 'foo/trait.T2.html'
+// @has - "//*[@id='tymethod.f']/h4" "fn f()where Self: Eq + Eq2, T: Eq2 + Eq,"
+pub trait T2 {
+ fn f()
+ where Self: Eq, Self: Eq2, T: Eq2;
+}
diff --git a/tests/rustdoc/cap-lints.rs b/tests/rustdoc/cap-lints.rs
new file mode 100644
index 00000000000..08a35339680
--- /dev/null
+++ b/tests/rustdoc/cap-lints.rs
@@ -0,0 +1,9 @@
+// This should fail a normal compile due to non_camel_case_types,
+// It should pass a doc-compile as it only needs to type-check and
+// therefore should not concern itself with the lints.
+#[deny(warnings)]
+
+// @has cap_lints/struct.Foo.html //* 'Foo'
+pub struct Foo {
+ field: i32,
+}
diff --git a/tests/rustdoc/cfg-doctest.rs b/tests/rustdoc/cfg-doctest.rs
new file mode 100644
index 00000000000..6a9d26a4bb7
--- /dev/null
+++ b/tests/rustdoc/cfg-doctest.rs
@@ -0,0 +1,6 @@
+// @!has cfg_doctest/struct.SomeStruct.html
+// @!has cfg_doctest/index.html '//a/@href' 'struct.SomeStruct.html'
+
+/// Sneaky, this isn't actually part of docs.
+#[cfg(doctest)]
+pub struct SomeStruct;
diff --git a/tests/rustdoc/cfg_doc_reexport.rs b/tests/rustdoc/cfg_doc_reexport.rs
new file mode 100644
index 00000000000..addb6709db1
--- /dev/null
+++ b/tests/rustdoc/cfg_doc_reexport.rs
@@ -0,0 +1,33 @@
+#![feature(doc_cfg)]
+#![feature(no_core)]
+
+#![crate_name = "foo"]
+#![no_core]
+
+// @has 'foo/index.html'
+// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'foobar'
+// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'bar'
+
+#[doc(cfg(feature = "foobar"))]
+mod imp_priv {
+ // @has 'foo/struct.BarPriv.html'
+ // @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+ // 'Available on crate feature foobar only.'
+ pub struct BarPriv {}
+ impl BarPriv {
+ pub fn test() {}
+ }
+}
+#[doc(cfg(feature = "foobar"))]
+pub use crate::imp_priv::*;
+
+pub mod bar {
+ // @has 'foo/bar/struct.Bar.html'
+ // @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+ // 'Available on crate feature bar only.'
+ #[doc(cfg(feature = "bar"))]
+ pub struct Bar;
+}
+
+#[doc(cfg(feature = "bar"))]
+pub use bar::Bar;
diff --git a/tests/rustdoc/check-source-code-urls-to-def-std.rs b/tests/rustdoc/check-source-code-urls-to-def-std.rs
new file mode 100644
index 00000000000..e12d8445f4f
--- /dev/null
+++ b/tests/rustdoc/check-source-code-urls-to-def-std.rs
@@ -0,0 +1,42 @@
+// compile-flags: -Zunstable-options --generate-link-to-definition
+
+#![crate_name = "foo"]
+
+// @has 'src/foo/check-source-code-urls-to-def-std.rs.html'
+
+fn babar() {}
+
+// @has - '//a[@href="{{channel}}/std/primitive.u32.html"]' 'u32'
+// @has - '//a[@href="{{channel}}/std/primitive.str.html"]' 'str'
+// @has - '//a[@href="{{channel}}/std/primitive.bool.html"]' 'bool'
+// @has - '//a[@href="#7"]' 'babar'
+pub fn foo(a: u32, b: &str, c: String) {
+ let x = 12;
+ let y: bool = true;
+ babar();
+}
+
+macro_rules! yolo { () => {}}
+
+fn bar(a: i32) {}
+
+macro_rules! bar {
+ ($a:ident) => { bar($a) }
+}
+
+macro_rules! data {
+ ($x:expr) => { $x * 2 }
+}
+
+pub fn another_foo() {
+ // This is known limitation: if the macro doesn't generate anything, the visitor
+ // can't find any item or anything that could tell us that it comes from expansion.
+ // @!has - '//a[@href="#19"]' 'yolo!'
+ yolo!();
+ // @has - '//a[@href="{{channel}}/std/macro.eprintln.html"]' 'eprintln!'
+ eprintln!();
+ // @has - '//a[@href="#27-29"]' 'data!'
+ let x = data!(4);
+ // @has - '//a[@href="#23-25"]' 'bar!'
+ bar!(x);
+}
diff --git a/tests/rustdoc/check-source-code-urls-to-def.rs b/tests/rustdoc/check-source-code-urls-to-def.rs
new file mode 100644
index 00000000000..5959f9c7c59
--- /dev/null
+++ b/tests/rustdoc/check-source-code-urls-to-def.rs
@@ -0,0 +1,69 @@
+// compile-flags: -Zunstable-options --generate-link-to-definition
+// aux-build:source_code.rs
+// build-aux-docs
+
+#![feature(rustdoc_internals)]
+
+#![crate_name = "foo"]
+
+extern crate source_code;
+
+// @has 'src/foo/check-source-code-urls-to-def.rs.html'
+
+// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#1-17"]' 'bar'
+#[path = "auxiliary/source-code-bar.rs"]
+pub mod bar;
+
+// @count - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#5"]' 4
+use bar::Bar;
+// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#13"]' 'self'
+// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'Trait'
+use bar::sub::{self, Trait};
+
+pub struct Foo;
+
+impl Foo {
+ fn hello(&self) {}
+}
+
+fn babar() {}
+
+// @has - '//pre[@class="rust"]//a/@href' '/struct.String.html'
+// @has - '//pre[@class="rust"]//a/@href' '/primitive.u32.html'
+// @has - '//pre[@class="rust"]//a/@href' '/primitive.str.html'
+// @count - '//pre[@class="rust"]//a[@href="#23"]' 5
+// @has - '//pre[@class="rust"]//a[@href="../../source_code/struct.SourceCode.html"]' 'source_code::SourceCode'
+pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::SourceCode) {
+ let x = 12;
+ let y: Foo = Foo;
+ let z: Bar = bar::Bar { field: Foo };
+ babar();
+ // @has - '//pre[@class="rust"]//a[@href="#26"]' 'hello'
+ y.hello();
+}
+
+// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'bar::sub::Trait'
+// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'Trait'
+pub fn foo2(t: &T, v: &V, b: bool) {}
+
+pub trait AnotherTrait {}
+pub trait WhyNot {}
+
+// @has - '//pre[@class="rust"]//a[@href="#49"]' 'AnotherTrait'
+// @has - '//pre[@class="rust"]//a[@href="#50"]' 'WhyNot'
+pub fn foo3(t: &T, v: &V)
+where
+ T: AnotherTrait,
+ V: WhyNot
+{}
+
+pub trait AnotherTrait2 {}
+
+// @has - '//pre[@class="rust"]//a[@href="#60"]' 'AnotherTrait2'
+pub fn foo4() {
+ let x: Vec = Vec::new();
+}
+
+// @has - '//pre[@class="rust"]//a[@href="../../foo/primitive.bool.html"]' 'bool'
+#[doc(primitive = "bool")]
+mod whatever {}
diff --git a/tests/rustdoc/check-styled-link.rs b/tests/rustdoc/check-styled-link.rs
new file mode 100644
index 00000000000..ed4a5ea2137
--- /dev/null
+++ b/tests/rustdoc/check-styled-link.rs
@@ -0,0 +1,8 @@
+#![crate_name = "foo"]
+
+pub struct Foo;
+
+// @has foo/struct.Bar.html '//a[@href="struct.Foo.html"]' 'Foo'
+
+/// Code-styled reference to [`Foo`].
+pub struct Bar;
diff --git a/tests/rustdoc/check.rs b/tests/rustdoc/check.rs
new file mode 100644
index 00000000000..1fb4b35ddbe
--- /dev/null
+++ b/tests/rustdoc/check.rs
@@ -0,0 +1,5 @@
+// compile-flags: -Z unstable-options --check
+
+// @!has check/fn.foo.html
+// @!has check/index.html
+pub fn foo() {}
diff --git a/tests/rustdoc/codeblock-title.rs b/tests/rustdoc/codeblock-title.rs
new file mode 100644
index 00000000000..b9b0b0d1abf
--- /dev/null
+++ b/tests/rustdoc/codeblock-title.rs
@@ -0,0 +1,25 @@
+#![crate_name = "foo"]
+
+// @has foo/fn.bar.html '//*[@class="example-wrap compile_fail"]/*[@class="tooltip"]' "ⓘ"
+// @has foo/fn.bar.html '//*[@class="example-wrap ignore"]/*[@class="tooltip"]' "ⓘ"
+// @has foo/fn.bar.html '//*[@class="example-wrap should_panic"]/*[@class="tooltip"]' "ⓘ"
+// @has foo/fn.bar.html '//*[@data-edition="2018"]' "ⓘ"
+
+/// foo
+///
+/// ```compile_fail
+/// foo();
+/// ```
+///
+/// ```ignore (tidy)
+/// goo();
+/// ```
+///
+/// ```should_panic
+/// hoo();
+/// ```
+///
+/// ```edition2018
+/// let x = 0;
+/// ```
+pub fn bar() -> usize { 2 }
diff --git a/tests/rustdoc/comment-in-doctest.rs b/tests/rustdoc/comment-in-doctest.rs
new file mode 100644
index 00000000000..5691d173569
--- /dev/null
+++ b/tests/rustdoc/comment-in-doctest.rs
@@ -0,0 +1,20 @@
+// compile-flags:--test
+
+// comments, both doc comments and regular ones, used to trick rustdoc's doctest parser into
+// thinking that everything after it was part of the regular program. combined with the librustc_ast
+// parser loop failing to detect the manual main function, it would wrap everything in `fn main`,
+// which would cause the doctest to fail as the "extern crate" declaration was no longer valid.
+// oddly enough, it would pass in 2018 if a crate was in the extern prelude. see
+// https://github.com/rust-lang/rust/issues/56727
+
+//! ```
+//! // crate: proc-macro-test
+//! //! this is a test
+//!
+//! // used to pull in proc-macro specific items
+//! extern crate proc_macro;
+//!
+//! use proc_macro::TokenStream;
+//!
+//! # fn main() {}
+//! ```
diff --git a/tests/rustdoc/const-display.rs b/tests/rustdoc/const-display.rs
new file mode 100644
index 00000000000..594501b22b1
--- /dev/null
+++ b/tests/rustdoc/const-display.rs
@@ -0,0 +1,86 @@
+#![crate_name = "foo"]
+
+#![unstable(feature = "humans",
+ reason = "who ever let humans program computers, we're apparently really bad at it",
+ issue = "none")]
+
+#![feature(foo, foo2)]
+#![feature(staged_api)]
+
+// @has 'foo/fn.foo.html' '//pre' 'pub fn foo() -> u32'
+// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
+#[stable(feature = "rust1", since = "1.0.0")]
+#[rustc_const_unstable(feature="foo", issue = "none")]
+pub const fn foo() -> u32 { 42 }
+
+// @has 'foo/fn.foo_unsafe.html' '//pre' 'pub unsafe fn foo_unsafe() -> u32'
+// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
+#[stable(feature = "rust1", since = "1.0.0")]
+#[rustc_const_unstable(feature="foo", issue = "none")]
+pub const unsafe fn foo_unsafe() -> u32 { 42 }
+
+// @has 'foo/fn.foo2.html' '//pre' 'pub const fn foo2() -> u32'
+// @!hasraw - '//span[@class="since"]'
+#[unstable(feature = "humans", issue = "none")]
+pub const fn foo2() -> u32 { 42 }
+
+// @has 'foo/fn.bar2.html' '//pre' 'pub const fn bar2() -> u32'
+// @has - //span '1.0.0 (const: 1.0.0)'
+#[stable(feature = "rust1", since = "1.0.0")]
+#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
+pub const fn bar2() -> u32 { 42 }
+
+
+// @has 'foo/fn.foo2_gated.html' '//pre' 'pub const unsafe fn foo2_gated() -> u32'
+// @!hasraw - '//span[@class="since"]'
+#[unstable(feature = "foo2", issue = "none")]
+pub const unsafe fn foo2_gated() -> u32 { 42 }
+
+// @has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe fn bar2_gated() -> u32'
+// @has - '//span[@class="since"]' '1.0.0 (const: 1.0.0)'
+#[stable(feature = "rust1", since = "1.0.0")]
+#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
+pub const unsafe fn bar2_gated() -> u32 { 42 }
+
+// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32'
+// @!hasraw - '//span[@class="since"]'
+pub const unsafe fn bar_not_gated() -> u32 { 42 }
+
+pub struct Foo;
+
+impl Foo {
+ // @has 'foo/struct.Foo.html' '//*[@id="method.gated"]/h4[@class="code-header"]' 'pub fn gated() -> u32'
+ // @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
+ #[stable(feature = "rust1", since = "1.0.0")]
+ #[rustc_const_unstable(feature="foo", issue = "none")]
+ pub const fn gated() -> u32 { 42 }
+
+ // @has 'foo/struct.Foo.html' '//*[@id="method.gated_unsafe"]/h4[@class="code-header"]' 'pub unsafe fn gated_unsafe() -> u32'
+ // @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
+ #[stable(feature = "rust1", since = "1.0.0")]
+ #[rustc_const_unstable(feature="foo", issue = "none")]
+ pub const unsafe fn gated_unsafe() -> u32 { 42 }
+
+ // @has 'foo/struct.Foo.html' '//*[@id="method.stable_impl"]/h4[@class="code-header"]' 'pub const fn stable_impl() -> u32'
+ // @has - '//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 }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+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$'
+ #[stable(feature = "rust1", since = "1.0.0")]
+ #[rustc_const_stable(feature = "const2", since = "1.2.0")]
+ pub const fn stable_impl() -> u32 { 42 }
+
+ // Show const-stability even for unstable functions.
+ // @matches 'foo/struct.Bar.html' '//span[@class="since"]' '^const: 1.3.0$'
+ #[unstable(feature = "foo2", issue = "none")]
+ #[rustc_const_stable(feature = "const3", since = "1.3.0")]
+ pub const fn const_stable_unstable() -> u32 { 42 }
+}
diff --git a/tests/rustdoc/const-doc.rs b/tests/rustdoc/const-doc.rs
new file mode 100644
index 00000000000..74ab4af61ac
--- /dev/null
+++ b/tests/rustdoc/const-doc.rs
@@ -0,0 +1,19 @@
+use std::marker::PhantomData;
+
+pub struct Foo<'a> {
+ f: PhantomData<&'a u32>,
+}
+
+pub struct ContentType {
+ pub ttype: Foo<'static>,
+ pub subtype: Foo<'static>,
+ pub params: Option>,
+}
+
+impl ContentType {
+ // @has const_doc/struct.ContentType.html
+ // @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/tests/rustdoc/const-fn.rs b/tests/rustdoc/const-fn.rs
new file mode 100644
index 00000000000..28eba849ace
--- /dev/null
+++ b/tests/rustdoc/const-fn.rs
@@ -0,0 +1,16 @@
+#![crate_name = "foo"]
+
+// @has foo/fn.bar.html
+// @has - '//*[@class="rust fn"]' 'pub const fn bar() -> '
+/// foo
+pub const fn bar() -> usize {
+ 2
+}
+
+// @has foo/struct.Foo.html
+// @has - '//*[@class="method has-srclink"]' 'const fn new()'
+pub struct Foo(usize);
+
+impl Foo {
+ pub const fn new() -> Foo { Foo(0) }
+}
diff --git a/tests/rustdoc/const-generics/add-impl.rs b/tests/rustdoc/const-generics/add-impl.rs
new file mode 100644
index 00000000000..6cbae9abebb
--- /dev/null
+++ b/tests/rustdoc/const-generics/add-impl.rs
@@ -0,0 +1,17 @@
+#![crate_name = "foo"]
+
+use std::ops::Add;
+
+// @has foo/struct.Simd.html '//pre[@class="rust struct"]' 'pub struct Simd'
+pub struct Simd {
+ inner: T,
+}
+
+// @has foo/struct.Simd.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl Add> for Simd'
+impl Add for Simd {
+ type Output = Self;
+
+ fn add(self, rhs: Self) -> Self::Output {
+ Self { inner: 0 }
+ }
+}
diff --git a/tests/rustdoc/const-generics/auxiliary/extern_crate.rs b/tests/rustdoc/const-generics/auxiliary/extern_crate.rs
new file mode 100644
index 00000000000..55b632a48f2
--- /dev/null
+++ b/tests/rustdoc/const-generics/auxiliary/extern_crate.rs
@@ -0,0 +1,16 @@
+// edition:2018
+pub fn extern_fn() -> impl Iterator- {
+ [[0; N]; N].iter().copied()
+}
+
+pub struct ExternTy
{
+ pub inner: [u8; N],
+}
+
+pub type TyAlias = ExternTy;
+
+pub trait WTrait {
+ fn hey() -> usize {
+ N + M + P
+ }
+}
diff --git a/tests/rustdoc/const-generics/const-generic-defaults.rs b/tests/rustdoc/const-generics/const-generic-defaults.rs
new file mode 100644
index 00000000000..2693d9b5969
--- /dev/null
+++ b/tests/rustdoc/const-generics/const-generic-defaults.rs
@@ -0,0 +1,5 @@
+#![crate_name = "foo"]
+
+// @has foo/struct.Foo.html '//pre[@class="rust struct"]' \
+// 'pub struct Foo(_);'
+pub struct Foo(T);
diff --git a/tests/rustdoc/const-generics/const-generic-slice.rs b/tests/rustdoc/const-generics/const-generic-slice.rs
new file mode 100644
index 00000000000..4279de91f56
--- /dev/null
+++ b/tests/rustdoc/const-generics/const-generic-slice.rs
@@ -0,0 +1,11 @@
+#![crate_name = "foo"]
+
+pub trait Array {
+ type Item;
+}
+
+// @has foo/trait.Array.html
+// @has - '//*[@class="impl has-srclink"]' 'impl Array for [T; N]'
+impl 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
new file mode 100644
index 00000000000..5bf76e3c469
--- /dev/null
+++ b/tests/rustdoc/const-generics/const-generics-docs.rs
@@ -0,0 +1,128 @@
+// edition:2018
+// aux-build: extern_crate.rs
+#![crate_name = "foo"]
+
+extern crate extern_crate;
+// @has foo/fn.extern_fn.html '//pre[@class="rust fn"]' \
+// 'pub fn extern_fn() -> impl Iterator- '
+pub use extern_crate::extern_fn;
+// @has foo/struct.ExternTy.html '//pre[@class="rust struct"]' \
+// 'pub struct ExternTy
{'
+pub use extern_crate::ExternTy;
+// @has foo/type.TyAlias.html '//pre[@class="rust typedef"]' \
+// 'type TyAlias = ExternTy;'
+pub use extern_crate::TyAlias;
+// @has foo/trait.WTrait.html '//pre[@class="rust trait"]' \
+// 'pub trait WTrait'
+// @has - '//*[@class="rust trait"]' 'fn hey() -> usize'
+pub use extern_crate::WTrait;
+
+// @has foo/trait.Trait.html '//pre[@class="rust trait"]' \
+// 'pub trait Trait'
+// @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"]' \
+// 'impl Trait for [u8; N]'
+pub trait Trait {}
+impl Trait<1> for u8 {}
+impl Trait<2> for u8 {}
+impl Trait<{1 + 2}> for u8 {}
+impl Trait for [u8; N] {}
+
+// @has foo/struct.Foo.html '//pre[@class="rust struct"]' \
+// 'pub struct Foowhere u8: Trait'
+pub struct Foo where u8: Trait;
+// @has foo/struct.Bar.html '//pre[@class="rust struct"]' 'pub struct Bar(_)'
+pub struct Bar([T; N]);
+
+// @has foo/struct.Foo.html '//*[@id="impl-Foo%3CM%3E"]/h3[@class="code-header"]' 'impl Foowhere u8: Trait'
+impl Foo where u8: Trait {
+ // @has - '//*[@id="associatedconstant.FOO_ASSOC"]' 'pub const FOO_ASSOC: usize'
+ pub const FOO_ASSOC: usize = M + 13;
+
+ // @has - '//*[@id="method.hey"]' 'pub fn hey(&self) -> Bar'
+ pub fn hey(&self) -> Bar {
+ Bar([0; N])
+ }
+}
+
+// @has foo/struct.Bar.html '//*[@id="impl-Bar%3Cu8%2C%20M%3E"]/h3[@class="code-header"]' 'impl Bar'
+impl Bar {
+ // @has - '//*[@id="method.hey"]' \
+ // 'pub fn hey(&self) -> Foowhere u8: Trait'
+ pub fn hey(&self) -> Foo where u8: Trait {
+ Foo
+ }
+}
+
+// @has foo/fn.test.html '//pre[@class="rust fn"]' \
+// 'pub fn test() -> impl Traitwhere u8: Trait'
+pub fn test() -> impl Trait where u8: Trait {
+ 2u8
+}
+
+// @has foo/fn.a_sink.html '//pre[@class="rust fn"]' \
+// 'pub async fn a_sink(v: [u8; N]) -> impl Trait'
+pub async fn a_sink(v: [u8; N]) -> impl Trait {
+ v
+}
+
+// @has foo/fn.b_sink.html '//pre[@class="rust fn"]' \
+// 'pub async fn b_sink(_: impl Trait)'
+pub async fn b_sink(_: impl Trait) {}
+
+// @has foo/fn.concrete.html '//pre[@class="rust fn"]' \
+// 'pub fn concrete() -> [u8; 22]'
+pub fn concrete() -> [u8; 3 + std::mem::size_of::() << 1] {
+ Default::default()
+}
+
+// @has foo/type.Faz.html '//pre[@class="rust typedef"]' \
+// 'type Faz = [u8; N];'
+pub type Faz = [u8; N];
+// @has foo/type.Fiz.html '//pre[@class="rust typedef"]' \
+// 'type Fiz = [[u8; N]; 48];'
+pub type Fiz = [[u8; N]; 3 << 4];
+
+macro_rules! define_me {
+ ($t:tt<$q:tt>) => {
+ pub struct $t([u8; $q]);
+ }
+}
+
+// @has foo/struct.Foz.html '//pre[@class="rust struct"]' \
+// 'pub struct Foz(_);'
+define_me!(Foz);
+
+trait Q {
+ const ASSOC: usize;
+}
+
+impl Q for [u8; N] {
+ const ASSOC: usize = N;
+}
+
+// @has foo/fn.q_user.html '//pre[@class="rust fn"]' \
+// '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 '//pre[@class="rust union"]' \
+// 'pub union Union'
+pub union Union {
+ // @has - //pre "pub arr: [u8; N]"
+ pub arr: [u8; N],
+ // @has - //pre "pub another_arr: [(); N]"
+ pub another_arr: [(); N],
+}
+
+// @has foo/enum.Enum.html '//pre[@class="rust enum"]' \
+// 'pub enum Enum'
+pub enum Enum {
+ // @has - //pre "Variant([u8; N])"
+ Variant([u8; N]),
+ // @has - //pre "EmptyVariant"
+ EmptyVariant,
+}
diff --git a/tests/rustdoc/const-generics/const-impl.rs b/tests/rustdoc/const-generics/const-impl.rs
new file mode 100644
index 00000000000..75ee84279be
--- /dev/null
+++ b/tests/rustdoc/const-generics/const-impl.rs
@@ -0,0 +1,37 @@
+#![allow(incomplete_features)]
+#![feature(adt_const_params)]
+#![crate_name = "foo"]
+
+#[derive(PartialEq, Eq)]
+pub enum Order {
+ Sorted,
+ Unsorted,
+}
+
+// @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet'
+// @has foo/struct.VSet.html '//*[@id="impl-Send-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header"]' 'impl Send for VSet'
+// @has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header"]' 'impl Sync for VSet'
+pub struct VSet {
+ inner: Vec,
+}
+
+// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT%2C%20{%20Order%3A%3ASorted%20}%3E"]/h3[@class="code-header"]' 'impl VSet'
+impl VSet {
+ 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 VSet'
+impl VSet {
+ pub fn new() -> Self {
+ Self { inner: Vec::new() }
+ }
+}
+
+pub struct Escape;
+
+// @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 Escapealert("Escape");"#>'
+impl Escapealert("Escape");"#> {
+ pub fn f() {}
+}
diff --git a/tests/rustdoc/const-generics/generic_const_exprs.rs b/tests/rustdoc/const-generics/generic_const_exprs.rs
new file mode 100644
index 00000000000..215ee228eb8
--- /dev/null
+++ b/tests/rustdoc/const-generics/generic_const_exprs.rs
@@ -0,0 +1,7 @@
+#![crate_name = "foo"]
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+// make sure that `ConstEvaluatable` predicates dont cause rustdoc to ICE #77647
+// @has foo/struct.Ice.html '//pre[@class="rust struct"]' \
+// 'pub struct Ice;'
+pub struct Ice where [(); N + 1]:;
diff --git a/tests/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs b/tests/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs
new file mode 100644
index 00000000000..310e89a35c4
--- /dev/null
+++ b/tests/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs
@@ -0,0 +1,18 @@
+#![crate_name = "foo"]
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+// Checking if `Send` is implemented for `Hasher` requires us to evaluate a `ConstEquate` predicate,
+// which previously caused an ICE.
+
+pub struct Hasher {
+ cv_stack: T,
+}
+
+unsafe impl Send for Hasher {}
+
+// @has foo/struct.Foo.html
+// @has - '//h3[@class="code-header"]' 'impl Send for Foo'
+pub struct Foo {
+ hasher: Hasher<[u8; 3]>,
+}
diff --git a/tests/rustdoc/const-generics/type-alias.rs b/tests/rustdoc/const-generics/type-alias.rs
new file mode 100644
index 00000000000..ebda5b19404
--- /dev/null
+++ b/tests/rustdoc/const-generics/type-alias.rs
@@ -0,0 +1,4 @@
+#![crate_name = "foo"]
+
+// @has foo/type.CellIndex.html '//pre[@class="rust typedef"]' 'type CellIndex = [i64; D];'
+pub type CellIndex = [i64; D];
diff --git a/tests/rustdoc/const-underscore.rs b/tests/rustdoc/const-underscore.rs
new file mode 100644
index 00000000000..0d4809409f3
--- /dev/null
+++ b/tests/rustdoc/const-underscore.rs
@@ -0,0 +1,7 @@
+// compile-flags: --document-private-items
+
+// @!has const_underscore/constant._.html
+const _: () = {
+ #[no_mangle]
+ extern "C" fn implementation_detail() {}
+};
diff --git a/tests/rustdoc/const-value-display.rs b/tests/rustdoc/const-value-display.rs
new file mode 100644
index 00000000000..8d95f0de9d0
--- /dev/null
+++ b/tests/rustdoc/const-value-display.rs
@@ -0,0 +1,9 @@
+#![crate_name = "foo"]
+
+// @has 'foo/constant.HOUR_IN_SECONDS.html'
+// @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="item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64'
+pub const NEGATIVE: i64 = -60 * 60;
diff --git a/tests/rustdoc/const.rs b/tests/rustdoc/const.rs
new file mode 100644
index 00000000000..587ad4db478
--- /dev/null
+++ b/tests/rustdoc/const.rs
@@ -0,0 +1,10 @@
+#![crate_type="lib"]
+
+pub struct Foo;
+
+impl Foo {
+ // @has const/struct.Foo.html '//*[@id="method.new"]//h4[@class="code-header"]' 'const unsafe fn new'
+ pub const unsafe fn new() -> Foo {
+ Foo
+ }
+}
diff --git a/tests/rustdoc/constructor-imports.rs b/tests/rustdoc/constructor-imports.rs
new file mode 100644
index 00000000000..26795c27444
--- /dev/null
+++ b/tests/rustdoc/constructor-imports.rs
@@ -0,0 +1,15 @@
+#![crate_name = "foo"]
+
+pub mod a {
+ pub struct Foo;
+ pub enum Bar {
+ Baz,
+ }
+}
+
+// @count 'foo/index.html' '//*[code="pub use a::Foo;"]' 1
+#[doc(no_inline)]
+pub use a::Foo;
+// @count 'foo/index.html' '//*[code="pub use a::Bar::Baz;"]' 1
+#[doc(no_inline)]
+pub use a::Bar::Baz;
diff --git a/tests/rustdoc/crate-version-escape.rs b/tests/rustdoc/crate-version-escape.rs
new file mode 100644
index 00000000000..8413709f15e
--- /dev/null
+++ b/tests/rustdoc/crate-version-escape.rs
@@ -0,0 +1,5 @@
+// compile-flags: --crate-version= -Z unstable-options
+
+#![crate_name = "foo"]
+
+// @has 'foo/index.html' '//li[@class="version"]' 'Version '
diff --git a/tests/rustdoc/crate-version.rs b/tests/rustdoc/crate-version.rs
new file mode 100644
index 00000000000..2592c98530f
--- /dev/null
+++ b/tests/rustdoc/crate-version.rs
@@ -0,0 +1,3 @@
+// compile-flags: --crate-version=1.3.37
+
+// @has 'crate_version/index.html' '//*[@class="version"]' 'Version 1.3.37'
diff --git a/tests/rustdoc/cross-crate-hidden-assoc-trait-items.rs b/tests/rustdoc/cross-crate-hidden-assoc-trait-items.rs
new file mode 100644
index 00000000000..d02bc4fe712
--- /dev/null
+++ b/tests/rustdoc/cross-crate-hidden-assoc-trait-items.rs
@@ -0,0 +1,23 @@
+// Regression test for issue #95717
+// Hide cross-crate `#[doc(hidden)]` associated items in trait impls.
+
+#![crate_name = "dependent"]
+// edition:2021
+// aux-crate:dependency=cross-crate-hidden-assoc-trait-items.rs
+
+// The trait `Tr` contains 2 hidden and 2 visisible associated items.
+// Instead of checking for the absence of the hidden items, check for the presence of the
+// visible items instead and assert that there are *exactly two* associated items
+// (by counting the number of `section`s). This is more robust and future-proof.
+
+// @has dependent/struct.Ty.html
+// @has - '//*[@id="associatedtype.VisibleAssoc"]' 'type VisibleAssoc = ()'
+// @has - '//*[@id="associatedconstant.VISIBLE_ASSOC"]' 'const VISIBLE_ASSOC: ()'
+// @count - '//*[@class="impl-items"]/section' 2
+
+// @has dependent/trait.Tr.html
+// @has - '//*[@id="associatedtype.VisibleAssoc-1"]' 'type VisibleAssoc = ()'
+// @has - '//*[@id="associatedconstant.VISIBLE_ASSOC-1"]' 'const VISIBLE_ASSOC: ()'
+// @count - '//*[@class="impl-items"]/section' 2
+
+pub use dependency::{Tr, Ty};
diff --git a/tests/rustdoc/cross-crate-hidden-impl-parameter.rs b/tests/rustdoc/cross-crate-hidden-impl-parameter.rs
new file mode 100644
index 00000000000..eb2ced2f7f4
--- /dev/null
+++ b/tests/rustdoc/cross-crate-hidden-impl-parameter.rs
@@ -0,0 +1,35 @@
+// Issue #86448: test for cross-crate `doc(hidden)`
+#![crate_name = "foo"]
+
+// aux-build:cross-crate-hidden-impl-parameter.rs
+extern crate cross_crate_hidden_impl_parameter;
+
+pub use ::cross_crate_hidden_impl_parameter::{HiddenType, HiddenTrait}; // OK, not re-exported
+
+pub enum MyLibType {}
+
+// @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CHiddenType%3E"]' 'impl From for MyLibType'
+impl From for MyLibType {
+ fn from(it: HiddenType) -> MyLibType {
+ match it {}
+ }
+}
+
+pub struct T(T);
+
+// @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E"]' 'impl From>>>> for MyLibType'
+impl From>>>> for MyLibType {
+ fn from(it: T>>>) -> MyLibType {
+ todo!()
+ }
+}
+
+// @!has foo/enum.MyLibType.html '//*[@id="impl-HiddenTrait"]' 'impl HiddenTrait for MyLibType'
+impl HiddenTrait for MyLibType {}
+
+// @!has foo/struct.T.html '//*[@id="impl-From%3CMyLibType%3E"]' 'impl From for T>>>'
+impl From for T>>> {
+ fn from(it: MyLibType) -> T>>> {
+ match it {}
+ }
+}
diff --git a/tests/rustdoc/cross-crate-links.rs b/tests/rustdoc/cross-crate-links.rs
new file mode 100644
index 00000000000..7c736a4cc11
--- /dev/null
+++ b/tests/rustdoc/cross-crate-links.rs
@@ -0,0 +1,59 @@
+// aux-build:all-item-types.rs
+// build-aux-docs
+
+#![crate_name = "foo"]
+
+#[macro_use]
+extern crate all_item_types;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/foo_mod/index.html"]' 'foo_mod'
+#[doc(no_inline)]
+pub use all_item_types::foo_mod;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/fn.foo_ffn.html"]' 'foo_ffn'
+#[doc(no_inline)]
+pub use all_item_types::foo_ffn;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/static.FOO_FSTATIC.html"]' 'FOO_FSTATIC'
+#[doc(no_inline)]
+pub use all_item_types::FOO_FSTATIC;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/foreigntype.FooFType.html"]' 'FooFType'
+#[doc(no_inline)]
+pub use all_item_types::FooFType;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/fn.foo_fn.html"]' 'foo_fn'
+#[doc(no_inline)]
+pub use all_item_types::foo_fn;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/trait.FooTrait.html"]' 'FooTrait'
+#[doc(no_inline)]
+pub use all_item_types::FooTrait;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/struct.FooStruct.html"]' 'FooStruct'
+#[doc(no_inline)]
+pub use all_item_types::FooStruct;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/enum.FooEnum.html"]' 'FooEnum'
+#[doc(no_inline)]
+pub use all_item_types::FooEnum;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/union.FooUnion.html"]' 'FooUnion'
+#[doc(no_inline)]
+pub use all_item_types::FooUnion;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/type.FooType.html"]' 'FooType'
+#[doc(no_inline)]
+pub use all_item_types::FooType;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/static.FOO_STATIC.html"]' 'FOO_STATIC'
+#[doc(no_inline)]
+pub use all_item_types::FOO_STATIC;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/constant.FOO_CONSTANT.html"]' 'FOO_CONSTANT'
+#[doc(no_inline)]
+pub use all_item_types::FOO_CONSTANT;
+
+// @has 'foo/index.html' '//a[@href="../all_item_types/macro.foo_macro.html"]' 'foo_macro'
+#[doc(no_inline)]
+pub use all_item_types::foo_macro;
diff --git a/tests/rustdoc/cross-crate-primitive-doc.rs b/tests/rustdoc/cross-crate-primitive-doc.rs
new file mode 100644
index 00000000000..4ba296ee04a
--- /dev/null
+++ b/tests/rustdoc/cross-crate-primitive-doc.rs
@@ -0,0 +1,13 @@
+// aux-build:primitive-doc.rs
+// compile-flags: --extern-html-root-url=primitive_doc=../ -Z unstable-options
+// only-linux
+
+#![feature(no_core)]
+#![no_core]
+
+extern crate primitive_doc;
+
+// @has 'cross_crate_primitive_doc/fn.foo.html' '//a[@href="../primitive_doc/primitive.usize.html"]' 'usize'
+// @has 'cross_crate_primitive_doc/fn.foo.html' '//a[@href="../primitive_doc/primitive.usize.html"]' 'link'
+/// [link](usize)
+pub fn foo() -> usize { 0 }
diff --git a/tests/rustdoc/decl-trailing-whitespace.declaration.html b/tests/rustdoc/decl-trailing-whitespace.declaration.html
new file mode 100644
index 00000000000..02b51b34461
--- /dev/null
+++ b/tests/rustdoc/decl-trailing-whitespace.declaration.html
@@ -0,0 +1,7 @@
+pub trait Write {
+ fn poll_write ( self: Option <String >, cx: &mut Option <String >, buf: &mut [usize ] ) -> Option <Result <usize , Error >>;
+ fn poll_flush ( self: Option <String >, cx: &mut Option <String > ) -> Option <Result <() , Error >>;
+ fn poll_close ( self: Option <String >, cx: &mut Option <String > ) -> Option <Result <() , Error >>;
+
+ fn poll_write_vectored ( self: Option <String >, cx: &mut Option <String >, bufs: &[usize ] ) -> Option <Result <usize , Error >> { ... }
+}
\ No newline at end of file
diff --git a/tests/rustdoc/decl-trailing-whitespace.rs b/tests/rustdoc/decl-trailing-whitespace.rs
new file mode 100644
index 00000000000..e47edc13218
--- /dev/null
+++ b/tests/rustdoc/decl-trailing-whitespace.rs
@@ -0,0 +1,30 @@
+// Regression test for .
+
+#![crate_name = "foo"]
+
+pub struct Error;
+
+// @has 'foo/trait.Write.html'
+
+pub trait Write {
+ // @snapshot 'declaration' - '//*[@class="item-decl"]//code'
+ fn poll_write(
+ self: Option,
+ cx: &mut Option,
+ buf: &mut [usize]
+ ) -> Option>;
+ fn poll_flush(
+ self: Option,
+ cx: &mut Option
+ ) -> Option>;
+ fn poll_close(
+ self: Option,
+ cx: &mut Option,
+ ) -> Option>;
+
+ fn poll_write_vectored(
+ self: Option,
+ cx: &mut Option,
+ bufs: &[usize]
+ ) -> Option> {}
+}
diff --git a/tests/rustdoc/decl_macro.rs b/tests/rustdoc/decl_macro.rs
new file mode 100644
index 00000000000..94ade31b5e5
--- /dev/null
+++ b/tests/rustdoc/decl_macro.rs
@@ -0,0 +1,56 @@
+// compile-flags: --document-private-items
+
+#![feature(decl_macro)]
+
+// @has decl_macro/macro.my_macro.html //pre 'pub macro my_macro() {'
+// @has - //pre '...'
+// @has - //pre '}'
+pub macro my_macro() {
+
+}
+
+// @has decl_macro/macro.my_macro_2.html //pre 'pub macro my_macro_2($($tok:tt)*) {'
+// @has - //pre '...'
+// @has - //pre '}'
+pub macro my_macro_2($($tok:tt)*) {
+
+}
+
+// @has decl_macro/macro.my_macro_multi.html //pre 'pub macro my_macro_multi {'
+// @has - //pre '(_) => { ... },'
+// @has - //pre '($foo:ident . $bar:expr) => { ... },'
+// @has - //pre '($($foo:literal),+) => { ... },'
+// @has - //pre '}'
+pub macro my_macro_multi {
+ (_) => {
+
+ },
+ ($foo:ident . $bar:expr) => {
+
+ },
+ ($($foo:literal),+) => {
+
+ }
+}
+
+// @has decl_macro/macro.by_example_single.html //pre 'pub macro by_example_single($foo:expr) {'
+// @has - //pre '...'
+// @has - //pre '}'
+pub macro by_example_single {
+ ($foo:expr) => {}
+}
+
+mod a {
+ mod b {
+ // @has decl_macro/a/b/macro.by_example_vis.html //pre 'pub(super) macro by_example_vis($foo:expr) {'
+ pub(in super) macro by_example_vis {
+ ($foo:expr) => {}
+ }
+ mod c {
+ // @has decl_macro/a/b/c/macro.by_example_vis_named.html //pre 'pub(in a) macro by_example_vis_named($foo:expr) {'
+ pub(in a) macro by_example_vis_named {
+ ($foo:expr) => {}
+ }
+ }
+ }
+}
diff --git a/tests/rustdoc/decl_macro_priv.rs b/tests/rustdoc/decl_macro_priv.rs
new file mode 100644
index 00000000000..4e1279e34d9
--- /dev/null
+++ b/tests/rustdoc/decl_macro_priv.rs
@@ -0,0 +1,14 @@
+// compile-flags: --document-private-items
+
+#![feature(decl_macro)]
+
+// @has decl_macro_priv/macro.crate_macro.html //pre 'pub(crate) macro crate_macro() {'
+// @has - //pre '...'
+// @has - //pre '}'
+pub(crate) macro crate_macro() {}
+
+// @has decl_macro_priv/macro.priv_macro.html //pre 'macro priv_macro() {'
+// @!has - //pre 'pub macro priv_macro() {'
+// @has - //pre '...'
+// @has - //pre '}'
+macro priv_macro() {}
diff --git a/tests/rustdoc/deep-structures.rs b/tests/rustdoc/deep-structures.rs
new file mode 100644
index 00000000000..cd3b0d3ec97
--- /dev/null
+++ b/tests/rustdoc/deep-structures.rs
@@ -0,0 +1,104 @@
+// This test verifies that we do not hit recursion limit trying to prove auto-trait bounds for
+// reasonably deep structures.
+
+#![crate_type="rlib"]
+
+pub struct A01(A02);
+pub struct A02(A03);
+pub struct A03(A04);
+pub struct A04(A05);
+pub struct A05(A06);
+pub struct A06(A07);
+pub struct A07(A08);
+pub struct A08(A09);
+pub struct A09(A10);
+pub struct A10(A11);
+pub struct A11(A12);
+pub struct A12(A13);
+pub struct A13(A14);
+pub struct A14(A15);
+pub struct A15(A16);
+pub struct A16(A17);
+pub struct A17(A18);
+pub struct A18(A19);
+pub struct A19(A20);
+pub struct A20(A21);
+pub struct A21(A22);
+pub struct A22(A23);
+pub struct A23(A24);
+pub struct A24(A25);
+pub struct A25(A26);
+pub struct A26(A27);
+pub struct A27(A28);
+pub struct A28(A29);
+pub struct A29(A30);
+pub struct A30(A31);
+pub struct A31(A32);
+pub struct A32(A33);
+pub struct A33(A34);
+pub struct A34(A35);
+pub struct A35(A36);
+pub struct A36(A37);
+pub struct A37(A38);
+pub struct A38(A39);
+pub struct A39(A40);
+pub struct A40(A41);
+pub struct A41(A42);
+pub struct A42(A43);
+pub struct A43(A44);
+pub struct A44(A45);
+pub struct A45(A46);
+pub struct A46(A47);
+pub struct A47(A48);
+pub struct A48(A49);
+pub struct A49(A50);
+pub struct A50(A51);
+pub struct A51(A52);
+pub struct A52(A53);
+pub struct A53(A54);
+pub struct A54(A55);
+pub struct A55(A56);
+pub struct A56(A57);
+pub struct A57(A58);
+pub struct A58(A59);
+pub struct A59(A60);
+pub struct A60(A61);
+pub struct A61(A62);
+pub struct A62(A63);
+pub struct A63(A64);
+pub struct A64(A65);
+pub struct A65(A66);
+pub struct A66(A67);
+pub struct A67(A68);
+pub struct A68(A69);
+pub struct A69(A70);
+pub struct A70(A71);
+pub struct A71(A72);
+pub struct A72(A73);
+pub struct A73(A74);
+pub struct A74(A75);
+pub struct A75(A76);
+pub struct A76(A77);
+pub struct A77(A78);
+pub struct A78(A79);
+pub struct A79(A80);
+pub struct A80(A81);
+pub struct A81(A82);
+pub struct A82(A83);
+pub struct A83(A84);
+pub struct A84(A85);
+pub struct A85(A86);
+pub struct A86(A87);
+pub struct A87(A88);
+pub struct A88(A89);
+pub struct A89(A90);
+pub struct A90(A91);
+pub struct A91(A92);
+pub struct A92(A93);
+pub struct A93(A94);
+pub struct A94(A95);
+pub struct A95(A96);
+pub struct A96(A97);
+pub struct A97(A98);
+pub struct A98(A99);
+pub struct A99;
diff --git a/tests/rustdoc/default-impl.rs b/tests/rustdoc/default-impl.rs
new file mode 100644
index 00000000000..f11b3b29b93
--- /dev/null
+++ b/tests/rustdoc/default-impl.rs
@@ -0,0 +1,9 @@
+// aux-build:rustdoc-default-impl.rs
+// ignore-cross-compile
+
+extern crate rustdoc_default_impl as foo;
+
+pub use foo::bar;
+
+pub fn wut() {
+}
diff --git a/tests/rustdoc/default-theme.rs b/tests/rustdoc/default-theme.rs
new file mode 100644
index 00000000000..ecb8f0b3b48
--- /dev/null
+++ b/tests/rustdoc/default-theme.rs
@@ -0,0 +1,7 @@
+// compile-flags: --default-theme ayu
+
+// @has default_theme/index.html
+// @has - '//script[@id="default-settings"]/@data-theme' 'ayu'
+// @has - '//script[@id="default-settings"]/@data-use_system_theme' 'false'
+
+pub fn whatever() {}
diff --git a/tests/rustdoc/default-trait-method-link.rs b/tests/rustdoc/default-trait-method-link.rs
new file mode 100644
index 00000000000..7bcd2a3c149
--- /dev/null
+++ b/tests/rustdoc/default-trait-method-link.rs
@@ -0,0 +1,15 @@
+#![crate_name = "foo"]
+
+// @has foo/trait.Foo.html '//a[@href="trait.Foo.html#tymethod.req"]' 'req'
+// @has foo/trait.Foo.html '//a[@href="trait.Foo.html#method.prov"]' 'prov'
+
+/// Always make sure to implement [`req`], but you don't have to implement [`prov`].
+///
+/// [`req`]: Foo::req
+/// [`prov`]: Foo::prov
+pub trait Foo {
+ /// Required
+ fn req();
+ /// Provided
+ fn prov() {}
+}
diff --git a/tests/rustdoc/default-trait-method.rs b/tests/rustdoc/default-trait-method.rs
new file mode 100644
index 00000000000..6d0e339c48d
--- /dev/null
+++ b/tests/rustdoc/default-trait-method.rs
@@ -0,0 +1,26 @@
+#![feature(min_specialization)]
+
+// @has default_trait_method/trait.Item.html
+// @has - '//*[@id="tymethod.foo"]' 'fn foo()'
+// @!has - '//*[@id="tymethod.foo"]' 'default fn foo()'
+// @has - '//*[@id="tymethod.bar"]' 'fn bar()'
+// @!has - '//*[@id="tymethod.bar"]' 'default fn bar()'
+// @has - '//*[@id="method.baz"]' 'fn baz()'
+// @!has - '//*[@id="method.baz"]' 'default fn baz()'
+pub trait Item {
+ fn foo();
+ fn bar();
+ fn baz() {}
+}
+
+// @has default_trait_method/struct.Foo.html
+// @has - '//*[@id="method.foo"]' 'default fn foo()'
+// @has - '//*[@id="method.bar"]' 'fn bar()'
+// @!has - '//*[@id="method.bar"]' 'default fn bar()'
+// @has - '//*[@id="method.baz"]' 'fn baz()'
+// @!has - '//*[@id="method.baz"]' 'default fn baz()'
+pub struct Foo;
+impl Item for Foo {
+ default fn foo() {}
+ fn bar() {}
+}
diff --git a/tests/rustdoc/deprecated-future-staged-api.rs b/tests/rustdoc/deprecated-future-staged-api.rs
new file mode 100644
index 00000000000..2670e7f5d04
--- /dev/null
+++ b/tests/rustdoc/deprecated-future-staged-api.rs
@@ -0,0 +1,18 @@
+#![feature(staged_api)]
+#![stable(feature = "deprecated-future-staged-api", since = "1.0.0")]
+
+// @has deprecated_future_staged_api/index.html '//*[@class="stab deprecated"]' \
+// 'Deprecation planned'
+// @has deprecated_future_staged_api/struct.S1.html '//*[@class="stab deprecated"]' \
+// 'Deprecating in 99.99.99: effectively never'
+#[deprecated(since = "99.99.99", note = "effectively never")]
+#[stable(feature = "deprecated-future-staged-api", since = "1.0.0")]
+pub struct S1;
+
+// @has deprecated_future_staged_api/index.html '//*[@class="stab deprecated"]' \
+// 'Deprecation planned'
+// @has deprecated_future_staged_api/struct.S2.html '//*[@class="stab deprecated"]' \
+// 'Deprecating in a future Rust version: literally never'
+#[deprecated(since = "TBD", note = "literally never")]
+#[stable(feature = "deprecated-future-staged-api", since = "1.0.0")]
+pub struct S2;
diff --git a/tests/rustdoc/deprecated-future.rs b/tests/rustdoc/deprecated-future.rs
new file mode 100644
index 00000000000..7db8cc60281
--- /dev/null
+++ b/tests/rustdoc/deprecated-future.rs
@@ -0,0 +1,6 @@
+// @has deprecated_future/index.html '//*[@class="stab deprecated"]' \
+// 'Deprecated'
+// @has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \
+// 'Deprecated since 99.99.99: effectively never'
+#[deprecated(since = "99.99.99", note = "effectively never")]
+pub struct S;
diff --git a/tests/rustdoc/deprecated-impls.rs b/tests/rustdoc/deprecated-impls.rs
new file mode 100644
index 00000000000..e419d2631f6
--- /dev/null
+++ b/tests/rustdoc/deprecated-impls.rs
@@ -0,0 +1,118 @@
+#![crate_name = "foo"]
+
+// @has foo/struct.Foo0.html
+pub struct Foo0;
+
+impl Foo0 {
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.1: fn_with_doc'
+ // @hasraw - 'fn_with_doc short'
+ // @hasraw - 'fn_with_doc full'
+ /// fn_with_doc short
+ ///
+ /// fn_with_doc full
+ #[deprecated(since = "1.0.1", note = "fn_with_doc")]
+ pub fn fn_with_doc() {}
+
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.2: fn_without_doc'
+ #[deprecated(since = "1.0.2", note = "fn_without_doc")]
+ pub fn fn_without_doc() {}
+}
+
+pub trait Bar {
+ /// fn_empty_with_doc short
+ ///
+ /// fn_empty_with_doc full
+ #[deprecated(since = "1.0.3", note = "fn_empty_with_doc")]
+ fn fn_empty_with_doc();
+
+ #[deprecated(since = "1.0.4", note = "fn_empty_without_doc")]
+ fn fn_empty_without_doc();
+
+ /// fn_def_with_doc short
+ ///
+ /// fn_def_with_doc full
+ #[deprecated(since = "1.0.5", note = "fn_def_with_doc")]
+ fn fn_def_with_doc() {}
+
+ #[deprecated(since = "1.0.6", note = "fn_def_without_doc")]
+ fn fn_def_without_doc() {}
+
+ /// fn_def_def_with_doc short
+ ///
+ /// fn_def_def_with_doc full
+ #[deprecated(since = "1.0.7", note = "fn_def_def_with_doc")]
+ fn fn_def_def_with_doc() {}
+
+ #[deprecated(since = "1.0.8", note = "fn_def_def_without_doc")]
+ fn fn_def_def_without_doc() {}
+}
+
+// @has foo/struct.Foo1.html
+pub struct Foo1;
+
+impl Bar for Foo1 {
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
+ // @hasraw - 'fn_empty_with_doc_impl short'
+ // @hasraw - 'fn_empty_with_doc_impl full'
+ /// fn_empty_with_doc_impl short
+ ///
+ /// fn_empty_with_doc_impl full
+ fn fn_empty_with_doc() {}
+
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
+ fn fn_empty_without_doc() {}
+
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
+ // @hasraw - 'fn_def_with_doc_impl short'
+ // @hasraw - 'fn_def_with_doc_impl full'
+ /// fn_def_with_doc_impl short
+ ///
+ /// fn_def_with_doc_impl full
+ fn fn_def_with_doc() {}
+
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
+ fn fn_def_without_doc() {}
+
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
+ // @hasraw - 'fn_def_def_with_doc short'
+ // @!hasraw - 'fn_def_def_with_doc full'
+
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
+}
+
+// @has foo/struct.Foo2.html
+pub struct Foo2;
+
+impl Bar for Foo2 {
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
+ // @hasraw - 'fn_empty_with_doc short'
+ // @!hasraw - 'fn_empty_with_doc full'
+ fn fn_empty_with_doc() {}
+
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
+ // @hasraw - 'fn_empty_without_doc_impl short'
+ // @hasraw - 'fn_empty_without_doc_impl full'
+ /// fn_empty_without_doc_impl short
+ ///
+ /// fn_empty_without_doc_impl full
+ fn fn_empty_without_doc() {}
+
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
+ // @hasraw - 'fn_def_with_doc short'
+ // @!hasraw - 'fn_def_with_doc full'
+ fn fn_def_with_doc() {}
+
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
+ // @hasraw - 'fn_def_without_doc_impl short'
+ // @hasraw - 'fn_def_without_doc_impl full'
+ /// fn_def_without_doc_impl short
+ ///
+ /// fn_def_without_doc_impl full
+ fn fn_def_without_doc() {}
+
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
+ // @hasraw - 'fn_def_def_with_doc short'
+ // @!hasraw - 'fn_def_def_with_doc full'
+
+ // @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
+}
diff --git a/tests/rustdoc/deprecated.rs b/tests/rustdoc/deprecated.rs
new file mode 100644
index 00000000000..b3178da98ee
--- /dev/null
+++ b/tests/rustdoc/deprecated.rs
@@ -0,0 +1,33 @@
+// @has deprecated/index.html '//*[@class="item-left module-item"]/span[@class="stab deprecated"]' \
+// 'Deprecated'
+// @has - '//*[@class="item-right docblock-short"]' 'Deprecated docs'
+
+// @has deprecated/struct.S.html '//*[@class="stab deprecated"]' \
+// 'Deprecated since 1.0.0: text'
+/// Deprecated docs
+#[deprecated(since = "1.0.0", note = "text")]
+pub struct S;
+
+// @matches deprecated/index.html '//*[@class="item-right docblock-short"]' '^Docs'
+/// Docs
+pub struct T;
+
+// @matches deprecated/struct.U.html '//*[@class="stab deprecated"]' \
+// 'Deprecated since 1.0.0$'
+#[deprecated(since = "1.0.0")]
+pub struct U;
+
+// @matches deprecated/struct.V.html '//*[@class="stab deprecated"]' \
+// 'Deprecated: text$'
+#[deprecated(note = "text")]
+pub struct V;
+
+// @matches deprecated/struct.W.html '//*[@class="stab deprecated"]' \
+// 'Deprecated$'
+#[deprecated]
+pub struct W;
+
+// @matches deprecated/struct.X.html '//*[@class="stab deprecated"]' \
+// 'Deprecated: shorthand reason$'
+#[deprecated = "shorthand reason"]
+pub struct X;
diff --git a/tests/rustdoc/deref-const-fn.rs b/tests/rustdoc/deref-const-fn.rs
new file mode 100644
index 00000000000..8ecca6d12d2
--- /dev/null
+++ b/tests/rustdoc/deref-const-fn.rs
@@ -0,0 +1,38 @@
+// This test ensures that the const methods from Deref aren't shown as const.
+// For more information, see https://github.com/rust-lang/rust/issues/90855.
+
+#![crate_name = "foo"]
+
+#![feature(staged_api)]
+
+#![stable(feature = "rust1", since = "1.0.0")]
+
+// @has 'foo/struct.Bar.html'
+#[stable(feature = "rust1", since = "1.0.0")]
+pub struct Bar;
+
+impl Bar {
+ // @has - '//*[@id="method.len"]' 'pub const fn len(&self) -> usize'
+ // @has - '//*[@id="method.len"]//span[@class="since"]' 'const: 1.0.0'
+ #[stable(feature = "rust1", since = "1.0.0")]
+ #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
+ pub const fn len(&self) -> usize { 0 }
+}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+pub struct Foo {
+ value: Bar,
+}
+
+// @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"]' '(const: 1.0.0)'
+#[stable(feature = "rust1", since = "1.0.0")]
+impl std::ops::Deref for Foo {
+ type Target = Bar;
+
+ fn deref(&self) -> &Self::Target {
+ &self.value
+ }
+}
diff --git a/tests/rustdoc/deref-mut-methods.rs b/tests/rustdoc/deref-mut-methods.rs
new file mode 100644
index 00000000000..fdf8434224f
--- /dev/null
+++ b/tests/rustdoc/deref-mut-methods.rs
@@ -0,0 +1,29 @@
+#![crate_name = "foo"]
+
+use std::ops;
+
+pub struct Foo;
+
+impl Foo {
+ pub fn foo(&mut self) {}
+}
+
+// @has foo/struct.Bar.html
+// @has - '//*[@class="sidebar-elems"]//*[@class="block"]//a[@href="#method.foo"]' 'foo'
+pub struct Bar {
+ foo: Foo,
+}
+
+impl ops::Deref for Bar {
+ type Target = Foo;
+
+ fn deref(&self) -> &Foo {
+ &self.foo
+ }
+}
+
+impl ops::DerefMut for Bar {
+ fn deref_mut(&mut self) -> &mut Foo {
+ &mut self.foo
+ }
+}
diff --git a/tests/rustdoc/deref-recursive-pathbuf.rs b/tests/rustdoc/deref-recursive-pathbuf.rs
new file mode 100644
index 00000000000..be2b42b5ac6
--- /dev/null
+++ b/tests/rustdoc/deref-recursive-pathbuf.rs
@@ -0,0 +1,25 @@
+// #26207: Show all methods reachable via Deref impls, recursing through multiple dereferencing
+// levels and across multiple crates.
+// For `Deref` on non-foreign types, look at `deref-recursive.rs`.
+
+// @has 'foo/struct.Foo.html'
+// @has '-' '//*[@id="deref-methods-PathBuf"]' 'Methods from Deref'
+// @has '-' '//*[@class="impl-items"]//*[@id="method.as_path"]' 'pub fn as_path(&self)'
+// @has '-' '//*[@id="deref-methods-Path"]' 'Methods from Deref'
+// @has '-' '//*[@class="impl-items"]//*[@id="method.exists"]' 'pub fn exists(&self)'
+// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-PathBuf"]' 'Methods from Deref'
+// @has '-' '//*[@class="sidebar-elems"]//*[@class="block"]//a[@href="#method.as_path"]' 'as_path'
+// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Path"]' 'Methods from Deref'
+// @has '-' '//*[@class="sidebar-elems"]//*[@class="block"]//a[@href="#method.exists"]' 'exists'
+
+#![crate_name = "foo"]
+
+use std::ops::Deref;
+use std::path::PathBuf;
+
+pub struct Foo(PathBuf);
+
+impl Deref for Foo {
+ type Target = PathBuf;
+ fn deref(&self) -> &PathBuf { &self.0 }
+}
diff --git a/tests/rustdoc/deref-recursive.rs b/tests/rustdoc/deref-recursive.rs
new file mode 100644
index 00000000000..0436f2f86f5
--- /dev/null
+++ b/tests/rustdoc/deref-recursive.rs
@@ -0,0 +1,41 @@
+// #26207: Show all methods reachable via Deref impls, recursing through multiple dereferencing
+// levels if needed.
+// For `Deref` on foreign types, look at `deref-recursive-pathbuf.rs`.
+
+// @has 'foo/struct.Foo.html'
+// @has '-' '//*[@id="deref-methods-Bar"]' 'Methods from Deref'
+// @has '-' '//*[@class="impl-items"]//*[@id="method.bar"]' 'pub fn bar(&self)'
+// @has '-' '//*[@id="deref-methods-Baz"]' 'Methods from Deref'
+// @has '-' '//*[@class="impl-items"]//*[@id="method.baz"]' 'pub fn baz(&self)'
+// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Bar"]' 'Methods from Deref'
+// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.bar"]' 'bar'
+// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Baz"]' 'Methods from Deref'
+// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.baz"]' 'baz'
+
+#![crate_name = "foo"]
+
+use std::ops::Deref;
+
+pub struct Foo(Bar);
+pub struct Bar(Baz);
+pub struct Baz;
+
+impl Deref for Foo {
+ type Target = Bar;
+ fn deref(&self) -> &Bar { &self.0 }
+}
+
+impl Deref for Bar {
+ type Target = Baz;
+ fn deref(&self) -> &Baz { &self.0 }
+}
+
+impl Bar {
+ /// This appears under `Foo` methods
+ pub fn bar(&self) {}
+}
+
+impl Baz {
+ /// This should also appear in `Foo` methods when recursing
+ pub fn baz(&self) {}
+}
diff --git a/tests/rustdoc/deref-slice-core.rs b/tests/rustdoc/deref-slice-core.rs
new file mode 100644
index 00000000000..cccf273a820
--- /dev/null
+++ b/tests/rustdoc/deref-slice-core.rs
@@ -0,0 +1,22 @@
+// https://github.com/rust-lang/rust/issues/95325
+//
+// Show methods reachable from Deref of primitive.
+#![no_std]
+
+use core::ops::Deref;
+
+// @has 'deref_slice_core/struct.MyArray.html'
+// @has '-' '//*[@id="deref-methods-%5BT%5D"]' 'Methods from Deref'
+// @has '-' '//*[@class="impl-items"]//*[@id="method.len"]' 'pub fn len(&self)'
+
+pub struct MyArray {
+ array: [T; 10],
+}
+
+impl Deref for MyArray {
+ type Target = [T];
+
+ fn deref(&self) -> &Self::Target {
+ &self.array
+ }
+}
diff --git a/tests/rustdoc/deref-to-primitive.rs b/tests/rustdoc/deref-to-primitive.rs
new file mode 100644
index 00000000000..527de780d48
--- /dev/null
+++ b/tests/rustdoc/deref-to-primitive.rs
@@ -0,0 +1,15 @@
+#![crate_name = "foo"]
+
+// @has 'foo/struct.Foo.html'
+// @has - '//*[@id="deref-methods-i32"]' 'Methods from Deref'
+// @has - '//*[@id="deref-methods-i32-1"]//*[@id="associatedconstant.BITS"]/h4' \
+// 'pub const BITS: u32 = 32u32'
+pub struct Foo(i32);
+
+impl std::ops::Deref for Foo {
+ type Target = i32;
+
+ fn deref(&self) -> &Self::Target {
+ &self.0
+ }
+}
diff --git a/tests/rustdoc/deref-typedef.rs b/tests/rustdoc/deref-typedef.rs
new file mode 100644
index 00000000000..32424d13eb8
--- /dev/null
+++ b/tests/rustdoc/deref-typedef.rs
@@ -0,0 +1,46 @@
+#![crate_name = "foo"]
+
+// @has 'foo/struct.Bar.html'
+// @has '-' '//*[@id="deref-methods-FooJ"]' 'Methods from Deref'
+// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_a"]' 'pub fn foo_a(&self)'
+// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_b"]' 'pub fn foo_b(&self)'
+// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_c"]' 'pub fn foo_c(&self)'
+// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_j"]' 'pub fn foo_j(&self)'
+// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-FooJ"]' 'Methods from Deref'
+// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_a"]' 'foo_a'
+// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_b"]' 'foo_b'
+// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_c"]' 'foo_c'
+// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_j"]' 'foo_j'
+
+pub struct FooA;
+pub type FooB = FooA;
+pub type FooC = FooB;
+pub type FooD = FooC;
+pub type FooE = FooD;
+pub type FooF = FooE;
+pub type FooG = FooF;
+pub type FooH = FooG;
+pub type FooI = FooH;
+pub type FooJ = FooI;
+
+impl FooA {
+ pub fn foo_a(&self) {}
+}
+
+impl FooB {
+ pub fn foo_b(&self) {}
+}
+
+impl FooC {
+ pub fn foo_c(&self) {}
+}
+
+impl FooJ {
+ pub fn foo_j(&self) {}
+}
+
+pub struct Bar;
+impl std::ops::Deref for Bar {
+ type Target = FooJ;
+ fn deref(&self) -> &Self::Target { unimplemented!() }
+}
diff --git a/tests/rustdoc/description.rs b/tests/rustdoc/description.rs
new file mode 100644
index 00000000000..05ec4282208
--- /dev/null
+++ b/tests/rustdoc/description.rs
@@ -0,0 +1,24 @@
+#![crate_name = "foo"]
+//! # Description test crate
+//!
+//! This is the contents of the test crate docstring.
+//! It should not show up in the description.
+
+// @has 'foo/index.html' '//meta[@name="description"]/@content' \
+// 'Description test crate'
+// @!has - '//meta[@name="description"]/@content' 'should not show up'
+
+// @has 'foo/foo_mod/index.html' '//meta[@name="description"]/@content' \
+// 'First paragraph description.'
+// @!has - '//meta[@name="description"]/@content' 'Second paragraph'
+/// First paragraph description.
+///
+/// Second paragraph should not show up.
+pub mod foo_mod {
+ pub struct __Thing {}
+}
+
+// @has 'foo/fn.foo_fn.html' '//meta[@name="description"]/@content' \
+// 'Only paragraph.'
+/// Only paragraph.
+pub fn foo_fn() {}
diff --git a/tests/rustdoc/description_default.rs b/tests/rustdoc/description_default.rs
new file mode 100644
index 00000000000..21d8e04d3f9
--- /dev/null
+++ b/tests/rustdoc/description_default.rs
@@ -0,0 +1,14 @@
+#![crate_name = "foo"]
+
+// @has 'foo/index.html' '//meta[@name="description"]/@content' \
+// 'API documentation for the Rust `foo` crate.'
+
+// @has 'foo/foo_mod/index.html' '//meta[@name="description"]/@content' \
+// 'API documentation for the Rust `foo_mod` mod in crate `foo`.'
+pub mod foo_mod {
+ pub struct __Thing {}
+}
+
+// @has 'foo/fn.foo_fn.html' '//meta[@name="description"]/@content' \
+// 'API documentation for the Rust `foo_fn` fn in crate `foo`.'
+pub fn foo_fn() {}
diff --git a/tests/rustdoc/doc-assoc-item.rs b/tests/rustdoc/doc-assoc-item.rs
new file mode 100644
index 00000000000..4f15418650c
--- /dev/null
+++ b/tests/rustdoc/doc-assoc-item.rs
@@ -0,0 +1,18 @@
+pub struct Foo {
+ x: T,
+}
+
+pub trait Bar {
+ type Fuu;
+
+ fn foo(foo: Self::Fuu);
+}
+
+// @has doc_assoc_item/struct.Foo.html '//*[@class="impl has-srclink"]' 'impl> Foo'
+impl> Foo {
+ pub fn new(t: T) -> Foo {
+ Foo {
+ x: t,
+ }
+ }
+}
diff --git a/tests/rustdoc/doc-auto-cfg.rs b/tests/rustdoc/doc-auto-cfg.rs
new file mode 100644
index 00000000000..7842ee69c9f
--- /dev/null
+++ b/tests/rustdoc/doc-auto-cfg.rs
@@ -0,0 +1,35 @@
+#![feature(doc_auto_cfg)]
+#![crate_name = "foo"]
+
+// @has foo/fn.foo.html
+// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-meowmeow'
+#[cfg(not(meowmeow))]
+pub fn foo() {}
+
+// @has foo/fn.bar.html
+// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow'
+// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'test'
+// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc'
+// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doctest'
+#[cfg(any(meowmeow, test, doc, doctest))]
+pub fn bar() {}
+
+// @has foo/fn.appear_1.html
+// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow'
+// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc'
+// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'non-test'
+#[cfg(any(meowmeow, doc, not(test)))]
+pub fn appear_1() {} // issue #98065
+
+// @has foo/fn.appear_2.html
+// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow'
+// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc'
+// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'test'
+#[cfg(any(meowmeow, doc, all(test)))]
+pub fn appear_2() {} // issue #98065
+
+// @has foo/fn.appear_3.html
+// @has - '//*[@class="item-info"]/*[@class="stab portability"]' 'meowmeow'
+// @!has - '//*[@class="item-info"]/*[@class="stab portability"]' 'doc'
+#[cfg(any(meowmeow, doc, all()))]
+pub fn appear_3() {} // issue #98065
diff --git a/tests/rustdoc/doc-cfg-hide.rs b/tests/rustdoc/doc-cfg-hide.rs
new file mode 100644
index 00000000000..636957fe998
--- /dev/null
+++ b/tests/rustdoc/doc-cfg-hide.rs
@@ -0,0 +1,32 @@
+#![crate_name = "oud"]
+#![feature(doc_auto_cfg, doc_cfg, doc_cfg_hide)]
+
+#![doc(cfg_hide(feature = "solecism"))]
+
+// @has 'oud/struct.Solecism.html'
+// @count - '//*[@class="stab portability"]' 0
+// compile-flags:--cfg feature="solecism"
+#[cfg(feature = "solecism")]
+pub struct Solecism;
+
+// @has 'oud/struct.Scribacious.html'
+// @count - '//*[@class="stab portability"]' 1
+// @matches - '//*[@class="stab portability"]' 'crate feature solecism'
+#[cfg(feature = "solecism")]
+#[doc(cfg(feature = "solecism"))]
+pub struct Scribacious;
+
+// @has 'oud/struct.Hyperdulia.html'
+// @count - '//*[@class="stab portability"]' 1
+// @matches - '//*[@class="stab portability"]' 'crate feature hyperdulia'
+// compile-flags:--cfg feature="hyperdulia"
+#[cfg(feature = "solecism")]
+#[cfg(feature = "hyperdulia")]
+pub struct Hyperdulia;
+
+// @has 'oud/struct.Oystercatcher.html'
+// @count - '//*[@class="stab portability"]' 1
+// @matches - '//*[@class="stab portability"]' 'crate feature oystercatcher only'
+// compile-flags:--cfg feature="oystercatcher"
+#[cfg(all(feature = "solecism", feature = "oystercatcher"))]
+pub struct Oystercatcher;
diff --git a/tests/rustdoc/doc-cfg-implicit-gate.rs b/tests/rustdoc/doc-cfg-implicit-gate.rs
new file mode 100644
index 00000000000..92804d3729b
--- /dev/null
+++ b/tests/rustdoc/doc-cfg-implicit-gate.rs
@@ -0,0 +1,7 @@
+// compile-flags:--cfg feature="worricow"
+#![crate_name = "xenogenous"]
+
+// @has 'xenogenous/struct.Worricow.html'
+// @count - '//*[@class="stab portability"]' 0
+#[cfg(feature = "worricow")]
+pub struct Worricow;
diff --git a/tests/rustdoc/doc-cfg-implicit.rs b/tests/rustdoc/doc-cfg-implicit.rs
new file mode 100644
index 00000000000..5d17a4ede6a
--- /dev/null
+++ b/tests/rustdoc/doc-cfg-implicit.rs
@@ -0,0 +1,31 @@
+#![crate_name = "funambulism"]
+#![feature(doc_auto_cfg, doc_cfg)]
+
+// @has 'funambulism/struct.Disorbed.html'
+// @count - '//*[@class="stab portability"]' 1
+// @matches - '//*[@class="stab portability"]' 'crate feature disorbed'
+// compile-flags:--cfg feature="disorbed"
+#[cfg(feature = "disorbed")]
+pub struct Disorbed;
+
+// @has 'funambulism/struct.Aesthesia.html'
+// @count - '//*[@class="stab portability"]' 1
+// @matches - '//*[@class="stab portability"]' 'crate feature aesthesia'
+// compile-flags:--cfg feature="aesthesia"
+#[doc(cfg(feature = "aesthesia"))]
+pub struct Aesthesia;
+
+// @has 'funambulism/struct.Pliothermic.html'
+// @count - '//*[@class="stab portability"]' 1
+// @matches - '//*[@class="stab portability"]' 'crate feature pliothermic'
+// compile-flags:--cfg feature="epopoeist"
+#[cfg(feature = "epopoeist")]
+#[doc(cfg(feature = "pliothermic"))]
+pub struct Pliothermic;
+
+// @has 'funambulism/struct.Simillimum.html'
+// @count - '//*[@class="stab portability"]' 0
+// compile-flags:--cfg feature="simillimum"
+#[cfg(feature = "simillimum")]
+#[doc(cfg(all()))]
+pub struct Simillimum;
diff --git a/tests/rustdoc/doc-cfg-simplification.rs b/tests/rustdoc/doc-cfg-simplification.rs
new file mode 100644
index 00000000000..633df661be0
--- /dev/null
+++ b/tests/rustdoc/doc-cfg-simplification.rs
@@ -0,0 +1,182 @@
+#![crate_name = "globuliferous"]
+#![feature(doc_cfg)]
+
+// @has 'globuliferous/index.html'
+// @count - '//*[@class="stab portability"]' 1
+// @matches - '//*[@class="stab portability"]' '^ratel$'
+
+// @has 'globuliferous/ratel/index.html'
+// @count - '//*[@class="stab portability"]' 8
+// @matches - '//*[@class="stab portability"]' 'crate feature ratel'
+// @matches - '//*[@class="stab portability"]' '^zoonosology$'
+// @matches - '//*[@class="stab portability"]' '^yusho$'
+// @matches - '//*[@class="stab portability"]' '^nunciative$'
+// @matches - '//*[@class="stab portability"]' '^thionic$'
+// @matches - '//*[@class="stab portability"]' '^zincic$'
+// @matches - '//*[@class="stab portability"]' '^cosmotellurian$'
+// @matches - '//*[@class="stab portability"]' '^aposiopesis$'
+#[doc(cfg(feature = "ratel"))]
+pub mod ratel {
+ // @has 'globuliferous/ratel/fn.ovicide.html'
+ // @count - '//*[@class="stab portability"]' 1
+ // @matches - '//*[@class="stab portability"]' 'crate feature ratel'
+ pub fn ovicide() {}
+
+ // @has 'globuliferous/ratel/fn.zoonosology.html'
+ // @count - '//*[@class="stab portability"]' 1
+ // @matches - '//*[@class="stab portability"]' 'crate features ratel and zoonosology'
+ #[doc(cfg(feature = "zoonosology"))]
+ pub fn zoonosology() {}
+
+ // @has 'globuliferous/ratel/constant.DIAGRAPHICS.html'
+ // @count - '//*[@class="stab portability"]' 1
+ // @matches - '//*[@class="stab portability"]' 'crate feature ratel'
+ pub const DIAGRAPHICS: () = ();
+
+ // @has 'globuliferous/ratel/constant.YUSHO.html'
+ // @count - '//*[@class="stab portability"]' 1
+ // @matches - '//*[@class="stab portability"]' 'crate features ratel and yusho'
+ #[doc(cfg(feature = "yusho"))]
+ pub const YUSHO: () = ();
+
+ // @has 'globuliferous/ratel/static.KEYBUGLE.html'
+ // @count - '//*[@class="stab portability"]' 1
+ // @matches - '//*[@class="stab portability"]' 'crate feature ratel'
+ pub static KEYBUGLE: () = ();
+
+ // @has 'globuliferous/ratel/static.NUNCIATIVE.html'
+ // @count - '//*[@class="stab portability"]' 1
+ // @matches - '//*[@class="stab portability"]' 'crate features ratel and nunciative'
+ #[doc(cfg(feature = "nunciative"))]
+ pub static NUNCIATIVE: () = ();
+
+ // @has 'globuliferous/ratel/type.Wrick.html'
+ // @count - '//*[@class="stab portability"]' 1
+ // @matches - '//*[@class="stab portability"]' 'crate feature ratel'
+ pub type Wrick = ();
+
+ // @has 'globuliferous/ratel/type.Thionic.html'
+ // @count - '//*[@class="stab portability"]' 1
+ // @matches - '//*[@class="stab portability"]' 'crate features ratel and thionic'
+ #[doc(cfg(feature = "thionic"))]
+ pub type Thionic = ();
+
+ // @has 'globuliferous/ratel/struct.Eventration.html'
+ // @count - '//*[@class="stab portability"]' 1
+ // @matches - '//*[@class="stab portability"]' 'crate feature ratel'
+ pub struct Eventration;
+
+ // @has 'globuliferous/ratel/struct.Zincic.html'
+ // @count - '//*[@class="stab portability"]' 2
+ // @matches - '//*[@class="stab portability"]' 'crate features ratel and zincic'
+ // @matches - '//*[@class="stab portability"]' 'crate feature rutherford'
+ #[doc(cfg(feature = "zincic"))]
+ pub struct Zincic {
+ pub rectigrade: (),
+
+ #[doc(cfg(feature = "rutherford"))]
+ pub rutherford: (),
+ }
+
+ // @has 'globuliferous/ratel/enum.Cosmotellurian.html'
+ // @count - '//*[@class="stab portability"]' 10
+ // @matches - '//*[@class="stab portability"]' 'crate features ratel and cosmotellurian'
+ // @matches - '//*[@class="stab portability"]' 'crate feature biotaxy'
+ // @matches - '//*[@class="stab portability"]' 'crate feature xiphopagus'
+ // @matches - '//*[@class="stab portability"]' 'crate feature juxtapositive'
+ // @matches - '//*[@class="stab portability"]' 'crate feature fuero'
+ // @matches - '//*[@class="stab portability"]' 'crate feature palaeophile'
+ // @matches - '//*[@class="stab portability"]' 'crate feature broadcloth'
+ // @matches - '//*[@class="stab portability"]' 'crate features broadcloth and xanthocomic'
+ // @matches - '//*[@class="stab portability"]' 'crate feature broadcloth'
+ // @matches - '//*[@class="stab portability"]' 'crate features broadcloth and whosoever'
+ #[doc(cfg(feature = "cosmotellurian"))]
+ pub enum Cosmotellurian {
+ Groundsel {
+ jagger: (),
+
+ #[doc(cfg(feature = "xiphopagus"))]
+ xiphopagus: (),
+ },
+
+ #[doc(cfg(feature = "biotaxy"))]
+ Biotaxy {
+ glossography: (),
+
+ #[doc(cfg(feature = "juxtapositive"))]
+ juxtapositive: (),
+ },
+ }
+
+ impl Cosmotellurian {
+ pub fn uxoricide() {}
+
+ #[doc(cfg(feature = "fuero"))]
+ pub fn fuero() {}
+
+ pub const MAMELLE: () = ();
+
+ #[doc(cfg(feature = "palaeophile"))]
+ pub const PALAEOPHILE: () = ();
+ }
+
+ #[doc(cfg(feature = "broadcloth"))]
+ impl Cosmotellurian {
+ pub fn trabeculated() {}
+
+ #[doc(cfg(feature = "xanthocomic"))]
+ pub fn xanthocomic() {}
+
+ pub const BRACHIFEROUS: () = ();
+
+ #[doc(cfg(feature = "whosoever"))]
+ pub const WHOSOEVER: () = ();
+ }
+
+ // @has 'globuliferous/ratel/trait.Gnotobiology.html'
+ // @count - '//*[@class="stab portability"]' 4
+ // @matches - '//*[@class="stab portability"]' 'crate feature ratel'
+ // @matches - '//*[@class="stab portability"]' 'crate feature unzymotic'
+ // @matches - '//*[@class="stab portability"]' 'crate feature summate'
+ // @matches - '//*[@class="stab portability"]' 'crate feature unctuous'
+ pub trait Gnotobiology {
+ const XYLOTHERAPY: ();
+
+ #[doc(cfg(feature = "unzymotic"))]
+ const UNZYMOTIC: ();
+
+ type Lepadoid;
+
+ #[doc(cfg(feature = "summate"))]
+ type Summate;
+
+ fn decalcomania();
+
+ #[doc(cfg(feature = "unctuous"))]
+ fn unctuous();
+ }
+
+ // @has 'globuliferous/ratel/trait.Aposiopesis.html'
+ // @count - '//*[@class="stab portability"]' 4
+ // @matches - '//*[@class="stab portability"]' 'crate features ratel and aposiopesis'
+ // @matches - '//*[@class="stab portability"]' 'crate feature umbracious'
+ // @matches - '//*[@class="stab portability"]' 'crate feature uakari'
+ // @matches - '//*[@class="stab portability"]' 'crate feature rotograph'
+ #[doc(cfg(feature = "aposiopesis"))]
+ pub trait Aposiopesis {
+ const REDHIBITION: ();
+
+ #[doc(cfg(feature = "umbracious"))]
+ const UMBRACIOUS: ();
+
+ type Ophthalmoscope;
+
+ #[doc(cfg(feature = "uakari"))]
+ type Uakari;
+
+ fn meseems();
+
+ #[doc(cfg(feature = "rotograph"))]
+ fn rotograph();
+ }
+}
diff --git a/tests/rustdoc/doc-cfg-target-feature.rs b/tests/rustdoc/doc-cfg-target-feature.rs
new file mode 100644
index 00000000000..f1b000dc823
--- /dev/null
+++ b/tests/rustdoc/doc-cfg-target-feature.rs
@@ -0,0 +1,21 @@
+// only-x86_64
+// compile-flags:--test
+// should-fail
+// no-system-llvm
+
+// #49723: rustdoc didn't add target features when extracting or running doctests
+
+#![feature(doc_cfg)]
+
+/// Foo
+///
+/// # Examples
+///
+/// ```
+/// #![feature(cfg_target_feature)]
+///
+/// #[cfg(target_feature = "sse")]
+/// assert!(false);
+/// ```
+#[doc(cfg(target_feature = "sse"))]
+pub unsafe fn foo() {}
diff --git a/tests/rustdoc/doc-cfg-traits.rs b/tests/rustdoc/doc-cfg-traits.rs
new file mode 100644
index 00000000000..13407b2c791
--- /dev/null
+++ b/tests/rustdoc/doc-cfg-traits.rs
@@ -0,0 +1,124 @@
+#![crate_name = "myrmecophagous"]
+#![feature(doc_cfg, associated_type_defaults)]
+
+// @has 'myrmecophagous/index.html'
+// @count - '//*[@class="stab portability"]' 2
+// @matches - '//*[@class="stab portability"]' '^jurisconsult$'
+// @matches - '//*[@class="stab portability"]' '^quarter$'
+
+pub trait Lea {}
+
+// @has 'myrmecophagous/trait.Vortoscope.html'
+// @count - '//*[@class="stab portability"]' 6
+// @matches - '//*[@class="stab portability"]' 'crate feature zibib'
+// @matches - '//*[@class="stab portability"]' 'crate feature poriform'
+// @matches - '//*[@class="stab portability"]' 'crate feature ethopoeia'
+// @matches - '//*[@class="stab portability"]' 'crate feature lea'
+// @matches - '//*[@class="stab portability"]' 'crate feature unit'
+// @matches - '//*[@class="stab portability"]' 'crate feature quarter'
+pub trait Vortoscope {
+ type Batology = ();
+
+ #[doc(cfg(feature = "zibib"))]
+ type Zibib = ();
+
+ const YAHRZEIT: () = ();
+
+ #[doc(cfg(feature = "poriform"))]
+ const PORIFORM: () = ();
+
+ fn javanais() {}
+
+ #[doc(cfg(feature = "ethopoeia"))]
+ fn ethopoeia() {}
+}
+
+#[doc(cfg(feature = "lea"))]
+impl Vortoscope for T {}
+
+#[doc(cfg(feature = "unit"))]
+impl Vortoscope for () {}
+
+// @has 'myrmecophagous/trait.Jurisconsult.html'
+// @count - '//*[@class="stab portability"]' 7
+// @matches - '//*[@class="stab portability"]' 'crate feature jurisconsult'
+// @matches - '//*[@class="stab portability"]' 'crate feature lithomancy'
+// @matches - '//*[@class="stab portability"]' 'crate feature boodle'
+// @matches - '//*[@class="stab portability"]' 'crate feature mistetch'
+// @matches - '//*[@class="stab portability"]' 'crate feature lea'
+// @matches - '//*[@class="stab portability"]' 'crate feature unit'
+// @matches - '//*[@class="stab portability"]' 'crate feature quarter'
+#[doc(cfg(feature = "jurisconsult"))]
+pub trait Jurisconsult {
+ type Urbanist = ();
+
+ #[doc(cfg(feature = "lithomancy"))]
+ type Lithomancy = ();
+
+ const UNIFILAR: () = ();
+
+ #[doc(cfg(feature = "boodle"))]
+ const BOODLE: () = ();
+
+ fn mersion() {}
+
+ #[doc(cfg(feature = "mistetch"))]
+ fn mistetch() {}
+}
+
+#[doc(cfg(feature = "lea"))]
+impl Jurisconsult for T {}
+
+#[doc(cfg(feature = "unit"))]
+impl Jurisconsult for () {}
+
+// @has 'myrmecophagous/struct.Ultimogeniture.html'
+// @count - '//*[@class="stab portability"]' 8
+//
+// @matches - '//*[@class="stab portability"]' 'crate feature zibib'
+// @matches - '//*[@class="stab portability"]' 'crate feature poriform'
+// @matches - '//*[@class="stab portability"]' 'crate feature ethopoeia'
+//
+// @matches - '//*[@class="stab portability"]' 'crate feature jurisconsult'
+// @matches - '//*[@class="stab portability"]' 'crate feature lithomancy'
+// @matches - '//*[@class="stab portability"]' 'crate feature boodle'
+// @matches - '//*[@class="stab portability"]' 'crate feature mistetch'
+//
+// @matches - '//*[@class="stab portability"]' 'crate feature copy'
+#[derive(Clone)]
+pub struct Ultimogeniture;
+
+impl Vortoscope for Ultimogeniture {}
+
+#[doc(cfg(feature = "jurisconsult"))]
+impl Jurisconsult for Ultimogeniture {}
+
+#[doc(cfg(feature = "copy"))]
+impl Copy for Ultimogeniture {}
+
+// @has 'myrmecophagous/struct.Quarter.html'
+// @count - '//*[@class="stab portability"]' 9
+// @matches - '//*[@class="stab portability"]' 'crate feature quarter'
+//
+// @matches - '//*[@class="stab portability"]' 'crate feature zibib'
+// @matches - '//*[@class="stab portability"]' 'crate feature poriform'
+// @matches - '//*[@class="stab portability"]' 'crate feature ethopoeia'
+//
+// @matches - '//*[@class="stab portability"]' 'crate feature jurisconsult'
+// @matches - '//*[@class="stab portability"]' 'crate feature lithomancy'
+// @matches - '//*[@class="stab portability"]' 'crate feature boodle'
+// @matches - '//*[@class="stab portability"]' 'crate feature mistetch'
+//
+// @matches - '//*[@class="stab portability"]' 'crate feature copy'
+#[doc(cfg(feature = "quarter"))]
+#[derive(Clone)]
+pub struct Quarter;
+
+#[doc(cfg(feature = "quarter"))]
+impl Vortoscope for Quarter {}
+
+#[doc(cfg(all(feature = "jurisconsult", feature = "quarter")))]
+impl Jurisconsult for Quarter {}
+
+#[doc(cfg(all(feature = "copy", feature = "quarter")))]
+impl Copy for Quarter {}
diff --git a/tests/rustdoc/doc-cfg.rs b/tests/rustdoc/doc-cfg.rs
new file mode 100644
index 00000000000..4cddb0b76d4
--- /dev/null
+++ b/tests/rustdoc/doc-cfg.rs
@@ -0,0 +1,101 @@
+#![feature(doc_cfg)]
+#![feature(target_feature, cfg_target_feature)]
+
+// @has doc_cfg/struct.Portable.html
+// @!has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' ''
+// @has - '//*[@id="method.unix_and_arm_only_function"]' 'fn unix_and_arm_only_function()'
+// @has - '//*[@class="stab portability"]' 'Available on Unix and ARM only.'
+// @has - '//*[@id="method.wasi_and_wasm32_only_function"]' 'fn wasi_and_wasm32_only_function()'
+// @has - '//*[@class="stab portability"]' 'Available on WASI and WebAssembly only.'
+pub struct Portable;
+
+// @has doc_cfg/unix_only/index.html \
+// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+// 'Available on Unix only.'
+// @matches - '//*[@class="item-left module-item"]//*[@class="stab portability"]' '\AARM\Z'
+// @count - '//*[@class="stab portability"]' 2
+#[doc(cfg(unix))]
+pub mod unix_only {
+ // @has doc_cfg/unix_only/fn.unix_only_function.html \
+ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+ // 'Available on Unix only.'
+ // @count - '//*[@class="stab portability"]' 1
+ pub fn unix_only_function() {
+ content::should::be::irrelevant();
+ }
+
+ // @has doc_cfg/unix_only/trait.ArmOnly.html \
+ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+ // 'Available on Unix and ARM only.'
+ // @count - '//*[@class="stab portability"]' 1
+ #[doc(cfg(target_arch = "arm"))]
+ pub trait ArmOnly {
+ fn unix_and_arm_only_function();
+ }
+
+ #[doc(cfg(target_arch = "arm"))]
+ impl ArmOnly for super::Portable {
+ fn unix_and_arm_only_function() {}
+ }
+}
+
+// @has doc_cfg/wasi_only/index.html \
+// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+// 'Available on WASI only.'
+// @matches - '//*[@class="item-left module-item"]//*[@class="stab portability"]' '\AWebAssembly\Z'
+// @count - '//*[@class="stab portability"]' 2
+#[doc(cfg(target_os = "wasi"))]
+pub mod wasi_only {
+ // @has doc_cfg/wasi_only/fn.wasi_only_function.html \
+ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+ // 'Available on WASI only.'
+ // @count - '//*[@class="stab portability"]' 1
+ pub fn wasi_only_function() {
+ content::should::be::irrelevant();
+ }
+
+ // @has doc_cfg/wasi_only/trait.Wasm32Only.html \
+ // '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+ // 'Available on WASI and WebAssembly only.'
+ // @count - '//*[@class="stab portability"]' 1
+ #[doc(cfg(target_arch = "wasm32"))]
+ pub trait Wasm32Only {
+ fn wasi_and_wasm32_only_function();
+ }
+
+ #[doc(cfg(target_arch = "wasm32"))]
+ impl Wasm32Only for super::Portable {
+ fn wasi_and_wasm32_only_function() {}
+ }
+}
+
+// tagging a function with `#[target_feature]` creates a doc(cfg(target_feature)) node for that
+// item as well
+
+// the portability header is different on the module view versus the full view
+// @has doc_cfg/index.html
+// @matches - '//*[@class="item-left module-item"]//*[@class="stab portability"]' '\Aavx\Z'
+
+// @has doc_cfg/fn.uses_target_feature.html
+// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+// 'Available with target feature avx only.'
+#[target_feature(enable = "avx")]
+pub unsafe fn uses_target_feature() {
+ content::should::be::irrelevant();
+}
+
+// @has doc_cfg/fn.uses_cfg_target_feature.html
+// @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+// 'Available with target feature avx only.'
+#[doc(cfg(target_feature = "avx"))]
+pub fn uses_cfg_target_feature() {
+ uses_target_feature();
+}
+
+// multiple attributes should be allowed
+// @has doc_cfg/fn.multiple_attrs.html \
+// '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+// 'Available on x and y and z only.'
+#[doc(cfg(x))]
+#[doc(cfg(y), cfg(z))]
+pub fn multiple_attrs() {}
diff --git a/tests/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs b/tests/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs
new file mode 100644
index 00000000000..bfce46cf444
--- /dev/null
+++ b/tests/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs
@@ -0,0 +1,23 @@
+//! Test case for [#80737].
+//!
+//! A SomeTrait that is implemented for `&mut T where T: SomeTrait`
+//! should not be marked as "notable" for return values that do not
+//! have bounds on the trait itself.
+//!
+//! [#80737]: https://github.com/rust-lang/rust/issues/80737
+
+#![feature(rustdoc_internals)]
+#![no_std]
+
+#[doc(primitive = "reference")]
+/// Some useless docs, wouhou!
+///
+/// We need to put this in here, because notable traits
+/// that are implemented on foreign types don't show up.
+mod reference {}
+
+// @has doc_notable_trait_mut_t_is_not_an_iterator/fn.fn_no_matches.html
+// @!has - '//code[@class="content"]' 'Iterator'
+pub fn fn_no_matches<'a, T: 'a>() -> &'a mut T {
+ panic!()
+}
diff --git a/tests/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs b/tests/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs
new file mode 100644
index 00000000000..b359dcea0ff
--- /dev/null
+++ b/tests/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs
@@ -0,0 +1,21 @@
+//! Test case for [#78160].
+//!
+//! A SomeTrait that is implemented for `&mut T` should not be marked as
+//! "notable" for return values that are `&T`.
+//!
+//! [#78160]: https://github.com/rust-lang/rust/issues/78160
+
+#![feature(rustdoc_internals)]
+
+#[doc(primitive = "reference")]
+/// Some useless docs, wouhou!
+///
+/// We need to put this in here, because notable traits
+/// that are implemented on foreign types don't show up.
+mod reference {}
+
+// @has doc_notable_trait_mut_t_is_not_ref_t/fn.fn_no_matches.html
+// @!has - '//code[@class="content"]' "impl<'_, I> Iterator for &'_ mut I"
+pub fn fn_no_matches<'a, T: Iterator + 'a>() -> &'a T {
+ loop {}
+}
diff --git a/tests/rustdoc/doc-notable_trait-slice.bare_fn_matches.html b/tests/rustdoc/doc-notable_trait-slice.bare_fn_matches.html
new file mode 100644
index 00000000000..f2ec8320a05
--- /dev/null
+++ b/tests/rustdoc/doc-notable_trait-slice.bare_fn_matches.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/rustdoc/doc-notable_trait-slice.rs b/tests/rustdoc/doc-notable_trait-slice.rs
new file mode 100644
index 00000000000..2411da8cd45
--- /dev/null
+++ b/tests/rustdoc/doc-notable_trait-slice.rs
@@ -0,0 +1,20 @@
+#![feature(doc_notable_trait)]
+
+#[doc(notable_trait)]
+pub trait SomeTrait {}
+
+pub struct SomeStruct;
+pub struct OtherStruct;
+impl SomeTrait for &[SomeStruct] {}
+
+// @has doc_notable_trait_slice/fn.bare_fn_matches.html
+// @snapshot bare_fn_matches - '//script[@id="notable-traits-data"]'
+pub fn bare_fn_matches() -> &'static [SomeStruct] {
+ &[]
+}
+
+// @has doc_notable_trait_slice/fn.bare_fn_no_matches.html
+// @count - '//script[@id="notable-traits-data"]' 0
+pub fn bare_fn_no_matches() -> &'static [OtherStruct] {
+ &[]
+}
diff --git a/tests/rustdoc/doc-notable_trait.bare-fn.html b/tests/rustdoc/doc-notable_trait.bare-fn.html
new file mode 100644
index 00000000000..b426a4d7a8b
--- /dev/null
+++ b/tests/rustdoc/doc-notable_trait.bare-fn.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/rustdoc/doc-notable_trait.rs b/tests/rustdoc/doc-notable_trait.rs
new file mode 100644
index 00000000000..279faf55401
--- /dev/null
+++ b/tests/rustdoc/doc-notable_trait.rs
@@ -0,0 +1,38 @@
+#![feature(doc_notable_trait)]
+
+pub struct Wrapper {
+ inner: T,
+}
+
+impl SomeTrait for Wrapper {}
+
+#[doc(notable_trait)]
+pub trait SomeTrait {
+ // @has doc_notable_trait/trait.SomeTrait.html
+ // @has - '//a[@class="notable-traits"]/@data-ty' 'Wrapper'
+ // @snapshot wrap-me - '//script[@id="notable-traits-data"]'
+ fn wrap_me(self) -> Wrapper where Self: Sized {
+ Wrapper {
+ inner: self,
+ }
+ }
+}
+
+pub struct SomeStruct;
+impl SomeTrait for SomeStruct {}
+
+impl SomeStruct {
+ // @has doc_notable_trait/struct.SomeStruct.html
+ // @has - '//a[@class="notable-traits"]/@data-ty' 'SomeStruct'
+ // @snapshot some-struct-new - '//script[@id="notable-traits-data"]'
+ pub fn new() -> SomeStruct {
+ SomeStruct
+ }
+}
+
+// @has doc_notable_trait/fn.bare_fn.html
+// @has - '//a[@class="notable-traits"]/@data-ty' 'SomeStruct'
+// @snapshot bare-fn - '//script[@id="notable-traits-data"]'
+pub fn bare_fn() -> SomeStruct {
+ SomeStruct
+}
diff --git a/tests/rustdoc/doc-notable_trait.some-struct-new.html b/tests/rustdoc/doc-notable_trait.some-struct-new.html
new file mode 100644
index 00000000000..4f8063807e6
--- /dev/null
+++ b/tests/rustdoc/doc-notable_trait.some-struct-new.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/rustdoc/doc-notable_trait.wrap-me.html b/tests/rustdoc/doc-notable_trait.wrap-me.html
new file mode 100644
index 00000000000..bed2a38b24a
--- /dev/null
+++ b/tests/rustdoc/doc-notable_trait.wrap-me.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/tests/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs b/tests/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs
new file mode 100644
index 00000000000..3fb00c7db84
--- /dev/null
+++ b/tests/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs
@@ -0,0 +1,38 @@
+#![feature(doc_notable_trait)]
+#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+#[lang = "owned_box"]
+pub struct Box;
+
+impl Box {
+ pub fn new(x: T) -> Box {
+ Box
+ }
+}
+
+#[doc(notable_trait)]
+pub trait FakeIterator {}
+
+impl FakeIterator for Box {}
+
+#[lang = "pin"]
+pub struct Pin;
+
+impl Pin {
+ pub fn new(x: T) -> Pin {
+ Pin
+ }
+}
+
+impl