about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2021-10-01rustdoc: use slice::contains instead of open-coding itMichael Howell-2/+2
2021-10-01Auto merge of #89449 - Manishearth:rollup-3alb61f, r=Manishearthbors-2/+3
Rollup of 7 pull requests Successful merges: - #85223 (rustdoc: Clarified the attribute which prompts the warning) - #88847 (platform-support.md: correct ARMv7+MUSL platform triple notes) - #88963 (Coerce const FnDefs to implement const Fn traits ) - #89376 (Fix use after drop in self-profile with llvm events) - #89422 (Replace whitespaces in doctests' name with dashes) - #89440 (Clarify a sentence in the documentation of Vec (#84488)) - #89441 (Normalize after substituting via `field.ty()`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-01Rollup merge of #89422 - GuillaumeGomez:doctest-whitespace-name, r=CraftSpiderManish Goregaokar-0/+1
Replace whitespaces in doctests' name with dashes Fixes #88263. Instead of handling white spaces when we filter tests (which would be quite complicated since we split on them!), I propose to instead replace them with dashes. So for example, this: ```console test foo.rs - Iter2<T, P>::len (line 13) ... ok test foo.rs - Iter<T, P>::len (line 4) ... ok ``` becomes: ```console test foo.rs - Iter<T,-P>::len (line 4) ... ok test foo.rs - Iter2<T,-P>::len (line 13) ... ok ``` r? `@jyn514`
2021-10-01Rollup merge of #88963 - fee1-dead:const-iterator, r=oli-obkManish Goregaokar-2/+2
Coerce const FnDefs to implement const Fn traits You can now pass a FnDef to a function expecting `F` where `F: ~const FnTrait`. r? ``@oli-obk`` ``@rustbot`` label T-compiler F-const_trait_impl
2021-10-01Auto merge of #88880 - cjgillot:no-krate, r=oli-obkbors-9/+6
Rework HIR API to make invocations of the hir_crate query harder. `hir_crate` forces the recomputation of queries that depend on it. This PR aims at avoiding useless invocations of `hir_crate` by making dependent code go through `tcx.hir()`.
2021-10-01Replace whitespaces in doctests' name with dashesGuillaume Gomez-0/+1
2021-10-01Auto merge of #89395 - ↵bors-6/+3
In-line:remove_visible_path_from_allowed_deprecated_lint, r=jyn514 Remove visible path calculation from allowed deprecation lint
2021-09-30Avoid intermediate `collect()`Noah Lev-1/+1
2021-09-30Remove temporary `GetDefId` impl for `Path`Noah Lev-93/+63
2021-09-30Remove unused `Clean` implNoah Lev-7/+0
2021-09-30Remove unnecessary `Box` in `Type::QPath`Noah Lev-13/+12
2021-09-30Avoid unnecessary matches by changing `Clean` implNoah Lev-16/+7
2021-09-30Use `Path` instead of `Type` in `PolyTrait`Noah Lev-306/+208
The change to `impl Clean<Path> for hir::TraitRef<'_>` was necessary to fix a test failure for `src/test/rustdoc/trait-alias-mention.rs`. Here's why: The old code path was through `impl Clean<Type> for hir::TraitRef<'_>`, which called `resolve_type`, which in turn called `register_res`. Now, because `PolyTrait` uses a `Path` instead of a `Type`, the impl of `Clean<Path>` was being run, which did not call `register_res`, causing the trait alias to not be recorded in the `external_paths` cache.
2021-09-30Make `Impl.trait_` a `Path`, not a `Type`Noah Lev-25/+73
It should only ever be a `ResolvedPath`, so this (a) enforces that, and (b) reduces the size of `Impl`. I had to update a test because the order of the rendered auto trait impl bounds changed. I think the order changed because rustdoc sorts auto trait bounds using their `Debug` output.
2021-09-30Remove `Path.global`Noah Lev-12/+3
2021-09-30Remove visible path calculation from allowed deprecation lintAlik Aslanyan-6/+3
2021-09-29Rollup merge of #89366 - GuillaumeGomez:remove-lazy-static, r=jyn514Eric Huss-5/+3
rustdoc: Remove lazy_static dependency The macro was used in only one place and there are equivalents in the std, so it seemed weird to keep it around... I think running a perf check would be a good idea though, just in case. r? ``@jyn514``
2021-09-29Rollup merge of #89297 - GuillaumeGomez:remove-never-from-type-enum, r=camelidEric Huss-8/+6
Remove Never variant from clean::Type enum Fixes #89287. r? ``@camelid``
2021-09-29Rollup merge of #89098 - GuillaumeGomez:where-bounds-order, r=camelidEric Huss-4/+6
Fix generics where bounds order Fixes #88809. Like said on the above issue, the issue is that we were expecting `Symbol` comparisons to be string-based but they are integer-based (because `Symbol` is an integer), messing up the bounds order. To fix it, I simply stored into a `FxIndexMap` instead. r? ``@jyn514``
2021-09-29Rollup merge of #87428 - GuillaumeGomez:union-highlighting, r=notriddleEric Huss-5/+91
Fix union keyword highlighting in rustdoc HTML sources I followed this logic: if I find an ident "union", I check if it followed by another ident or not. If it's the case, then I consider this is a keyword because it's declaring a union type. To do so I created a new Iterator which allows to peek the next items without moving the current iterator position. This is part of https://github.com/rust-lang/rust/issues/85016. If the fix makes sense, I'll extend it to other weak keywords (the issue only mentions they exist but https://doc.rust-lang.org/nightly/reference/keywords.html#weak-keywords only talks about `dyn` and `'static` so not sure if there is anything else to be done?). cc `@notriddle` (you're one of the last ones who worked on this part of rustdoc so here you go :wink: ) r? `@jyn514`
2021-09-29Avoid more invocations of hir_crate query.Camille GILLOT-9/+6
2021-09-29Remove Never variant from clean::Type enumGuillaume Gomez-8/+6
2021-09-29Remove lazy_static dependencyGuillaume Gomez-5/+3
2021-09-29Don't ignore impls for primitive typesHirochika Matsumoto-3/+23
2021-09-28Rollup merge of #89276 - Urgau:fix-union-impls, r=GuillaumeGomezGuillaume Gomez-0/+2
Fix the population of the `union.impls` field This pull-request fix the population of the `union.impls` field that was forgot when the `Union` type was introduce as a split from the `Struct` type https://github.com/rust-lang/rust/pull/81500. ``@rustbot`` label +T-rustdoc +A-rustdoc-json
2021-09-28Auto merge of #89277 - jyn514:codeblock-edition, r=GuillaumeGomezbors-19/+22
Use the correct edition for syntax highlighting doctests Previously it would unconditionally use edition 2015, which was incorrect. Helps with https://github.com/rust-lang/rust/issues/89135 in that you can now override the doctest to be 2018 edition instead of being forced to fix the error. This doesn't resolve any of the deeper problems that rustdoc disagrees with most rust users on what a code block is. cc `@Mark-Simulacrum`
2021-09-27Auto merge of #89203 - GuillaumeGomez:cleanup-rustdoc-types, r=camelidbors-42/+40
Clean up clean/types.rs file by making the implementations follow the type declaration This PR doesn't change anything, it simply moves things around: when reading the code, I realized a few times that a type declaration and implementations on it might be separated by some other type declarations, which makes the reading much more complicated. I put back impl and declaration together. r? `@camelid`
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.