about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2025-07-08Auto merge of #142869 - nnethercote:join_path-mini, r=camelidbors-2/+2
Use `join_with_double_colon` in `write_shared.rs`. For consistency. Also, it's faster because `join_with_double_colon` does a better job estimating the allocation size than `join` from `itertools`. r? `@camelid`
2025-07-07Remove unused allow attrsYotam Ofek-2/+0
2025-07-07Rollup merge of #143544 - workingjubilee:rename-bare-fn, r=fmeaseJacob Pratt-2/+2
compiler: rename BareFn to FnPtr At some point "BareFn" was the chosen name for a "bare" function, without the niceties of `~fn`, `&fn`, or a few other ways of writing a function type. However, at some point the syntax for a "bare function" and any other function diverged even more. We started calling them what they are: function pointers, denoted by their own syntax. However, we never changed the *internal* name for these, as this divergence was very gradual. Personally, I have repeatedly searched for "FnPtr" and gotten confused until I find the name is BareFn, only to forget this until the next time, since I don't routinely interact with the higher-level AST and HIR. But even tools that interact with these internal types only touch on them in a few places, making a migration easy enough. Let's use a more intuitive and obvious name, as this 12+ year old name has little to do with current Rust.
2025-07-06rustdoc: migrate BareFn -> FnPtrJubilee Young-2/+2
2025-07-06Rewrite empty attribute lintJonathan Brouwer-1/+1
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-05Auto merge of #139598 - compiler-errors:no-bound-var-symbol, r=WaffleLapkinbors-47/+49
Remove `Symbol` from `Named` variant of `BoundRegionKind`/`LateParamRegionKind` The `Symbol` is redundant, since we already store a `DefId` in the region variant. Instead, load the name via `item_name` when needed (which is almost always on the diagnostic path). This introduces a `BoundRegionKind::NamedAnon` which is used for giving anonymous bound regions names, but which should only be used during pretty printing and error reporting.
2025-07-04Port `#[non_exhaustive]` to the new attribute parsing infrastructureJonathan Brouwer-1/+3
2025-07-04Same for typesMichael Goulet-2/+3
2025-07-04Remove Symbol for Named LateParam/Bound variantsMichael Goulet-45/+46
2025-07-04Rollup merge of #143381 - fee1-dead-contrib:push-pzxuvlnymxpu, r=GuillaumeGomezJacob Pratt-1/+14
rustdoc: don't treat methods under const impls or traits as const Fixes rust-lang/rust#143071
2025-07-03Rollup merge of #141831 - lolbinarycat:rustdoc-extern-reexport-135092, ↵Guillaume Gomez-13/+26
r=GuillaumeGomez rustdoc: fix attrs of locally reexported foreign items fixes rust-lang/rust#135092 also tweaks a few outdated/misleading comments. r? `@GuillaumeGomez`
2025-07-03rustdoc: don't treat methods under const impls or traits as constDeadbeef-1/+14
2025-07-03Auto merge of #143363 - jdonszelmann:rollup-7cv1kql, r=jdonszelmannbors-26/+32
Rollup of 6 pull requests Successful merges: - rust-lang/rust#134006 (setup typos check in CI) - rust-lang/rust#142876 (Port `#[target_feature]` to new attribute parsing infrastructure) - rust-lang/rust#143038 (avoid suggesting traits from private dependencies) - rust-lang/rust#143083 (Fix rustdoc not correctly showing attributes on re-exports) - rust-lang/rust#143283 (document optional jobs) - rust-lang/rust#143329 (minicore: use core's `diagnostic::on_unimplemented` messages) Failed merges: - rust-lang/rust#143237 (Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-03Rollup merge of #143083 - JonathanBrouwer:rustdoc-fix, r=jdonszelmannJana Dönszelmann-1/+2
Fix rustdoc not correctly showing attributes on re-exports Fixes attributes not being shown correctly in rustdoc on re-exports Does this need to be backported to beta? r? ``@jdonszelmann``
2025-07-03Rollup merge of #143038 - Qelxiros:142676-private-dependency-traits, r=tgross35Jana Dönszelmann-2/+2
avoid suggesting traits from private dependencies fixes rust-lang/rust#142676 fixes rust-lang/rust#138191 r? ``@tgross35``
2025-07-03Rollup merge of #142876 - JonathanBrouwer:target_feature_parser, r=oli-obkJana Dönszelmann-12/+17
Port `#[target_feature]` to new attribute parsing infrastructure Ports `target_feature` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197 r? ``@jdonszelmann``
2025-07-03Rollup merge of #134006 - klensy:typos, r=nnethercoteJana Dönszelmann-11/+11
setup typos check in CI This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying? Also includes commits with actual typo fixes. MCP: https://github.com/rust-lang/compiler-team/issues/817 typos check currently turned for: * ./compiler * ./library * ./src/bootstrap * ./src/librustdoc After merging, PRs which enables checks for other crates (tools) can be implemented too. Found typos will **not break** other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr. Check typos: `python x.py test tidy --extra-checks=spellcheck` Apply typo fixes: `python x.py test tidy --extra-checks=spellcheck:fix` (in case if there only 1 suggestion of each typo) Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.
2025-07-03Auto merge of #142910 - yotamofek:pr/rustdoc/markdown-lazy-to-string, ↵bors-86/+83
r=GuillaumeGomez Lazy-ify some markdown rendering Seems to have a positive effect in my local perf runs 😍 r? `@GuillaumeGomez` if you're interested, otherwise feel free to reassign (would also love a perf run)
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-11/+11
2025-07-03Port `#[target_feature]` to the new attribute parsing infrastructureJonathan Brouwer-12/+17
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-02avoid suggesting traits from private dependenciesJeremy Smart-2/+2
2025-07-01Improve CSS for source code block line numbersGuillaume Gomez-68/+30
2025-06-29Port #[link_section] to the new attribute parsing infrastructureAnne Stijns-1/+4
2025-06-29Lazy-ify some markdown renderingYotam Ofek-86/+83
2025-06-29Don't try to guess how much to pre-allocateYotam Ofek-2/+2
Removing this heuristic doesn't show up as a regression in perf run
2025-06-29Rollup merge of #143155 - yotamofek:pr/rustdoc/housekeeping, r=GuillaumeGomezMatthias Krüger-12/+8
`librustdoc` house-keeping 🧹 This PR mostly removes a bunch of crate-level attributes that were added at some point, but then later on became unnecessary: - some `#[feature]` gates - some `#[allow]`s - a `#[recursion_limit]` Then I went ahead and sprinkled some tidy sorting on the remaining attrs, and `Cargo.toml`. Trying to give my anal retentiveness some peace of mind 😅
2025-06-28Rollup merge of #142987 - lolbinarycat:rustdoc-non_exhaustive-enum-v-142599, ↵Matthias Krüger-0/+1
r=GuillaumeGomez rustdoc: show attributes on enum variants mostly for #[non_exhaustive] unsure if there's any attributes we should take care to *not* include, it could use `render_code_attribute` and `is_non_exhaustive` instead, if that is a concern. fixes rust-lang/rust#142599
2025-06-28librustdoc: use tidy for sorting attrs and depsYotam Ofek-4/+8
2025-06-28librustdoc: remove unused feature gatesYotam Ofek-4/+0
2025-06-28librustdoc: remove unneeded `#[recursion_limit]`Yotam Ofek-1/+0
2025-06-28librustdoc: remove unneeded `#[allow]`sYotam Ofek-3/+0
2025-06-27Fix rustdoc not correctly showing attributes with re-exportsJonathan Brouwer-1/+2
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-27Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-deadMatthias Krüger-4/+4
New const traits syntax This PR only affects the AST and doesn't actually change anything semantically. All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error r? ``@fee1-dead`` cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
2025-06-27rustdoc: fix attrs of locally reexported foreign itemsbinarycat-11/+24
2025-06-27rustdoc: add regression test for issue 135092binarycat-2/+2
2025-06-27Rollup merge of #142270 - lolbinarycat:rustdoc-search-Results-type, ↵Guillaume Gomez-77/+43
r=GuillaumeGomez Rustdoc js: even more typechecking improvements I noticed some oddities when I went to start working on type aliases, so I've gone and cleaned up a bunch of stuff. Notably `fullId` was nearly always an integer in practice, but tsc was being told it should be a string. r? ``@notriddle``
2025-06-27Auto merge of #143074 - compiler-errors:rollup-cv64hdh, r=compiler-errorsbors-1/+4
Rollup of 18 pull requests Successful merges: - rust-lang/rust#137843 (make RefCell unstably const) - rust-lang/rust#140942 (const-eval: allow constants to refer to mutable/external memory, but reject such constants as patterns) - rust-lang/rust#142549 (small iter.intersperse.fold() optimization) - rust-lang/rust#142637 (Remove some glob imports from the type system) - rust-lang/rust#142647 ([perf] Compute hard errors without diagnostics in impl_intersection_has_impossible_obligation) - rust-lang/rust#142700 (Remove incorrect comments in `Weak`) - rust-lang/rust#142927 (Add note to `find_const_ty_from_env`) - rust-lang/rust#142967 (Fix RwLock::try_write documentation for WouldBlock condition) - rust-lang/rust#142986 (Port `#[export_name]` to the new attribute parsing infrastructure) - rust-lang/rust#143001 (Rename run always ) - rust-lang/rust#143010 (Update `browser-ui-test` version to `0.20.7`) - rust-lang/rust#143015 (Add `sym::macro_pin` diagnostic item for `core::pin::pin!()`) - rust-lang/rust#143033 (Expand const-stabilized API links in relnotes) - rust-lang/rust#143041 (Remove cache for citool) - rust-lang/rust#143056 (Move an ACE test out of the GCI directory) - rust-lang/rust#143059 (Fix 1.88 relnotes) - rust-lang/rust#143067 (Tracking issue number for `iter_macro`) - rust-lang/rust#143073 (Fix some fixmes that were waiting for let chains) Failed merges: - rust-lang/rust#143020 (codegen_fn_attrs: make comment more precise) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-26rustdoc: show attributes on enum variantsbinarycat-0/+1
mostly for #[non_exhaustive]
2025-06-26rustdoc js: several typechecking improvmentsbinarycat-77/+43
non-exhaustive list of changes: * rustdoc.Results has a max_dist field * improve typechecking around pathDist and addIntoResults * give handleNameSearch a type signature * typecheck sortQ * currentCrate is string and not optional * searchState is referenced as a global, not through window
2025-06-26Rollup merge of #141648 - GuillaumeGomez:redundant_explicit_links-expansion, ↵Matthias Krüger-26/+65
r=lolbinarycat [rustdoc] Do not emit redundant_explicit_links lint if the doc comment comes from expansion Fixes https://github.com/rust-lang/rust/issues/141553. The problem was that we change the context for the attributes in some cases to get better error output, preventing us to detect if the attribute comes from expansion. Most of the changes are about keeping track of the "does this span comes from expansion" information. r? ```@Manishearth```
2025-06-26Change const trait bound syntax from ~const to [const]Oli Scherer-4/+4
2025-06-26Port `#[export_name]` to the new attribute parsing infrastructureJonathan Brouwer-1/+4
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-24Rollup merge of #142977 - aDotInTheVoid:rustdochtml-targetfeature, ↵Jubilee-1/+2
r=GuillaumeGomez rustdoc: Don't mark `#[target_feature]` functions as ⚠ Closes https://github.com/rust-lang/rust/issues/142952
2025-06-24rustdoc: Don't mark `#[target_feature]` functions as ⚠Alona Enraght-Moony-1/+2
Closes https://www.github.com/rust-lang/rust/issues/142952
2025-06-24Rollup merge of #142799 - petrochenkov:expnop, r=bjorn3Matthias Krüger-13/+8
rustc_session: Add a structure for keeping both explicit and default sysroots Also avoid creating and cloning sysroot unnecessarily. Implements the suggestion from https://github.com/rust-lang/rust/pull/142089#discussion_r2132204079. r? ``@bjorn3``
2025-06-24rustc_session: Add a structure for keeping both explicit and default sysrootsVadim Petrochenkov-13/+8
Also avoid creating and cloning sysroot unnecessarily.
2025-06-24Rollup merge of #142932 - Enselic:keep-empty-generic-params, r=aDotInTheVoidGuillaume Gomez-13/+16
rustdoc-json: Keep empty generic args if parenthesized Because in the case of for example pub fn my_fn3(f: impl FnMut()) {} we want to keep `()` even if it is empty since that matches e.g. Rust syntax requirements. This is an amendment to https://github.com/rust-lang/rust/pull/142502, so: r? ``@aDotInTheVoid`` cc ``@nnethercote`` cc https://github.com/cargo-public-api/cargo-public-api/pull/798
2025-06-24Rollup merge of #142354 - gstjepan2:firefox_copy_paste_issue, r=GuillaumeGomezGuillaume Gomez-1/+29
Fixes firefox copy paste issue
2025-06-24rustdoc-json: Keep empty generic args if parenthesizedMartin Nordholts-13/+16
Because in the case of for example pub fn my_fn3(f: impl FnMut()) {} we want to keep `()` even if it is empty since that matches e.g. Rust syntax requirements.
2025-06-23Fix comment on NoMangleJonathan Brouwer-1/+2
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>