about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2022-07-29Remove box syntax from doctest.rsest31-2/+2
2022-07-29Remove box syntax from Box<rustdoc::clean::types::ItemKind> constructionest31-8/+8
The type has 240 bytes according to compiler internal rustdoc.
2022-07-29Remove unwanted extra white space characters from HTMLGuillaume Gomez-19/+21
2022-07-29Rollup merge of #99850 - GuillaumeGomez:clean-more-items, r=notriddleYuki Okushi-32/+28
rustdoc: Remove more Clean trait implementations Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
2022-07-29Remove `TreeAndSpacing`.Nicholas Nethercote-3/+3
A `TokenStream` contains a `Lrc<Vec<(TokenTree, Spacing)>>`. But this is not quite right. `Spacing` makes sense for `TokenTree::Token`, but does not make sense for `TokenTree::Delimited`, because a `TokenTree::Delimited` cannot be joined with another `TokenTree`. This commit fixes this problem, by adding `Spacing` to `TokenTree::Token`, changing `TokenStream` to contain a `Lrc<Vec<TokenTree>>`, and removing the `TreeAndSpacing` typedef. The commit removes these two impls: - `impl From<TokenTree> for TokenStream` - `impl From<TokenTree> for TreeAndSpacing` These were useful, but also resulted in code with many `.into()` calls that was hard to read, particularly for anyone not highly familiar with the relevant types. This commit makes some other changes to compensate: - `TokenTree::token()` becomes `TokenTree::token_{alone,joint}()`. - `TokenStream::token_{alone,joint}()` are added. - `TokenStream::delimited` is added. This results in things like this: ```rust TokenTree::token(token::Semi, stmt.span).into() ``` changing to this: ```rust TokenStream::token_alone(token::Semi, stmt.span) ``` This makes the type of the result, and its spacing, clearer. These changes also simplifies `Cursor` and `CursorRef`, because they no longer need to distinguish between `next` and `next_with_spacing`.
2022-07-28rustdoc: align invalid-html-tags lint with commonmark specMichael Howell-1/+9
2022-07-28Rollup merge of #99817 - notriddle:notriddle/clean-trait-removal, ↵Dylan DPC-60/+55
r=GuillaumeGomez rustdoc: remove Clean trait impls for more items Follow up to https://github.com/rust-lang/rust/pull/99638 and https://github.com/rust-lang/rust/pull/99672
2022-07-28Rollup merge of #99810 - GuillaumeGomez:fix-settings-slider-small-width, ↵Dylan DPC-2/+1
r=notriddle Fix settings slider on small width screens Fixes #99794. Screenshot of the fix: ![Screenshot from 2022-07-27 14-17-08](https://user-images.githubusercontent.com/3050060/181250007-55f982d1-89db-45b7-a4f1-0d1729e6a3e3.png) cc `````@jsha````` r? `````@notriddle`````
2022-07-28Remove Clean trait implementation for VariantData fieldsGuillaume Gomez-7/+3
2022-07-28Remove Clean trait implementation for VariantStructGuillaume Gomez-7/+8
2022-07-28Remove Clean trait implementation for ty::VisibilityGuillaume Gomez-18/+17
2022-07-27rustdoc: remove Clean trait impl for ty::GenericParamDefMichael Howell-42/+39
2022-07-27rustdoc: remove Clean trait impl for hir::TermMichael Howell-9/+7
2022-07-27rustdoc: remove Clean trait impl for ty::TermMichael Howell-9/+9
2022-07-27Rollup merge of #99812 - GuillaumeGomez:fix-headings-colors, r=jsha,notriddleGuillaume Gomez-6/+2
Fix headings colors Fixes #99797. ![image](https://user-images.githubusercontent.com/3050060/181260966-49faf9d3-f6b8-4de4-bc7d-ed9f0467cf68.png) cc `@jsha` r? `@notriddle`
2022-07-27Rollup merge of #99710 - davidtwco:internal-lint-opts, r=lcnrGuillaume Gomez-1/+1
lint: add bad opt access internal lint Prompted by [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/sess.2Ecrate_types.28.29.20vs.20sess.2Eopts.2Ecrate_types/near/290682847). Some command-line options accessible through `sess.opts` are best accessed through wrapper functions on `Session`, `TyCtxt` or otherwise, rather than through field access on the option struct in the `Session`. Adds a new lint which triggers on those options that should be accessed through a wrapper function so that this is prohibited. Options are annotated with a new attribute `rustc_lint_opt_deny_field_access` which can specify the error message (i.e. "use this other function instead") to be emitted. A simpler alternative would be to simply rename the options in the option type so that it is clear they should not be used, however this doesn't prevent uses, just discourages them. Another alternative would be to make the option fields private, and adding accessor functions on the option types, however the wrapper functions sometimes rely on additional state from `Session` or `TyCtxt` which wouldn't be available in an function on the option type, so the accessor would simply make the field available and its use would be discouraged too. **Leave a comment if there's an option I should add this to.**
2022-07-27Fix headings borderGuillaume Gomez-5/+1
2022-07-27Fix invalid css property valueGuillaume Gomez-1/+1
2022-07-27Fix settings display on small screen sizeGuillaume Gomez-2/+1
2022-07-27session: disable internal lints for rustdocDavid Wood-1/+1
If an internal lint uses `typeck_results` or similar queries then that can result in rustdoc checking code that it shouldn't (e.g. from other platforms) and emit compilation errors. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-27Rollup merge of #99783 - notriddle:notriddle/clean-trait-removal, ↵Yuki Okushi-58/+61
r=GuillaumeGomez rustdoc: remove Clean trait impls for more items Follow up to #99638 and #99672
2022-07-27Rollup merge of #99775 - notriddle:notriddle/as-str, r=camelidYuki Okushi-2/+2
rustdoc: do not allocate String when writing path full name No idea if this makes any perf difference, but it just seems like premature pessimisation to use String when str will do.
2022-07-27Rollup merge of #99771 - GuillaumeGomez:update-pulldown-cmark, r=UrgauYuki Okushi-1/+1
Update pulldown-cmark version to 0.9.2 (fixes url encoding for some chars) Fixes https://github.com/rust-lang/rust/issues/97125. r? ``@Dylan-DPC``
2022-07-27Rollup merge of #99700 - est31:rustdoc_layout_heading, r=GuillaumeGomezYuki Okushi-1/+6
Add a clickable link to the layout section The layout section (activated by `--show-type-layout`) is currently not linkable to (outside of chrome's link to text feature). This PR makes it linkable via `#layout`.
2022-07-26rustdoc: remove Clean trait impl for ty::PolyTraitPredicateMichael Howell-16/+19
2022-07-26rustdoc: remove Clean trait impls for ty::OutlivesPredicateMichael Howell-29/+27
2022-07-26rustdoc: remove Clean trait impl for ProjectionPredicateMichael Howell-8/+9
2022-07-26rustdoc: remove Clean trait impl for ProjectionTyMichael Howell-9/+10
2022-07-26Fix display of item info and unify their heightGuillaume Gomez-1/+9
2022-07-26rustdoc: do not allocate String when writing path full nameMichael Howell-2/+2
No idea if this makes any perf difference, but it just seems like premature pessimisation to use String when str will do.
2022-07-26Update pulldown-cmark versionGuillaume Gomez-1/+1
2022-07-26Rollup merge of #99235 - ↵Matthias Krüger-6/+22
WaffleLapkin:rustdoc_implement_support_for_must_implement, r=GuillaumeGomez rustdoc: Add support for `#[rustc_must_implement_one_of]` This PR adds support for `#[rustc_must_implement_one_of]` attribute added in #92164. There is a desire to eventually use this attribute of `Read`, so making it show up in docs is a good thing. I "stole" the styling from cfg notes, not sure what would be a proper styling. Currently it looks like this: ![2022-07-14_15-00](https://user-images.githubusercontent.com/38225716/178968170-913c1dd5-8875-4a95-9848-b075a0bb8998.png) <details><summary>Code to reproduce</summary> <p> ```rust #![feature(rustc_attrs)] #[rustc_must_implement_one_of(a, b)] pub trait Trait { fn req(); fn a(){ Self::b() } fn b(){ Self::a() } } ``` </p> </details>
2022-07-25rustdoc: avoid inlining modules with duplicate namesMichael Howell-2/+5
Fixes rust-lang/rust#99734
2022-07-25apply review suggestionsMaybe Waffle-1/+1
2022-07-25Add a clickable link to the layout sectionest31-1/+6
2022-07-25Fix sidebar background-color on mobileGuillaume Gomez-1/+0
2022-07-25fix rustdoc-gui testsMaybe Waffle-1/+1
2022-07-24Remove Clean trait implementation for ConstantGuillaume Gomez-26/+27
2022-07-24Remove Clean trait implementation for FieldDefGuillaume Gomez-27/+28
2022-07-24Satisfy theme checkMaybe Waffle-0/+1
2022-07-24add backticksMaybe Waffle-2/+2
2022-07-24Add support for `#[rustc_must_implement_one_of]` to rustdocMaybe Waffle-7/+22
2022-07-23Remove Clean trait implementation for hir::Ty and middle::TyGuillaume Gomez-136/+153
2022-07-22Auto merge of #99598 - GuillaumeGomez:clean-trait-fields-on-demand, r=notriddlebors-22/+23
Make some clean::Trait fields computation on demand r? `@notriddle`
2022-07-22Make some clean::Trait fields computation on demandGuillaume Gomez-22/+23
2022-07-22Rollup merge of #99423 - GuillaumeGomez:group-css-font-rule, r=notriddleDylan DPC-12/+9
Group CSS font rule Another CSS cleanup I came by when working on something else. r? ``@notriddle``
2022-07-21Rollup merge of #99559 - GuillaumeGomez:rm-unused-field-keyword, r=notriddleMatthias Krüger-15/+14
Remove unused field in ItemKind::KeywordItem For the keyword name, we use `Item::name` directly everywhere so there is no point into keeping it. r? ``@notriddle``
2022-07-21Remove unused field in ItemKind::KeywordItemGuillaume Gomez-15/+14
2022-07-20Auto merge of #99058 - michaelwoerister:remove-stable-set-and-map, r=nagisabors-1/+4
Remove the unused StableSet and StableMap types from rustc_data_structures. The current implementation is not "stable" in the same sense that `HashStable` and `StableHasher` are stable, i.e. across compilation sessions. So, in my opinion, it's better to remove those types (which are basically unused anyway) than to give the wrong impression that these are safe for incr. comp. I plan to provide new "stable" collection types soon that can be used to replace `FxHashMap` and `FxHashSet` in query results (see [draft](https://github.com/michaelwoerister/rust/commit/69d03ac7a7d651a397ab793e9d78f8fce3edf7a6)). It's unsound that `HashMap` and `HashSet` implement `HashStable` (see https://github.com/rust-lang/rust/issues/98890 for a recent P-critical bug caused by this) -- so we should make some progress there.
2022-07-20Rollup merge of #99489 - GuillaumeGomez:gui-fixes, r=notriddleMatthias Krüger-7/+22
rustdoc UI fixes The first commit fixes this bug: ![Screenshot from 2022-07-20 02-54-26](https://user-images.githubusercontent.com/3050060/179879053-fc34f27a-6248-4f5c-9fcb-80adbfc1598c.png) ![Screenshot from 2022-07-20 03-00-03](https://user-images.githubusercontent.com/3050060/179879056-1c0973a0-d535-44e7-a48e-bad692034467.png) The second one fixes the missing change of border color when the search input is focused. cc `@jsha` r? `@notriddle`