about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2022-05-22Add new eslint rule to prevent whitespace before function call parenGuillaume Gomez-0/+1
2022-05-22Auto merge of #97177 - oli-obk:const-stability, r=davidtwcobors-7/+4
Implement proper stability check for const impl Trait, fall back to unstable const when undeclared Continuation of #93960 `@jhpratt` it looks to me like the test was simply not testing for the failure you were looking for? Your checks actually do the right thing for const traits?
2022-05-21Extend `substs_to_args` into a perfectly-sized Vec almost every timeMichael Howell-16/+16
2022-05-21Shrink GenericArgs/PathSegment with boxed slicesMichael Howell-19/+20
2022-05-21Remove unused Hash impl from DocFragmentKindMichael Howell-1/+1
2022-05-21rustdoc: Some link resolution caching cleanupVadim Petrochenkov-35/+16
2022-05-21rustdoc: Stop using `write!` in `UrlFragment::render`Vadim Petrochenkov-14/+16
2022-05-21rustdoc: Remove `ItemFragment(Kind)`Vadim Petrochenkov-74/+30
2022-05-21Auto merge of #97246 - GuillaumeGomez:rollup-btcok8x, r=GuillaumeGomezbors-0/+8
Rollup of 7 pull requests Successful merges: - #97190 (Add implicit call to from_str via parse in documentation) - #97218 (Add eslint checks) - #97219 (make ptr::invalid not the same as a regular int2ptr cast) - #97223 (Remove quadratic behaviour from -Zunpretty=hir-tree.) - #97232 (typo) - #97237 (Add some more weird-exprs) - #97238 (Bump LLVM fetched from CI to fix run-make) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-21Remove fields_stripped fields (and equivalents)Guillaume Gomez-53/+64
2022-05-21Rollup merge of #97218 - GuillaumeGomez:eslint-checks, r=notriddleGuillaume Gomez-0/+8
Add eslint checks The first check is to ensure that `=>` is always surrounded with whitespaces. The second is to ensure that the dict objects looks like this: `{"a": 2}` and not `{"a" : 2}` or `{"a":2}`. r? ``@notriddle``
2022-05-21Auto merge of #93963 - GuillaumeGomez:reduce-clean-type-size, r=notriddlebors-206/+213
rustdoc: Reduce clean::Type size There is no need to keep the `DefId` around since it's allow used to compute if we should show a cast or not. As such, we can simply directly store the boolean. I think it's not what you had in mind `@camelid` but I guess it's still an improvement? :wink: It was discussed in https://github.com/rust-lang/rust/pull/93941. r? `@camelid`
2022-05-21Remove `crate` visibility modifier in libs, testsJacob Pratt-882/+927
2022-05-20Add eslint key-spacing checkGuillaume Gomez-0/+4
2022-05-20Add eslint arrow-spacing checkGuillaume Gomez-0/+4
2022-05-20Rollup merge of #97179 - GuillaumeGomez:eslint-lint, r=notriddleGuillaume Gomez-2/+6
Add new lint to enforce whitespace after keywords r? `@notriddle`
2022-05-20Rollup merge of #96565 - notriddle:notriddle/impl-box, r=camelidGuillaume Gomez-1/+10
rustdoc: show implementations on `#[fundamental]` wrappers Fixes #92940
2022-05-19Add new lint to enforce whitespace after keywordsGuillaume Gomez-2/+6
2022-05-19Add and use stability helper methodsJacob Pratt-7/+4
This avoids an ambiguity (when reading) where `.level.is_stable()` is not immediately clear whether it is general stability or const stability.
2022-05-18Move some DOM generation into the HTML settings file directlyGuillaume Gomez-19/+15
2022-05-17rustdoc: avoid including impl blocks with filled-in genericsMichael Howell-2/+27
Fixes #94937
2022-05-18Rollup merge of #97113 - GuillaumeGomez:search-ui-fixes, r=notriddleYuki Okushi-8/+8
Search GUI fixes The first fix is about the duplicated "in": ![Screenshot from 2022-05-17 13-25-53](https://user-images.githubusercontent.com/3050060/168814186-a4e9064f-4325-469c-8bf6-46ea2737a24f.png) The second fix is about the `<select>` broken style: ![Screenshot from 2022-05-17 13-37-03](https://user-images.githubusercontent.com/3050060/168814182-b1c5ae66-d8cf-4fd5-a227-5aa8cd8453ab.png) ![Screenshot from 2022-05-17 13-36-55](https://user-images.githubusercontent.com/3050060/168814184-be9e56f8-fad4-477c-899e-9abff4d4910c.png) You can test it [here](https://rustdoc.crud.net/imperio/search-ui-fixes/doc/foo/index.html?search=test). r? `@notriddle`
2022-05-18Rollup merge of #96761 - klensy:no-rayon-here, r=CraftSpiderYuki Okushi-2/+9
rustdoc: don't build `rayon` for non-windows targets `rayon` used only on windows targets, so no need to build it otherwise.
2022-05-18Rollup merge of #96647 - Enselic:fix-hrtb-for-wherepredicate, r=CraftSpiderYuki Okushi-2/+8
rustdoc-json: Fix HRTBs for WherePredicate::BoundPredicate Information about HRTBs are already present for `GenericBound:: TraitBound` and `FunctionPointer`. This PR adds HRTB info also to `WherePredicate::BoundPredicate`. Use the same field name and type as for the other ones (`generic_params: Vec<GenericParamDef>`). I have verified that this gives rustdoc JSON clients the data they need and in a format that is easy to work with (see https://github.com/Enselic/public-api/pull/92). I will be happy to add tests for this change (and bump `FORMAT_VERSION` which I just realized I forgot), but it is always nice to get one round of feedback first, so that I don't put a lot of effort into tests that then have to be discarded. `@rustbot` modify labels: +T-rustdoc +A-rustdoc-json
2022-05-17Auto merge of #92570 - jsha:rustdoc-search-refactor, r=GuillaumeGomezbors-52/+73
Simplify rustdoc search test Previously, rustdoc search attempted to parse search.js and extract out only certain methods and variables. This change makes search.js and search-index.js loadable as [CommonJS modules](https://nodejs.org/api/modules.html#modules-commonjs-modules), so they can be loaded directly. As part of that change, I had to separate execSearch from interacting with the DOM. This wound up being a nice cleanup that made more explicit what inputs it was taking. I removed search.js' dependency on storage.js by moving hasOwnPropertyRustdoc directly into search.js, and replacing onEach with forEach in a path that is called by the tester. r? `@GuillaumeGomez` Demo: https://rustdoc.crud.net/jsha/rustdoc-search-refactor/std/?search=foo
2022-05-17rustdoc: make search.js a moduleJacob Hoffman-Andrews-52/+73
Previously, search.js relied on the DOM and the `window` object. It can now be loaded in the absence of the DOM, for instance by Node. The same is true of search-index.js. This allows removing a lot of code from src/tools/rustdoc-js/tester.js that tried to parse search.js and extract specific functions that were needed for testing.
2022-05-17Fix display of search crate filter selectGuillaume Gomez-7/+7
2022-05-17Fix duplicated "in" in the search result textGuillaume Gomez-1/+1
2022-05-17Auto merge of #96825 - kckeiks:remove-item-like-visitor-trait, r=cjgillotbors-1/+1
Retire `ItemLikeVisitor` trait Issue #95004 cc `@cjgillot`
2022-05-16rustdoc: Resolve some more doc links earlyVadim Petrochenkov-9/+32
2022-05-16Auto merge of #96676 - petrochenkov:docrules, r=GuillaumeGomezbors-30/+22
rustdoc: Remove doc link resolution fallback to all `macro_rules` in the crate This is a deny-by-default lint detecting such fallback for crater run, as discussed in https://github.com/rust-lang/rust/pull/96521.
2022-05-15rustdoc: Remove doc link resolution fallback to all `macro_rules` in the crateVadim Petrochenkov-30/+22
2022-05-15Add new eslint rule about brace styleGuillaume Gomez-33/+57
2022-05-15Prevent to recompute `should_show_cast` by passing down `self_def_id`Guillaume Gomez-197/+191
2022-05-15Reduce clean::Type size by replacing a DefId (only used to check for ↵Guillaume Gomez-18/+31
display) with a boolean
2022-05-15Rollup merge of #96958 - GuillaumeGomez:settings-menu-display, r=jshaMatthias Krüger-230/+122
Improve settings menu display and remove theme menu We talked about improving the settings menu and we mentioned that firefox pocket was a nice inspiration so I implemented it. The result looks like this: ![Screenshot from 2022-05-11 23-59-53](https://user-images.githubusercontent.com/3050060/167954743-438c0a06-4628-478c-bf0c-d20313c1fdfc.png) You can test it [here](https://rustdoc.crud.net/imperio/settings-menu-display/doc/foo/index.html). Only question I have is: should I re-assign the shortcut `T` to this setting menu now that the theme menu is gone? For now I simply removed it. Important to be noted: the full settings page (at `settings.html`) is still rendered the same as currently. r? ``@jsha``
2022-05-14Auto merge of #96883 - jackh726:early-binder-2, r=oli-obkbors-11/+11
Add EarlyBinder Chalk has no concept of `Param` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L579) or `ReEarlyBound` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L1308). Everything is just "bound" - the equivalent of rustc's late-bound. It's not completely clear yet whether to move everything to the same time of binder in rustc or add `Param` and `ReEarlyBound` in Chalk. Either way, tracking when we have or haven't already substituted out these in rustc can be helpful. As a first step, I'm just adding a `EarlyBinder` newtype that is required to call `subst`. I also add a couple "transparent" `bound_*` wrappers around a couple query that are often immediately substituted. r? `@nikomatsakis`
2022-05-14Remove theme picker buttonGuillaume Gomez-199/+12
2022-05-14Improve settings menu displayGuillaume Gomez-31/+110
2022-05-14Auto merge of #96345 - petrochenkov:linclean, r=notriddlebors-503/+241
rustdoc: Cleanup doc link resolution See individual commits for specific changes
2022-05-14Rollup merge of #96998 - notriddle:notriddle/var-N, r=jshaYuki Okushi-1/+1
rustdoc: remove weird, unused variable from source-files.js
2022-05-13Add bound_impl_trait_refJack Huey-5/+5
2022-05-13Add bound_type_ofJack Huey-5/+5
2022-05-13resolve: Move collection of all `macro_rules` in the crate to rustdocVadim Petrochenkov-2/+6
2022-05-13Fix rebaseVadim Petrochenkov-5/+2
2022-05-13rustdoc: Use `Visibility::is_public` moreVadim Petrochenkov-10/+6
2022-05-13rustdoc: Do not resolve associated item paths unnecessarilyVadim Petrochenkov-11/+9
2022-05-13rustdoc: Do not create `UrlFragment`s until they are necessaryVadim Petrochenkov-236/+133
This simplifies error types and allows to remove `fn resolve_inner` and `fn check_full_res` `visited_links` caching is not touched for now
2022-05-13rustdoc: Remove `fn resolve_macro`Vadim Petrochenkov-119/+43
and otherwise unify resolution in macro namespace and other namespaces
2022-05-13rustdoc: Remove `ResolutionFailure::Dummy`Vadim Petrochenkov-37/+20
The variant resolution check didn't make sense, and derive trait collision could be processed in a different way