about summary refs log tree commit diff
path: root/src/librustdoc/html/format.rs
AgeCommit message (Collapse)AuthorLines
2025-09-26Remove usages of `write_str` from `render_assoc_items_inner`Yotam Ofek-4/+0
2025-09-22Introduce "wrapper" helpers to rustdocYotam Ofek-189/+132
2025-09-21Re-use some existing util fnsYotam Ofek-9/+7
2025-09-21Early return in `visibility_print_with_space`Yotam Ofek-4/+7
2025-09-17Cleanup `FnDecl::inner_full_print`Yotam Ofek-48/+59
2025-08-01Rollup merge of #143849 - lolbinarycat:rustdoc-priv-normalize-143222, ↵Jacob Pratt-0/+25
r=GuillaumeGomez rustdoc: never link to unnamable items fixes rust-lang/rust#143222
2025-07-31remove rustc_attr_data_structuresJana Dönszelmann-1/+1
2025-07-22impl items are never unnamablebinarycat-2/+8
2025-07-22rustdoc: actually never link to unnamable typesbinarycat-7/+18
2025-07-22rustdoc: never try to link to unnamable typesbinarycat-1/+9
2025-07-19Fix clippy lints in librustdocGuillaume Gomez-6/+6
2025-07-17Improve path segment joining.Nicholas Nethercote-17/+6
There are many places that join path segments with `::` to produce a string. A lot of these use `join("::")`. Many in rustdoc use `join_with_double_colon`, and a few use `.joined("..")`. One in Clippy uses `itertools::join`. A couple of them look for `kw::PathRoot` in the first segment, which can be important. This commit introduces `rustc_ast::join_path_{syms,ident}` to do the joining for everyone. `rustc_ast` is as good a location for these as any, being the earliest-running of the several crates with a `Path` type. Two functions are needed because `Ident` printing is more complex than simple `Symbol` printing. The commit also removes `join_with_double_colon`, and `estimate_item_path_byte_length` with it. There are still a handful of places that join strings with "::" that are unchanged. They are not that important: some of them are in tests, and some of them first split a path around "::" and then rejoin with "::". This fixes one test case where `{{root}}` shows up in an error message.
2025-06-26Change const trait bound syntax from ~const to [const]Oli Scherer-1/+1
2025-06-05Support middle::ty assoc const eq predicates againLeón Orell Valerian Liehr-19/+22
2025-06-05Rename `should_show_cast` to `should_fully_qualify`León Orell Valerian Liehr-3/+3
2025-05-30Address review comments.Nicholas Nethercote-5/+5
2025-05-27Streamline `visibility_print_with_space`.Nicholas Nethercote-41/+37
Moving the visibility stuff into the `from_fn` avoids the `Cow` and makes the code a little shorter and simpler.
2025-05-26Make `{Type,Path}::generics` return iterators.Nicholas Nethercote-5/+4
Instead of a `Vec`, to avoid some allocations.
2025-05-26Simplify `make_href`.Nicholas Nethercote-5/+5
It never fails, so it doesn't need to return `Result`. And the `ItemType` in the result is just a copy of the one passed in via the `shortty` arg, so it can also be removed.
2025-05-26Rename some methods.Nicholas Nethercote-8/+8
Most of the methods returning `impl Display` have `print` in their name. This commit renames a few that didn't follow that convention.
2025-05-26Refactor the end of `generate_item_def_id_path`.Nicholas Nethercote-6/+6
To avoids the early return and duplication of `Ok((url_parts, shortty, fqp))`.
2025-05-26Simplify `make_href`.Nicholas Nethercote-3/+4
Currently it is passed an `fqp` slice which it calls `to_vec` on and returns. This is a bit odd. It's better to let the call site clone if necessary. (One call site does, one does not).
2025-05-26Avoid `Box` in `href_relative_parts`.Nicholas Nethercote-13/+9
This reverts part of #91948, going back to returning a `UrlPartsBuilder`. It makes the code simpler, and also avoids some allocations.
2025-05-19Rollup merge of #140874 - mejrs:rads, r=WaffleLapkinStuart Cook-1/+1
make `rustc_attr_parsing` less dominant in the rustc crate graph It has/had a glob re-export of `rustc_attr_data_structures`, which is a crate much lower in the graph, and a lot of crates were using it *just* (or *mostly*) for that re-export, while they can rely on `rustc_attr_data_structures` directly. Previous graph: ![graph_1](https://github.com/user-attachments/assets/f4a5f13c-4222-4903-b56d-28c83511fcbd) Graph with this PR: ![graph_2](https://github.com/user-attachments/assets/1e053d9c-75cc-402b-84df-86229c98277a) The first commit keeps the re-export, and just changes the dependency if possible. The second commit is the "breaking change" which removes the re-export, and "explicitly" adds the `rustc_attr_data_structures` dependency where needed. It also switches over some src/tools/*. The second commit is actually a lot more involved than I expected. Please let me know if it's a better idea to back it out and just keep the first commit.
2025-05-18Remove rustc_attr_data_structures re-export from rustc_attr_parsingmejrs-1/+1
2025-05-17Make some `match`es slightly more ergonomic in `librustdoc`Yotam Ofek-45/+36
2025-04-17rustdoc/clean: Change terminology of items pertaining to (formal) fn params ↵León Orell Valerian Liehr-28/+26
from "argument" to "parameter"
2025-04-17Rollup merge of #139846 - nnethercote:kw-Empty-rustdoc, r=GuillaumeGomezMatthias Krüger-3/+5
Remove `kw::Empty` uses in rustdoc Helps with #137978. r? ``@GuillaumeGomez``
2025-04-15Remove another `kw::Empty` use in rustdoc.Nicholas Nethercote-3/+5
Again by using `Option<Symbol>` to represent "no name".
2025-04-10make `link_tooltip` return `impl fmt::Display`Yotam Ofek-26/+29
2025-03-15Add RTN support to rustdocMichael Goulet-0/+3
2025-03-10make precise capturing args in rustdoc Json typedmorine0122-1/+1
2025-03-06Manual, post-`clippy --fix` cleanupsYotam Ofek-5/+5
2025-03-06`x clippy src/librustdoc --fix`Yotam Ofek-6/+4
2025-03-04Adapt `librustdoc` to 2024 edition lifetieme capture rulesYotam Ofek-99/+45
Get rid of the `Captures` hack
2025-03-04`librustdoc`: 2024 edition! 🎊Yotam Ofek-1/+1
2025-02-23return `impl fmt::Display` in more places instead of writing to stringsYotam Ofek-8/+8
2025-02-14librustdoc: lazily format some pathsYotam Ofek-19/+26
2025-02-14librustdoc: create `MaybeDisplay` helper for `Option<T: Display>` typesYotam Ofek-1/+1
2025-02-12Nuke `Buffer` abstraction from `librustdoc` 💣Yotam Ofek-114/+9
2025-02-04librustdoc: create a helper for separating elements of an iterator instead ↵Yotam Ofek-155/+105
of implementing it multiple times
2025-02-01Omit argument names from function pointers that do not have argument namesDavid Tolnay-1/+3
2025-01-22rustdoc: use std's (unstable) `fmt::from_fn` instead of open-coding itYotam Ofek-53/+37
2025-01-15Treat safe target_feature functions as unsafe by defaultOli Scherer-0/+1
2025-01-14Add hir::HeaderSafety to make follow up commits simplerOli Scherer-0/+8
2024-12-31Unsafe binder support in rustdocMichael Goulet-5/+12
2024-12-16rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structuresJonathan Dönszelmann-1/+1
2024-12-14Add some convenience helper methods on `hir::Safety`Oli Scherer-4/+1
2024-11-28Fix new clippy lintsGuillaume Gomez-13/+18
2024-11-23do not to_string, use displayklensy-1/+1