about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2021-09-26Use the correct edition when syntax highlighting doctestsJoshua Nelson-2/+12
Previously it would unconditionally use edition 2015, which was incorrect.
2021-09-26Preserve the whole LangSyntax when parsing doctestsJoshua Nelson-17/+10
Previously, only the raw string and the `is_ignore` field were preserved, which made it hard to recover anything else.
2021-09-26Fix populate of union.implsLoïc BRANSTETT-0/+2
2021-09-25Rollup merge of #89198 - hkmatsumoto:hide-hidden-methods, r=jyn514Manish Goregaokar-1/+33
rustdoc: Don't show hidden trait methods Fix #89186. By skipping trait items whose attributes include `hidden`, we avoid showing such trait methods.
2021-09-25Rollup merge of #88895 - camelid:cleanup-pt2, r=jyn514Manish Goregaokar-79/+56
rustdoc: Cleanup `clean` part 2 Split out from #88379. This contains the following commits from that PR: - Remove `Type::ResolvedPath.is_generic` - Rename `is_generic()` to `is_assoc_ty()` r? `@jyn514`
2021-09-25rustdoc: Document `is_assoc_ty()`Noah Lev-0/+2
It's adapted from the old documentation for the `is_generic` field.
2021-09-26Elaborate commentHirochika Matsumoto-1/+1
Co-authored-by: Joshua Nelson <github@jyn.dev>
2021-09-25rustdoc: Don't show hidden trait methodsHirochika Matsumoto-1/+33
By skipping trait items whose attributes include `hidden`, we void showing such trait methods.
2021-09-25Auto merge of #89230 - workingjubilee:rollup-1swktdq, r=workingjubileebors-2/+6
Rollup of 8 pull requests Successful merges: - #88893 (Add 1.56.0 release notes) - #89001 (Be explicit about using Binder::dummy) - #89072 (Avoid a couple of Symbol::as_str calls in cg_llvm ) - #89104 (Simplify scoped_thread) - #89208 ([rfc 2229] Drop fully captured upvars in the same order as the regular drop code) - #89210 (Add missing time complexities to linked_list.rs) - #89217 (Enable "generate-link-to-definition" option on rust tools docs as well) - #89221 (Give better error for `macro_rules! name!`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-09-24Rollup merge of #89001 - jackh726:binder-cleanup, r=nikomatsakisJubilee-2/+6
Be explicit about using Binder::dummy This is somewhat of a late followup to the binder refactor PR. It removes `ToPredicate` and `ToPolyTraitImpls` that hide the use of `Binder::dummy`. While this does make code a bit more verbose, it allows us be more careful about where we create binders. Another alternative here might be to add a new trait `ToBinder` or something with a `dummy()` fn. Which could still allow grepping but allows doing something like `trait_ref.dummy()` (but I also wonder if longer-term, it would be better to be even more explicit with a `bind_with_vars(ty::List::empty())` *but* that's not clear yet. r? ``@nikomatsakis``
2021-09-24resolve: Refactor obtaining `Module` from its `DefId`Vadim Petrochenkov-1/+1
The `Option<Module>` version is supported for the case where we don't know whether the `DefId` refers to a module or not. Non-local traits and enums are also correctly found now.
2021-09-23Clean up clean/types.rs file by making the implementations follow the type ↵Guillaume Gomez-42/+40
declaration
2021-09-22Rollup merge of #89164 - camelid:show-type-layout-docs, r=jyn514the8472-1/+1
Document `--show-type-layout` in the rustdoc book I also made a few small, related changes as separate commits. r? `@jyn514`
2021-09-22Auto merge of #89134 - est31:revert_rustdoc_box_syntax, r=GuillaumeGomezbors-54/+47
Revert the rustdoc box syntax removal Reverts the rustdoc box syntax removal from #87781. It turned out to cause (minor) perf regressions. Requested in https://github.com/rust-lang/rust/pull/87781#issuecomment-922589168
2021-09-21rustdoc: Emphasize "completely unstable"Noah Lev-1/+1
2021-09-21rustdoc: Note that type layout may differ between compilationsNoah Lev-1/+1
2021-09-20Remove Drop-caused migration-added capturesMark Rousskov-1/+0
All of these were added due to insignificant Drop types being present.
2021-09-20Migrate to 2021Mark Rousskov-1/+1
2021-09-21Revert the rustdoc box syntax removalest31-54/+47
It turned out to cause (minor) perf regressions.
2021-09-20Enable 2021 compatibility lints for all in-tree codeMark Rousskov-0/+1
This just applies the suggested fixes from the compatibility warnings, leaving any that are in practice spurious in. This is primarily intended to provide a starting point to identify possible fixes to the migrations (e.g., by avoiding spurious warnings). A secondary commit cleans these up where they are false positives (as is true in many of the cases).
2021-09-20Auto merge of #88321 - glaubitz:m68k-linux, r=wesleywiserbors-0/+1
Add initial support for m68k This patch series adds initial support for m68k making use of the new M68k backend introduced with LLVM-13. Additional changes will be needed to be able to actually use the backend for this target.
2021-09-19Fix generics where bounds orderGuillaume Gomez-4/+6
2021-09-19Auto merge of #88703 - cjgillot:lazymod, r=petrochenkovbors-6/+2
Gather module items after lowering. This avoids having a non-local analysis inside lowering. By implementing `hir_module_items` using a visitor, we make sure that iterations and visitors are consistent.
2021-09-17Add rustdoc version into the help popupGuillaume Gomez-13/+39
2021-09-17rustdoc: Add human-readable cfg string for m68kJohn Paul Adrian Glaubitz-0/+1
2021-09-17Don't lint about missing code examples in derived traitsHans-0/+1
Fixes #81775
2021-09-16Auto merge of #88219 - jyn514:parallel-io, r=GuillaumeGomezbors-45/+53
rustdoc: reduce number of copies when using parallel IO This is Windows-only for now; I was getting really bad slowdowns from this on linux for some reason. Helps with https://github.com/rust-lang/rust/issues/82741. Follow-up to https://github.com/rust-lang/rust/pull/60971.
2021-09-15Fix rustdocjackh726-2/+6
2021-09-15Move is_const_fn to under TyCtxtDeadbeef-2/+2
2021-09-14Auto merge of #73314 - GuillaumeGomez:display-warnings, r=jyn514bors-22/+30
Rename "--display-warnings" to "--display-doctest-warnings" Fixes #41574. cc `@ollie27` r? `@kinnison`
2021-09-14Rename --display-warnings to --display-doctest-warningsGuillaume Gomez-22/+30
2021-09-14Auto merge of #88914 - GuillaumeGomez:rollup-h5svc6w, r=GuillaumeGomezbors-8/+20
Rollup of 7 pull requests Successful merges: - #88033 (Add links for primitives in "jump to definition" feature) - #88722 (Make `UnsafeCell::get_mut` const) - #88851 (Fix duplicate bounds for const_trait_impl) - #88859 (interpreter PointerArithmetic: use new Size helper methods) - #88885 (Fix jump def background) - #88894 (Improve error message for missing trait in trait impl) - #88896 (Reduce possibility of flaky tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-09-13Rollup merge of #88885 - GuillaumeGomez:fix-jump-def-background, r=camelidGuillaume Gomez-1/+1
Fix jump def background Fixes #88870. I somehow badly wrote the color in #88111. r? ``@camelid``
2021-09-13Auto merge of #87915 - estebank:fancy-spans, r=oli-obkbors-2/+2
Use smaller spans for some structured suggestions Use more accurate suggestion spans for * argument parse error * fully qualified path * missing code block type * numeric casts
2021-09-13Add support for primitives in "jump to definition" featureGuillaume Gomez-7/+19
2021-09-13Auto merge of #88745 - hnj2:allow-trait-impl-missing-code, r=GuillaumeGomezbors-0/+20
Allow missing code examples in trait impls. Excludes Trait implementations from the items that need to have doc code examples when using the `rustdoc::missing_doc_code_examples` lint. For details see #88741 fixes #88741 r? `@jyn514`
2021-09-12Rename `is_generic()` to `is_assoc_ty()`Noah Lev-8/+8
The new name is more accurate than the previous one.
2021-09-12Remove `Type::ResolvedPath.is_generic`Noah Lev-77/+52
It can be computed on-demand.
2021-09-12Fix invalid background for jump-to-def links in source code pagesGuillaume Gomez-1/+1
2021-09-12Gather module items after lowering.Camille GILLOT-6/+2
2021-09-12Rollup merge of #88810 - camelid:cleanup-pt1, r=jyn514Manish Goregaokar-83/+58
rustdoc: Cleanup `clean` part 1 Split out from #88379. These commits are completely independent of each other, and each is a fairly small change (the last few are new commits; they are not from #88379): - Remove unnecessary `Cache.*_did` fields - rustdoc: Get symbol for `TyParam` directly - Create a valid `Res` in `external_path()` - Remove unused `hir_id` parameter from `resolve_type` - Fix redundant arguments in `external_path()` - Remove unnecessary `is_trait` argument - rustdoc: Cleanup a pattern match in `external_generic_args()` r? ``@jyn514``
2021-09-12Rollup merge of #88677 - petrochenkov:exportid, r=davidtwcoManish Goregaokar-11/+11
rustc: Remove local variable IDs from `Export`s Local variables can never be exported.
2021-09-12Fix linkcheck issuesJoshua Nelson-1/+1
Most of these are because alloc uses `#[lang_item]` to define methods, but core documents primitives before those methods are available. - Fix rustdoc-js-std test For some reason this change made CStr not show up in the results for `str,u8`. Since it still shows up for str, and since it wasn't a great match for that query anyway, I think this is ok to let slide. - Add test that all primitives can be linked to - Enable `doc(primitive)` in `core` as well - Add linkcheck exception specifically for Windows Ideally this would be done automatically by the linkchecker by replacing `\\` with forward slashes, but this PR is already a ton of work ... - Don't forcibly fail linkchecking if there's a broken intra-doc link on Windows Previously, it would exit with a hard error if a missing file had `::` in it. This changes it to report a missing file instead, which allows adding an exception.
2021-09-12Fix broken handling of primitive itemsJoshua Nelson-119/+94
- 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-12downgrade some loggingJoshua Nelson-9/+12
2021-09-11rustdoc: Cleanup a pattern match in `external_generic_args()`Noah Lev-3/+2
2021-09-11Remove unnecessary `is_trait` argumentNoah Lev-13/+8
It was only used for sugaring `Fn` trait bounds, and rustdoc already checks that the `did` is for a `Fn` (or `FnMut`, `FnOnce`) lang item, so it's not necessary to also check that the `did` belongs to a trait.
2021-09-11Fix redundant arguments in `external_path()`Noah Lev-34/+27
If the path is for a trait, it is always true that `trait_did == Some(did)`, so instead, `external_path()` now takes an `is_trait` boolean.
2021-09-11Remove unused `hir_id` parameter from `resolve_type`Noah Lev-7/+7
2021-09-11Create a valid `Res` in `external_path()`Noah Lev-19/+12
The order of the `where` bounds on auto trait impls changed because rustdoc currently sorts auto trait `where` bounds based on the `Debug` output for the bound. Now that the bounds have an actual `Res`, they are being unintentionally sorted by their `DefId` rather than their path. So, I had to update a test for the change in ordering of the rendered bounds.