about summary refs log tree commit diff
path: root/src/test/rustdoc/auxiliary
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-973/+0
2022-10-30Rollup merge of #103746 - notriddle:notriddle/incoherent-dyn-trait, ↵Michael Howell-0/+7
r=GuillaumeGomez rustdoc: add support for incoherent impls on structs and traits Fixes #103170
2022-10-29rustdoc: add support for incoherent impls on structs and traitsMichael Howell-0/+7
Fixes #103170
2022-10-30Rollup merge of #103253 - notriddle:notriddle/test-case-masked-blanket-impl, ↵Matthias Krüger-0/+4
r=Mark-Simulacrum rustdoc: add test case for masked blanket impl
2022-10-28Rollup merge of #103523 - GuillaumeGomez:inline-doc-comment-impl-block, ↵Matthias Krüger-0/+5
r=notriddle Fix unwanted merge of inline doc comments for impl blocks Fixes https://github.com/rust-lang/rust/issues/102909. We need this merge mechanism for inlined items but it's completely unwanted for impl blocks (at least the doc comments are, not the other attributes) since we want to keep what `cfg()` is put on the `pub use` or other attributes. r? ``@notriddle``
2022-10-25Add regression test for inlined doc comment on impl blockGuillaume Gomez-0/+5
2022-10-22Clean middle RPITITs correctly in rustdocMichael Goulet-0/+9
2022-10-19rustdoc: add test case for masked blanket implMichael Howell-0/+4
2022-08-06rustdoc: do not mark the contents of a skipped module as inlinedMichael Howell-0/+13
2022-08-02rustdoc: avoid inlining foreigns with duplicate namesMichael Howell-0/+4
2022-07-25rustdoc: avoid inlining modules with duplicate namesMichael Howell-0/+7
Fixes rust-lang/rust#99734
2022-07-16rustdoc: avoid inlining items with duplicate `(type, name)`Michael Howell-0/+20
Fixes #99221
2022-07-04rustdoc: filter '_ lifetimes from ty::GenericsMichael Howell-0/+8
Fixes a weirdly-rendered section of the std::string::String docs.
2022-06-30rustdoc: filter '_ lifetimes from ty::PolyTraitRefMichael Howell-0/+9
Fixes #98697
2022-04-07Hide cross-crate doc-hidden assoc items in trait implsLeón Orell Valerian Liehr-0/+19
2021-11-20Update testsinquisitivecrystal-6/+30
2021-09-12Fix `no_core` and `no_std` rustdoc tests on WindowsGuillaume Gomez-1/+2
This prevents the following (very strange) errors: ``` error: linking with `link.exe` failed: exit code: 1120 | = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x86\\link.exe" "/DEF:C:\\Users\\runneradmin\\AppData\\Local\\Temp\\rustcJih4fa\\lib.def" "/NOLOGO" "/LARGEADDRESSAWARE" "/SAFESEH" "D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\test\\rustdoc\\issue-15318-2\\auxiliary\\issue-15318.issue_15318.0a2a8554-cgu.0.rcgu.o" "D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\test\\rustdoc\\issue-15318-2\\auxiliary\\issue-15318.1na9aylmt25n6w3f.rcgu.o" "/LIBPATH:D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\native\\rust-test-helpers" "/LIBPATH:D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\test\\rustdoc\\issue-15318-2\\auxiliary" "/LIBPATH:D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\i686-pc-windows-msvc\\lib" "vcruntime.lib" "ucrt.lib" "/WHOLEARCHIVE:D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\librustc_std_workspace_core-78744e1360284b1e.rlib" "/WHOLEARCHIVE:D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libcore-a900fa3d16956226.rlib" "D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\i686-pc-windows-msvc\\lib\\libcompiler_builtins-eb97e6b4dfd2f421.rlib" "/NXCOMPAT" "/LIBPATH:D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\i686-pc-windows-msvc\\lib" "/OUT:D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\test\\rustdoc\\issue-15318-2\\auxiliary\\issue_15318.dll" "/OPT:REF,ICF" "/DLL" "/IMPLIB:D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\test\\rustdoc\\issue-15318-2\\auxiliary\\issue_15318.dll.lib" "/DEBUG" "/NATVIS:D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage2\\lib\\rustlib\\etc\\libstd.natvis" = note: LINK : warning LNK4216: Exported entry point __DllMainCRTStartup@12 Creating library D:\a\rust\rust\build\i686-pc-windows-msvc\test\rustdoc\issue-15318-2\auxiliary\issue_15318.dll.lib and object D:\a\rust\rust\build\i686-pc-windows-msvc\test\rustdoc\issue-15318-2\auxiliary\issue_15318.dll.exp libcore-a900fa3d16956226.rlib(core-a900fa3d16956226.core.95dedc69-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __aulldiv referenced in function __ZN4core3num7dec2flt7decimal7Decimal10left_shift17hfb9b6c23d6ff0383E libcompiler_builtins-eb97e6b4dfd2f421.rlib(compiler_builtins-eb97e6b4dfd2f421.compiler_builtins.a5ef280a-cgu.51.rcgu.o) : error LNK2001: unresolved external symbol __aulldiv libcore-a900fa3d16956226.rlib(core-a900fa3d16956226.core.95dedc69-cgu.0.rcgu.o) : error LNK2019: unresolved external symbol __aullrem referenced in function __ZN4core3fmt3num14parse_u64_into17h90eb20517ec3bd86E D:\a\rust\rust\build\i686-pc-windows-msvc\test\rustdoc\issue-15318-2\auxiliary\issue_15318.dll : fatal error LNK1120: 2 unresolved externals ```
2021-09-12Fix broken handling of primitive itemsJoshua Nelson-0/+8
- Fix broken handling of primitive associated items - Remove fragment hack Fixes 83083 - more logging - Update CrateNum hacks The CrateNum has no relation to where in the dependency tree the crate is, only when it's loaded. Explicitly special-case core instead of assuming it will be the first DefId. - Update and add tests - Cache calculation of primitive locations This could possibly be avoided by passing a Cache into collect_intra_doc_links; but that's a much larger change, and doesn't seem valuable other than for this.
2021-09-12Add primitive documentation to libcoreJoshua Nelson-0/+3
This works by doing two things: - Adding links that are specific to the crate. Since not all primitive items are defined in `core` (due to lang_items), these need to use relative links and not intra-doc links. - Duplicating `primitive_docs` in both core and std. This allows not needing CARGO_PKG_NAME to build the standard library. It also adds a tidy check to make sure they stay the same.
2021-08-26Rollup merge of #88215 - jyn514:lazy-loading, r=petrochenkovManish Goregaokar-2/+0
Reland #83738: "rustdoc: Don't load all extern crates unconditionally" I hopefully found all the bugs :crossed_fingers: time for a take two. See the last commit for details on what went wrong before. r? `@petrochenkov` (but feel free to reassign to Guillaume if you don't have time.) Closes https://github.com/rust-lang/rust/issues/68427. Includes a fix for https://github.com/rust-lang/rust/issues/84738.
2021-08-22Revert "Revert "Don't load all extern crates unconditionally""Joshua Nelson-2/+0
This reverts commit 5f0c54db4e595a6a77048f2b0605138ffa49a326.
2021-08-19Give precedence to `html_root_url` over `--extern-html-root-url` by default, ↵Joshua Nelson-0/+3
but add a way to opt-in to the previous behavior ## What is an HTML root url? It tells rustdoc where it should link when documentation for a crate is not available locally; for example, when a crate is a dependency of a crate documented with `cargo doc --no-deps`. ## What is the difference between `html_root_url` and `--extern-html-root-url`? Both of these tell rustdoc what the HTML root should be set to. `doc(html_root_url)` is set by the crate author, while `--extern-html-root-url` is set by the person documenting the crate. These are often different. For example, docs.rs uses `--extern-html-root-url https://docs.rs/crate-name/version` to ensure all crates have documentation, even if `html_root_url` is not set. Conversely, crates such as Rocket set `doc(html_root_url = "https://api.rocket.rs")`, because they prefer users to view the documentation on their own site. Crates also set `html_root_url` to ensure they have documentation when building locally when offline. This is unfortunate to require, because it's more work from the library author. It also makes it impossible to distinguish between crates that want to be viewed on a different site (e.g. Rocket) and crates that just want documentation to be visible offline at all (e.g. Tokio). I have authored a separate change to the API guidelines to no longer recommend doing this: https://github.com/rust-lang/api-guidelines/pull/230. ## Why change the default? In the past, docs.rs has been the main user of `--extern-html-root-url`. However, it's useful for other projects as well. In particular, Cargo wants to pass it by default when running `--no-deps` (https://github.com/rust-lang/cargo/issues/8296). Unfortunately, for these other use cases, the priority order is inverted. They want to give *precedence* to the URL the crate picks, and only fall back to the `--extern-html-root` if no `html_root_url` is present. That allows passing `--extern-html-root` unconditionally, without having to parse the source code to see what attributes are present. For docs.rs, however, we still want to keep the old behavior, so that all links on docs.rs stay on the site.
2021-08-05Add missing root_path when generating links using hrefGuillaume Gomez-0/+1
2021-08-05Add test for source code pages URLsGuillaume Gomez-0/+17
2021-07-27Make all tests use type_alias_impl_trait feature instead of minSantiago Pastorino-1/+1
2021-07-16Auto merge of #86662 - mockersf:fix-86620-link-unknown-location, r=jyn514bors-0/+11
fix dead link for method in trait of blanket impl from third party crate fix #86620 * changes `href` method to raise the actual error it had instead of an `Option` * set the href link correctly in case of an error I did not manage to make a small reproducer, I think it happens in a situation where * crate A expose a trait with a blanket impl * crate B use the trait from crate A * crate C use types from crate B * building docs for crate C without dependencies r? `@jyn514`
2021-07-07Add tests for reexports (both public and private)Guillaume Gomez-6/+42
2021-07-07Add test for reexported macros 2.0 renderingGuillaume Gomez-0/+6
2021-07-06add mcve as testFrançois Mockers-0/+11
2021-07-01Revert "Don't load all extern crates unconditionally"Guillaume Gomez-0/+2
2021-06-26Auto merge of #86449 - Stupremee:render-self-cast-in-type-bound, ↵bors-0/+17
r=GuillaumeGomez rustdoc: Render `<Self as X>::Y` type casts properly across crate bounds My last PR that introduced the type casting did not work for cross-crate re-exported traits, which is fixed in this PR. Fully resolves #85454
2021-06-25Renamed test and added test for same crateDeadbeef-0/+0
2021-06-22Account for more casesDeadbeef-0/+3
2021-06-22Do not list impl when trait has doc(hidden)Deadbeef-0/+2
2021-06-18rustdoc: Render `<Self as X>::Y` type casts properly across crate boundsJustus K-0/+17
2021-06-04Remove `doc(include)`Joshua Nelson-6/+4
2021-05-03Rollup merge of #84832 - Stupremee:dont-print-vis-in-external-traits, r=jyn514Dylan DPC-0/+3
Do not print visibility in external traits This PR fixes the bug that caused traits, which were re-exported, having visibility modifiers in front of methods, which is invalid. It would be nice to add a test for this, but I don't even know if tests with multiple crates are possible. Resolves #81274
2021-05-02PR feedbackScott McMurray-0/+3
2021-05-02Do not print visibility in external traitsJustus K-0/+3
2021-04-17rustdoc: use more precise relative URLSMichael Howell-0/+6
Instead of using a depth counter and adding "../" to get to the top, this commit makes rustdoc actually compare the path of what it's linking from to the path that it's linking to. This makes the resulting HTML shorter. Here's a comparison of one of the largest (non-source) files in the Rust standard library docs (about 4% improvement before gzipping). $ wc -c struct.Wrapping.old.html struct.Wrapping.new.html 2387389 struct.Wrapping.old.html 2298538 struct.Wrapping.new.html Most if it can be efficiently gzipped away. $ wc -c struct.Wrapping.old.html.gz struct.Wrapping.new.html.gz 70679 struct.Wrapping.old.html.gz 70050 struct.Wrapping.new.html.gz But it also makes a difference in the final DOM size, reducing it from 91MiB to 82MiB.
2021-04-02Don't load all extern crates unconditionallyJoshua Nelson-2/+0
Instead, only load the crates that are linked to with intra-doc links. This doesn't help very much with any of rustdoc's fundamental issues with freezing the resolver, but it at least fixes a stable-to-stable regression, and makes the crate loading model somewhat more consistent with rustc's.
2021-03-15Replace `type_alias_impl_trait` by `min_type_alias_impl_trait` with no ↵Oli Scherer-1/+1
actual changes in behaviour This makes `type_alias_impl_trait` not actually do anything anymore
2021-01-13Update tests for extern block lintingMark Rousskov-1/+1
2021-01-06Update test assertions (showcases bug)Daniel Henry-Mantilla-1/+1
2021-01-06Fix type/value namespace clashes + test for thatDaniel Henry-Mantilla-0/+13
2020-12-31Rustdoc render public underscore_imports as Re-exportsbors-0/+4
Fixes #61592
2020-11-28Move `src/test/rustdoc` intra-doc link tests into a subdirectoryJoshua Nelson-98/+0
They were starting to get unwieldy.
2020-11-26Auto merge of #77467 - jyn514:query-docs, r=oli-obkbors-0/+12
Normalize `<X as Y>::T` for rustdoc - Only run for `QPath::Resolved` with `Some` self parameter (`<X as Y>::T`) - Fall back to the previous behavior if the path can't be resolved The first commit is a pure refactor and should probably be reviewed by `@GuillaumeGomez.` I recommend reviewing the second commit on its own. Fixes https://github.com/rust-lang/rust/issues/77459. r? `@eddyb` cc `@danielhenrymantilla` , `@lcnr`
2020-11-24Use the name "auto traits" everywhere in the compilerCamelid-1/+1
Goodbye, OIBIT!
2020-11-24Normalize `<X as Y>::T` for rustdocJoshua Nelson-0/+12
- Only run for `QPath::Resolved` with `Some` self parameter (`<X as Y>::T`) - Fall back to the previous behavior if the path can't be resolved - Show what the behavior is if the type can't be normalized - Run `resolve_vars_if_possible` It's not clear whether or not this is necessary. See https://github.com/rust-lang/rust/pull/77616 for more context. - Add a test for cross-crate re-exports - Use the same code for both `hir::Ty` and `Ty`