about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2021-12-03Revert "Auto merge of #91354 - fee1-dead:const_env, r=spastorino"Santiago Pastorino-3/+2
This reverts commit 18bb8c61a975fff6424cda831ace5b0404277145, reversing changes made to d9baa361902b172be716f96619b909f340802dea.
2021-12-03Rollup merge of #91170 - jsha:preload-fonts, r=GuillaumeGomezMatthias Krüger-0/+6
rustdoc: preload fonts Follow-up from #82315. I noticed that font loading was so slow that even when loading from local disk, we get a flash of unstyled text (FOUT) followed by a reflow when the fonts load. With this change, we reliably get the appropriate fonts in the first render pass when loading locally, and we get it some of the time when loading from a website. This only preloads woff2 versions. According to https://caniuse.com/?search=preload and https://caniuse.com/?search=woff2, all browsers that support preload also support woff2, so this is fine; we will never load two copies of a font. Don't preload italic font faces because they aren't used on all pages. Demo: https://rustdoc.crud.net/jsha/preload-fonts/std/string/struct.String.html
2021-12-02Auto merge of #91469 - matthiaskrgr:rollup-xom3j55, r=matthiaskrgrbors-1/+41
Rollup of 12 pull requests Successful merges: - #89954 (Fix legacy_const_generic doc arguments display) - #91321 (Handle placeholder regions in NLL type outlive constraints) - #91329 (Fix incorrect usage of `EvaluatedToOk` when evaluating `TypeOutlives`) - #91364 (Improve error message for incorrect field accesses through raw pointers) - #91387 (Clarify and tidy up explanation of E0038) - #91410 (Move `#![feature(const_precise_live_drops)]` checks earlier in the pipeline) - #91435 (Improve diagnostic for missing half of binary operator in `if` condition) - #91444 (disable tests in Miri that take too long) - #91457 (Add additional test from rust issue number 91068) - #91460 (Document how `last_os_error` should be used) - #91464 (Document file path case sensitivity) - #91466 (Improve the comments in `Symbol::interner`.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-02Rollup merge of #89954 - GuillaumeGomez:legacy-const-generic-doc, r=AmanieuMatthias Krüger-1/+41
Fix legacy_const_generic doc arguments display Fixes https://github.com/rust-lang/rust/issues/83167. cc ``@Amanieu``
2021-12-02Auto merge of #91318 - eggyal:reduce-boilerplate-around-infallible-folders, ↵bors-5/+4
r=jackh726 Reduce boilerplate around infallible folders Further to https://github.com/rust-lang/rust/pull/91230#issuecomment-981059666 r? `@jackh726`
2021-12-02Reduce boilerplate around infallible foldersAlan Egerton-5/+4
2021-12-02Auto merge of #91455 - matthiaskrgr:rollup-gix2hy6, r=matthiaskrgrbors-3/+1
Rollup of 4 iffy pull requests Successful merges: - #89234 (Disallow non-c-like but "fieldless" ADTs from being casted to integer if they use arbitrary enum discriminant) - #91045 (Issue 90702 fix: Stop treating some crate loading failures as fatal errors) - #91394 (Bump stage0 compiler) - #91411 (Enable svh tests on msvc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-02Rollup merge of #91394 - Mark-Simulacrum:bump-stage0, r=pietroalbiniMatthias Krüger-3/+1
Bump stage0 compiler r? `@pietroalbini` (or anyone else)
2021-12-02Rename CSS class main-inner into width-limiterGuillaume Gomez-4/+4
2021-12-02Rename ID "main" into "main-content"Guillaume Gomez-24/+25
2021-12-02Fix remaining bugsGuillaume Gomez-7/+21
2021-12-02Auto merge of #91354 - fee1-dead:const_env, r=spastorinobors-2/+3
Cleanup: Eliminate ConstnessAnd This is almost a behaviour-free change and purely a refactoring. "almost" because we appear to be using the wrong ParamEnv somewhere already, and this is now exposed by failing a test using the unstable `~const` feature. We most definitely need to review all `without_const` and at some point should probably get rid of many of them by using `TraitPredicate` instead of `TraitRef`. This is a continuation of https://github.com/rust-lang/rust/pull/90274. r? `@oli-obk` cc `@spastorino` `@ecstatic-morse`
2021-12-02Transform const generics if the function uses rustc_legacy_const_genericsGuillaume Gomez-1/+41
2021-12-02Auto merge of #91291 - GuillaumeGomez:const-deref-method, r=camelidbors-35/+84
Fix const deref methods display Fixes https://github.com/rust-lang/rust/issues/90855 (more information in the issue). r? `@camelid`
2021-12-01Use `try_normalize_erasing_regions` instead of a custom infer contextJoshua Nelson-13/+3
This unfortunately is still giving an unsilenceable overflow error :(
2021-12-01address reviewb-naber-1/+1
2021-12-01more fixed issuesb-naber-0/+7
2021-11-30Return ConstStability instead of &ConstStability in Item::const_stabilityGuillaume Gomez-8/+5
2021-11-30Improve code by replacing &str with Symbol in render_stability_since_rawGuillaume Gomez-19/+15
2021-11-30Fix display for "const" deref methods in rustdocGuillaume Gomez-14/+70
2021-11-30Update src/librustdoc/clean/types.rsMichael Howell-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2021-11-30Update src/librustdoc/clean/types.rsMichael Howell-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2021-11-30re-format with new rustfmtMark Rousskov-3/+1
2021-11-30Add --out-dir flag for rustdochi-rustin-3/+22
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-11-29Only show notable traits if both types are the sameMichael Howell-1/+47
Checking only their DefId doesn't work because all slices have the same fake DefId. Fixes #91347
2021-11-29Fix toolsDeadbeef-2/+3
2021-11-29rustdoc: show logo in source sub navcynecx-40/+87
2021-11-29rustdoc: rework source sidebarcynecx-47/+57
2021-11-29rustdoc: fix tabs in csscynecx-5/+5
2021-11-29rustdoc: don't use overflow for main, instead make the sidebar stickycynecx-16/+14
2021-11-29rustdoc: make source sidebar collapse by defaultcynecx-1/+1
2021-11-29rustdoc: fix theme colorscynecx-3/+3
2021-11-29rustdoc: merge source sidebar into main sidebarcynecx-51/+41
2021-11-29rustdoc: fix source viewcynecx-11/+61
2021-11-29rustdoc: use flexbox to layout sidebar and main contentcynecx-81/+80
2021-11-28Take a LocalDefId in expect_*item.Camille GILLOT-12/+7
2021-11-28Auto merge of #91230 - eggyal:fallible-type-fold, r=jackh726bors-4/+5
Make `TypeFolder::fold_*` return `Result` Implements rust-lang/compiler-team#432. Initially this is just a rebase of `@LeSeulArtichaut's` work in #85469 (abandoned; see https://github.com/rust-lang/rust/pull/85485#issuecomment-908781112). At that time, it caused a regression in performance that required some further exploration... with this rebased PR bors can hopefully report some perf analysis from which we can investigate further (if the regression is indeed still present). r? `@jackh726` cc `@nikomatsakis`
2021-11-27Rollup merge of #91062 - jsha:static-file-replace, r=jyn514,GuillaumeGomezMatthias Krüger-131/+117
rustdoc: Consolidate static-file replacement mechanism There were a few places in rustdoc where we would take static JS or CSS and rewrite it at doc generation time to insert values. This consolidates all the CSS instances into one CSS file and replaces the JS examples with data- attributes on the rustdoc-vars div. Demo https://rustdoc.crud.net/jsha/static-file-replace/test_docs/ r? ``@GuillaumeGomez``
2021-11-26Rollup merge of #91259 - jyn514:doctest-warnings, r=GuillaumeGomezMatthias Krüger-51/+11
Remove `--display-doctest-warnings` `--display-doctest-warnings` can be replicated in full with other existing features, there's no need to have a separate option for it. This removes the option and documents the combination of other features to replicate it. This also fixes a bug where `--test-args=--show-output` had no effect. cc `@ollie27,` https://github.com/rust-lang/rust/pull/73314#issuecomment-668317262 Fixes https://github.com/rust-lang/rust/issues/41574 r? `@GuillaumeGomez`
2021-11-26Rollup merge of #91223 - GuillaumeGomez:headings-indent, r=jshaMatthias Krüger-4/+6
Fix headings indent Fixes #91200. Screenshots with the fix: ![Screenshot from 2021-11-25 15-32-35](https://user-images.githubusercontent.com/3050060/143462481-f7e9ea13-72d5-46fe-90e0-9527e74599e3.png) ![Screenshot from 2021-11-25 15-32-49](https://user-images.githubusercontent.com/3050060/143462485-c010716a-0276-421b-a777-afff19c81c96.png) If the first element of a top docblock is a heading, we still need to keep the indent, but only on this one (I added a test to check it). We need it because otherwise the anchor will go over the `[-]` toggle. cc `@camelid` r? `@jsha`
2021-11-26Rollup merge of #91197 - camelid:rename-resolvedpath, r=GuillaumeGomez,jyn514Matthias Krüger-43/+43
rustdoc: Rename `Type::ResolvedPath` to `Type::Path` and don't re-export it The new name is shorter, simpler, and consistent with `hir::Ty`. It can't be re-exported since the name would conflict with the `clean::Path` struct. But usually enum variants are referred to using their qualified names in Rust anyway (and parts of rustdoc already do that with `clean::Type`), so this is also more consistent with the language. r? `@GuillaumeGomez` cc `@jyn514`
2021-11-26Rollup merge of #90611 - fee1-dead:rustdoc-ice-fix, r=jyn514,willcrichtonMatthias Krüger-6/+11
Fix another ICE in rustdoc scrape_examples This has occurred to me when documenting a crate with the arguments. Not sure what could have caused it. r? `@willcrichton`
2021-11-26Remove `--display-doctest-warnings`Joshua Nelson-51/+11
This can be replicated in full with other existing features, there's no need to have a separate option for it. This also fixes a bug where `--test-args=--show-output` had no effect, and updates the documentation.
2021-11-26Rename `Type::ResolvedPath` to `Type::Path`Noah Lev-38/+37
At last! The new name is shorter, simpler, and consistent with `hir::Ty`.
2021-11-26Update the first heading indent rule so it is only applied on the first ↵Guillaume Gomez-4/+6
heading of the top doc block
2021-11-27Add trace statementsDeadbeef-0/+2
2021-11-27Fix another ICE in rustdoc scrape_examplesDeadbeef-6/+9
2021-11-26Rollup merge of #91225 - GuillaumeGomez:source-page-scrollbar, r=jshaMatthias Krüger-0/+4
Fix invalid scrollbar display on source code page Fixes bug introduced in #90983: ![Screenshot from 2021-11-25 17-01-08](https://user-images.githubusercontent.com/3050060/143473753-c2e7c43c-ce3f-474d-9d2a-922e63189c51.png) ![Screenshot from 2021-11-25 17-07-08](https://user-images.githubusercontent.com/3050060/143473757-eecaaf2b-f4f0-49e0-a159-ab485e3f7122.png) To fix it, I simply unset the `overflow-y` on the source code page so it's not displayed anymore. r? ``@jsha``
2021-11-26Unwrap the results of type foldersLeSeulArtichaut-1/+2
Co-authored-by: Alan Egerton <eggyal@gmail.com>
2021-11-26Adapt `TypeFolder` implementors to return a `Result`LeSeulArtichaut-3/+3
Co-authored-by: Alan Egerton <eggyal@gmail.com>