| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Instead of a `Vec`, to avoid some allocations.
|
|
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.
|
|
Most of the methods returning `impl Display` have `print` in their name.
This commit renames a few that didn't follow that convention.
|
|
To avoids the early return and duplication of `Ok((url_parts, shortty,
fqp))`.
|
|
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).
|
|
This reverts part of #91948, going back to returning a
`UrlPartsBuilder`. It makes the code simpler, and also avoids some
allocations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rustdoc: on mobile, make the sidebar full width and linewrap
this is because the mobile sidebar cannot be resized, unlike on desktop.
|
|
Update askama to `0.14.0`
[Askama 0.14.0 release notes](https://github.com/askama-rs/askama/releases/tag/v0.14.0)
Just one change needed for a filter in rustdoc.
r? ```@notriddle```
|
|
fixes https://github.com/rust-lang/rust/issues/141092
|
|
|
|
rustdoc: Speed up `TypeAliasPart::get`
Big speedups here on a couple of the benchmarks.
r? `@GuillaumeGomez`
|
|
|
|
This is a huge perf win for rustdoc on the `typenum` and `nalgebra`
benchmarks, because the `else` branch doesn't get hit much.
|
|
The comparison against `text` seems to be unnecessary.
|
|
yotamofek:pr/rustdoc/format_integer_with_underscore_sep, r=notriddle
Simplify `format_integer_with_underscore_sep`
Noticed that this helper fn only ever gets called with decimal-base-formatted ints, so can be simplified a lot by not trying to handle hex and octal radixes.
Second commit is completely unrelated, just simplified some code I wrote a while back 😁
|
|
|
|
Only ever needs to handle decimal reprs
|
|
rustdoc JSON: Don't apply `#[repr]` privacy heuristics
Split out from #116882.
Context: https://github.com/rust-lang/rust/pull/116882#issuecomment-2888349161.
Partially reverts #138018.
cc `@obi1kenobi`
r? aDotInTheVoid or rustdoc
|
|
r=GuillaumeGomez
Improve handling of rustdoc lints when used with raw doc fragments.
1. `rustdoc::bare_urls` no longer outputs incoherent suggestions if `source_span_for_markdown_range` returns None, instead outputting no suggestion
2. `source_span_for_markdown_range` has one more heuristic, so it will return `None` less often.
3. add ui test to make sure we don't emit nonsense suggestions.
fixes https://github.com/rust-lang/rust/issues/135851
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1. rustdoc::bare_urls doesn't output
invalid suggestions if source_span_for_markdown_range
fails to find a span
2. source_span_for_markdown_range tries harder to
return a span by applying an additional diagnostic
fixes https://github.com/rust-lang/rust/issues/135851
|
|
r=GuillaumeGomez
Remove unnecessary `is_empty` checks
Part of #137978.
r? `@GuillaumeGomez`
|
|
Emit a warning if the doctest `main` function will not be run
Fixes #140310.
I think we could try to go much further like adding a "link" (ie UI annotations) on the `main` function in the doctest. However that will require some more computation, not sure if it's worth it or not. Can still be done in a follow-up if we want it.
For now, this PR does two things:
1. Pass the `DiagCtxt` to the doctest parser to emit the warning.
2. Correctly generate the `Span` to where the doctest is starting (I hope the way I did it isn't too bad either...).
cc `@fmease`
r? `@notriddle`
|
|
r=notriddle
rustdoc: Fix links with inline code in trait impl docs
Fixes #140857
|
|
It was added in #140052, but the subsequent changes in #140252 means it
is no longer necessary. (Indeed, `Ident`s cannot be empty any more.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 with this PR:

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.
|
|
|
|
Remove #![feature(let_chains)] from library and src/librustdoc
PR https://github.com/rust-lang/rust/pull/132833 has stabilized the `let_chains` feature. This PR removes the last occurences from the library, the compiler, and librustdoc (also because #140887 missed the conditional in one of the crates as it was behind the "rustc" feature).
We keep `core` as exercise for the future as updating it is non-trivial (see PR thread).
|
|
|
|
|