about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2023-08-24rustdoc: list matching impls on type aliasesMichael Howell-4/+43
Remake of "List matching impls on type aliases" * 4b1d13d9841c815915433ca2a3088a8e3e97ad96 * 6f552c800b38b3e71c5e33a295e8b490d2018c71 * 2ce7cd906bde70d8cbd9b07b31c6a7bf1131c345 Partially reverts "Fix infinite loop when retrieving impls for type alias", but keeps the test case. This version of the PR avoids the infinite loop by structurally matching types instead of using full unification. This version does not support type alias trait bounds, but the compiler does not enforce those anyway (https://github.com/rust-lang/rust/issues/21903).
2023-08-24rustdoc: extract logic for printing enum fields and struct variantsUrgau-131/+195
2023-08-24Auto merge of #115078 - camelid:tydef-to-alias, r=aDotInTheVoid,GuillaumeGomezbors-54/+58
rustdoc: Rename typedef to type alias This matches the name used by the [Rust Reference][1], which is also what people usually call these items. [1]: https://doc.rust-lang.org/reference/items/type-aliases.html r? `@GuillaumeGomez`
2023-08-23Rollup merge of #115135 - GuillaumeGomez:no-html-source-flag, r=notriddleGuillaume Gomez-1/+9
Rustdoc: Add unstable --no-html-source flag Fixes https://github.com/rust-lang/rust/issues/115060. This is the equivalent of `#![doc(no_html_source)]` but on the command-line. It disables the generation of the source pages (and of the links pointing to them as well). The motivation behind this is to enable to reduce documentation size when generating it in some locations without enforcing this to end users or adding a new feature to enable/disable the crate attribute. r? `@notriddle`
2023-08-23Add unstable `--no-html-source` rustdoc flagGuillaume Gomez-1/+9
2023-08-21rustdoc: use unicode-aware checks for redundant explicit link fastpathMichael Howell-14/+4
Fixes #115064
2023-08-21rustdoc-json: Rename typedef to type aliasNoah Lev-12/+12
2023-08-21rustdoc: Rename `clean` items from typedef to type aliasNoah Lev-48/+52
2023-08-21rustdoc: Rename "Type Definition" to "Type Alias"Noah Lev-3/+3
This matches the name used by the Rust Reference [1], which is also what people usually call these items. [1]: https://doc.rust-lang.org/reference/items/type-aliases.html
2023-08-21Auto merge of #106561 - GuillaumeGomez:warning-block, r=rustdocbors-3/+26
Add warning block support in rustdoc Fixes https://github.com/rust-lang/rust/issues/79710. You can test it [here](https://rustdoc.crud.net/imperio/warning-block/foo/struct.Foo.html). It currently looks like this: ![image](https://user-images.githubusercontent.com/3050060/211413494-e1cf04e4-c081-4a9d-97db-27329405cfa7.png) So a few things to note: * Since it's a new add and it's changing the UI, we'll need to go through an FCP. * Does the UI looks good? * Is the way picked to add a warning block ok for everyone? The discussion on the issue seemed to be in favour of this solution but it doesn't hurt to double-check. cc `@rust-lang/rustdoc`
2023-08-18Fix formatKyle Lin-1/+1
2023-08-18Fix private function importingKyle Lin-1/+1
2023-08-18Skip lint check when item is not fully publicKyle Lin-0/+19
2023-08-18relax redundancy constraintKyle Lin-6/+1
2023-08-18narrow down the lint trigger constraintKyle Lin-22/+51
2023-08-18fomar filesKyle Lin-4/+9
2023-08-18Still resolving rustdoc resolution panickingKyle Lin-71/+74
2023-08-18Support Reference & ReferenceUnknown link lintKyle Lin-61/+221
2023-08-18Refactor lint from rustc to rustdocKyle Lin-28/+192
2023-08-18add more testsKyle Lin-1/+1
2023-08-18Fix resolution cachingKyle Lin-37/+36
2023-08-18Add warn level lint `redundant_explicit_links`Kyle Lin-11/+102
- Currently it will panic due to the resolution's caching issue
2023-08-18rework link parsing loopKyle Lin-24/+65
2023-08-17Rollup merge of #112751 - ehuss:persist-test-run-directory, r=jshaMatthias Krüger-0/+16
rustdoc: Fixes with --test-run-directory and relative paths. Fixes #112191 Fixes #112210 This fixes some issues with `--test-run-directory` and its interaction with `--runtool` and `--persist-doctests`. Relative directories don't work with `Command::current_dir` very well because it has platform-specific behavior with relative paths. This fixes it by avoiding the use of relative paths. This is needed because cargo is switching to use `--test-run-directory`, and it uses relative paths when interacting with rustdoc/rustc.
2023-08-16Rollup merge of #114822 - GuillaumeGomez:code-readability-improvement, ↵Matthias Krüger-336/+342
r=notriddle Improve code readability by moving fmt args directly into the string There are some of occurrences where I also transformed `write!(f, "{}", x)` into `f.write_str(x.as_str())`. r? `@notriddle`
2023-08-16Rollup merge of #113115 - tshepang:patch-5, r=est31Matthias Krüger-1/+1
we are migrating to askama see https://github.com/rust-lang/rust/issues/108868
2023-08-16Use more named format argsGuillaume Gomez-85/+130
2023-08-16Improve code readability by moving fmt args directly into the stringGuillaume Gomez-300/+261
2023-08-15Rollup merge of #114772 - fee1-dead-contrib:typed-did, r=b-naberGuillaume Gomez-5/+5
Add `{Local}ModDefId` to more strongly type DefIds` Based on #110862 by `@Nilstrieb`
2023-08-14add a csky-unknown-linux-gnuabiv2 targetDirreke-0/+1
2023-08-14Add warning block support in rustdocGuillaume Gomez-3/+26
2023-08-14Use `{Local}ModDefId` in many queriesNilstrieb-5/+5
2023-08-11rustc: Move `features` from `Session` to `GlobalCtxt`Vadim Petrochenkov-3/+3
Removes two pieces of mutable state. Follow up to #114622.
2023-08-08Rollup merge of #114566 - fmease:type-alias-laziness-is-crate-specific, ↵Matthias Krüger-9/+28
r=oli-obk Store the laziness of type aliases in their `DefKind` Previously, we would treat paths referring to type aliases as *lazy* type aliases if the current crate had lazy type aliases enabled independently of whether the crate which the alias was defined in had the feature enabled or not. With this PR, the laziness of a type alias depends on the crate it is defined in. This generally makes more sense to me especially if / once lazy type aliases become the default in a new edition and we need to think about *edition interoperability*: Consider the hypothetical case where the dependency crate has an older edition (and thus eager type aliases), it exports a type alias with bounds & a where-clause (which are void but technically valid), the dependent crate has the latest edition (and thus lazy type aliases) and it uses that type alias. Arguably, the bounds should *not* be checked since at any time, the dependency crate should be allowed to change the bounds at will with a *non*-major version bump & without negatively affecting downstream crates. As for the reverse case (dependency: lazy type aliases, dependent: eager type aliases), I guess it rules out anything from slight confusion to mild annoyance from upstream crate authors that would be caused by the compiler ignoring the bounds of their type aliases in downstream crates with older editions. --- This fixes #114468 since before, my assumption that the type alias associated with a given weak projection was lazy (and therefore had its variances computed) did not necessarily hold in cross-crate scenarios (which [I kinda had a hunch about](https://github.com/rust-lang/rust/pull/114253#discussion_r1278608099)) as outlined above. Now it does hold. `@rustbot` label F-lazy_type_alias r? `@oli-obk`
2023-08-07Store the laziness of type aliases in the DefKindLeón Orell Valerian Liehr-9/+28
2023-08-05Auto merge of #113734 - cjgillot:no-crate-lint, r=petrochenkovbors-4/+4
Convert builtin "global" late lints to run per module The compiler currently has 4 non-incremental lints: 1. `clashing_extern_declarations`; 2. `missing_debug_implementations`; 3. ~`unnameable_test_items`;~ changed by https://github.com/rust-lang/rust/pull/114414 4. `missing_docs`. Non-incremental lints get reexecuted for each compilation, which is slow. Moreover, those lints are allow-by-default, so run for nothing most of the time. This PR attempts to make them more incremental-friendly. `clashing_extern_declarations` is moved to a standalone query. `missing_debug_implementation` can use `non_blanket_impls_for_ty` instead of recomputing it. `missing_docs` is harder as it needs to track if there is a `doc(hidden)` module surrounding. I hack around this using the lint level engine. That's easy to implement and allows to re-enable the lint for a re-exported module, while a more proper solution would reuse the same device as `unnameable_test_items`.
2023-08-04Rollup merge of #114475 - GuillaumeGomez:migrate-gui-test-color-27, r=notriddleMichael Goulet-2/+2
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? `@notriddle`
2023-08-04Auto merge of #114104 - oli-obk:syn2, r=compiler-errorsbors-53/+13
Lots of tiny incremental simplifications of `EmitterWriter` internals ignore the first commit, it's https://github.com/rust-lang/rust/pull/114088 squashed and rebased, but it's needed to use to use `derive_setters`, as they need a newer `syn` version. Then this PR starts out with removing many arguments that are almost always defaulted to `None` or `false` and replace them with builder methods that can set these fields in the few cases that want to set them. After that it's one commit after the other that removes or merges things until everything becomes some very simple trait objects
2023-08-04Use similar color scheme to make it obvious they are linkedGuillaume Gomez-2/+2
2023-08-04Add comment for rustdoc overrides.Camille GILLOT-0/+1
2023-08-04Make MissingDoc a module lint.Camille GILLOT-4/+3
2023-08-03Auto merge of #114353 - nnethercote:parser-ast-cleanups, r=petrochenkovbors-9/+5
Some parser and AST cleanups Things I found while looking closely at this code. r? `@petrochenkov`
2023-08-02Remove constness from `TraitPredicate`Deadbeef-3/+2
2023-08-02Rollup merge of #114321 - SparrowLii:parallel_test, r=oli-obkNilstrieb-6/+0
get auto traits for parallel rustc test for #106930 #[Edit] Since this doesn't block try build now, we can close https://github.com/rust-lang/rust/issues/106930 fixes #106930
2023-08-02get auto traits for parallel rustcSparrowLii-6/+0
Signed-off-by: SparrowLii <liyuan179@huawei.com>
2023-08-02Only call `parse_token_tree` once.Nicholas Nethercote-5/+4
This code currently uses a `while` loop and gathers token trees into a vector, but it only succeeds in the case where there is a single token tree. We can instead just call `parse_token_tree` once and then look for `Eof` to detect the success case.
2023-08-02Inline and remove `parse_all_token_trees`.Nicholas Nethercote-1/+4
It has a single call site.
2023-08-02`parse_all_token_trees` cannot fail.Nicholas Nethercote-7/+1
2023-07-31rustdoc: align stability badge to baseline instead of bottomMichael Howell-0/+1
r? @joshtripplet
2023-07-31Remove a `bool` for color in favor of the `WriteColor` trait wrapping ↵Oli Scherer-2/+2
colored and uncolored printing