summary refs log tree commit diff
path: root/src/librustdoc/html/format.rs
AgeCommit message (Collapse)AuthorLines
2021-01-20Add FIXME for visibility of a moduleCamelid-0/+3
2021-01-20Update `find_nearest_parent_module`Camelid-3/+3
2021-01-20Prefer `pub(crate)` over no modifierCamelid-3/+3
2021-01-20Handle `pub(super)`Camelid-1/+9
2021-01-20Fix bugs; fix and add testsCamelid-27/+29
2021-01-20rustdoc: Render visibilities succinctlyCamelid-2/+11
2020-12-18Remove `DefPath` from `Visibility` and calculate it on demandJoshua Nelson-5/+6
2020-12-17Continue String to Symbol conversion in rustdocGuillaume Gomez-9/+8
2020-12-16Replace String with Symbol where possibleGuillaume Gomez-8/+5
2020-11-17Add `from_def_id_and_kind` reducing duplication in rustdocJoshua Nelson-1/+0
- Add `Item::from_hir_id_and_kind` convenience wrapper - Make name parameter mandatory `tcx.opt_item_name` doesn't handle renames, so this is necessary for any item that could be renamed, which is almost all of them. - Override visibilities to be `Inherited` for enum variants `tcx.visibility` returns the effective visibility, not the visibility that was written in the source code. `pub enum E { A, B }` always has public variants `A` and `B`, so there's no sense printing `pub` again. - Don't duplicate handling of `Visibility::Crate` Instead, represent it as just another `Restricted` path.
2020-11-17Use DefPath for clean::Visibility, not clean::PathJoshua Nelson-5/+18
Visibility needs much less information than a full path, since modules can never have generics. This allows constructing a Visibility from only a DefId. Note that this means that paths are now normalized to their DefPath. In other words, `pub(self)` or `pub(super)` now always shows `pub(in path)` instead of preserving the original text.
2020-11-15Make all rustdoc functions and structs crate-privateJoshua Nelson-14/+14
This gives warnings about dead code.
2020-10-09Simplify included import items handlingGuillaume Gomez-8/+8
2020-10-09Correctly handle "pub use" reexportsGuillaume Gomez-2/+2
2020-08-31Fix strings indentGuillaume Gomez-1/+1
2020-07-27Extract `Cache` and other types from `html` moduleJoseph Ryan-9/+11
2020-07-16Revert "Remove "important traits" feature"Manish Goregaokar-0/+12
This reverts commit 1244ced9580b942926afc06815e0691cf3f4a846.
2020-06-26Generate docs for links to private items when passed --document-privateJoshua Nelson-1/+1
- Pass around document_private a lot more - Add tests + Add tests for intra-doc links to private items + Add ignored tests for warnings in reference links
2020-02-27Remove "important traits" featureGuillaume Gomez-12/+0
2020-02-17Rename `FunctionRetTy` to `FnRetTy`Yuki Okushi-1/+1
2020-01-26rustdoc: Fix re-exporting primitive typesOliver Middleton-5/+8
* Generate links to the primitive type docs for re-exports. * Don't ICE on cross crate primitive type re-exports. * Make primitive type re-exports show up cross crate.
2020-01-20Add `MaybeConst` variant to `{ast,hir}::TraitBoundModifier`Dylan MacKenzie-0/+1
2020-01-07Rollup merge of #67908 - ollie27:rustdoc_const_html_escape, r=GuillaumeGomezYuki Okushi-3/+14
rustdoc: HTML escape const values r? @GuillaumeGomez
2020-01-05rustdoc: HTML escape const valuesOliver Middleton-3/+14
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-2/+2
2020-01-04canonicalize FxHash{Map,Set} importsMazdak Farrokhzad-1/+1
2019-12-22Format the worldMark Rousskov-254/+285
2019-12-22Implement PrintWithSpace trait on hir::MutabilityGuillaume Gomez-11/+11
2019-12-08Sort auto trait and blanket implementations displayGuillaume Gomez-0/+11
2019-09-28rustc: rely on c_variadic == true instead of CVarArgs in HIR/Ty fn signatures.Eduard-Mihai Burtescu-4/+11
2019-09-13Remove *Space wrappers in favor of direct impls or functionsMark Rousskov-68/+43
2019-09-13Unwrap Visibility fieldsMark Rousskov-6/+2
There's not really any reason to not have the visibility default to inherited, and this saves us the trouble of checking everywhere for whether we have a visibility or not.
2019-09-13Move to print functions on types instead of impl fmt::DisplayMark Rousskov-413/+468
This will eventually allow us to easily pass in more parameters to the functions without TLS or other such hacks
2019-09-07Move to buffers throughout print_itemMark Rousskov-3/+3
2019-09-07layout::render takes Print instead of fmt::DisplayMark Rousskov-1/+5
2019-09-07De-indent all fmt::Display impls for later replacement to functionsMark Rousskov-5/+5
2019-09-07Implement Print for FnOnce(&mut Buffer)Mark Rousskov-9/+11
This means that callers can pass in a closure like `|buf| some_function(..., &mut buf)` and pass in arbitrary arguments to that function without complicating the trait definition. We also keep the impl for str and String, since it's useful to be able to just pass in "" or format!("{}"...) results in some cases. This changes Print's definition to take self, instead of &self, because otherwise FnOnce cannot be called directly. We could instead take FnMut or even Fn, but that seems like it'd merely complicate matters -- most of the time, the FnOnce does not constrain us at all anyway. If it does, a custom Print impl for &'_ SomeStruct is not all that painful.
2019-09-07Move sidebar to Buffer-printingMark Rousskov-0/+23
2019-09-07Add buffer abstractionMark Rousskov-0/+65
2019-08-26Transition a few fmt::Display impls to functionsMark Rousskov-49/+53
This introduces a WithFormatter abstraction that permits one-time fmt::Display on an arbitrary closure, created via `display_fn`. This allows us to prevent allocation while still using functions instead of structs, which are a bit unwieldy to thread arguments through as they can't easily call each other (and are generally a bit opaque). The eventual goal here is likely to move us off of the formatting infrastructure entirely in favor of something more structured, but this is a good step to move us in that direction as it makes, for example, passing a context describing current state to the formatting impl much easier.
2019-08-26Inline RawMutableSpaceMark Rousskov-16/+7
2019-08-26Store only the current depthMark Rousskov-6/+6
Previously we stored the entire current path which is a bit expensive and only ever accessed its length. This stores the length directly.
2019-08-26Remove support for printing HRef in alternate modeMark Rousskov-11/+8
The alternate mode merely prints out the passed in text which is largely useless (as the text can simply be directly printed).
2019-08-10Replace is_doc_reachable with is_publicMark Rousskov-2/+1
2019-06-26remove unused derives and variantsAndy Russell-3/+0
2019-06-05Addressed points raised in review.Niko Matsakis-4/+19
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-4/+3
2019-06-03Auto merge of #59033 - GuillaumeGomez:duplicated-bounds, r=Dylan-DPCbors-11/+11
Fix duplicated bounds printing in rustdoc Fixes #56331. Once again, I couldn't find out how to reproduce it with a small code so no test... :-/ r? @QuietMisdreavus
2019-05-26Rename "Associated*" to "Assoc*"Andrew Xu-1/+1
We are going to uniform the terminology of all associated items. Methods that may or may not have `self` are called "associated functions". Because `AssociatedFn` is a bit long, we rename `Associated` to `Assoc`.
2019-05-18Fix display of const generics in rustdocGuillaume Gomez-3/+1