summary refs log tree commit diff
path: root/tests/rustdoc
AgeCommit message (Collapse)AuthorLines
2024-03-14testsManish Goregaokar-4/+8
2024-03-12Rollup merge of #122355 - fmease:rustdoc-fix-up-old-test, r=notriddleJubilee-15/+26
rustdoc: fix up old test `tests/rustdoc/line-breaks.rs` had several issues: 1. It used `//`@count`` instead of `// `@count`` (notice the space!) which gets treated as a `ui_test` directive instead of a `htmldocck` one. `compiletest` didn't flag it as an error because it's allowlisted ([#121561](https://github.com/rust-lang/rust/pull/121561)) presumably precisely because of this test. And before the compiletest→ui_test migration, these directives must've been ignored, too, because … 2. … the checks themselves no longer work either: The count of `<br>`s is actually 0 in all 3 cases because – well – we no longer generate any `<br>`s inside `<pre>`s. Since I don't know how to ``@count`` `\n`s instead of `<br>`s, I've turned them into ``@matches`.` Btw, I don't know if this test is still desirable or if we have other tests that cover this (I haven't checked). r? rustdoc
2024-03-12rustdoc: fix up old testLeón Orell Valerian Liehr-15/+26
2024-03-11Rollup merge of #121840 - oli-obk:freeze, r=dtolnayJacob Pratt-7/+10
Expose the Freeze trait again (unstably) and forbid implementing it manually non-emoji version of https://github.com/rust-lang/rust/pull/121501 cc #60715 This trait is useful for generic constants (associated consts of generic traits). See the test (`tests/ui/associated-consts/freeze.rs`) added in this PR for a usage example. The builtin `Freeze` trait is the only way to do it, users cannot work around this issue. It's also a useful trait for building some very specific abstrations, as shown by the usage by the `zerocopy` crate: https://github.com/google/zerocopy/issues/941 cc ```@RalfJung``` T-lang signed off on reexposing this unstably: https://github.com/rust-lang/rust/pull/121501#issuecomment-1969827742
2024-03-05Update test names to not have dots许杰友 Jieyou Xu (Joe)-0/+0
2024-03-01Add regression test for #121772Guillaume Gomez-0/+24
2024-02-29Expose `Freeze` trait againOli Scherer-7/+10
2024-02-29Rollup merge of #121689 - GuillaumeGomez:rustdoc-highlighting-whitespace, ↵Matthias Krüger-0/+29
r=notriddle [rustdoc] Prevent inclusion of whitespace character after macro_rules ident Discovered this bug randomly when looking at: ![image](https://github.com/rust-lang/rust/assets/3050060/dca38047-9085-4377-bfac-f98890224be4) We were too eagerly trying to merge tokens that shouldn't be merged together (for example if you have a code comment followed by a code comment, we merge them in one attribute to reduce the DOM size). r? ``@notriddle``
2024-02-28Add regression test for inclusion of whitespace characters in rustdoc ↵Guillaume Gomez-0/+29
highlighting
2024-02-28Rollup merge of #121680 - GuillaumeGomez:foreign-macro-jump-to-def, r=notriddleGuillaume Gomez-0/+21
Fix link generation for foreign macro in jump to definition feature The crate name is already added to the link so it shouldn't be added a second time for local foreign macros. r? ``@notriddle``
2024-02-28Rollup merge of #121572 - notriddle:notriddle/test-case-121106, r=GuillaumeGomezGuillaume Gomez-0/+19
Add test case for primitive links in alias js Follow up #121490 CC #121106
2024-02-27Add regression test for link generation on foreign macro in jump to ↵Guillaume Gomez-0/+21
defintion feature
2024-02-26Auto merge of #121461 - reitermarkus:generic-nonzero-tests, r=dtolnaybors-1/+1
Use generic `NonZero` in tests. Tracking issue: https://github.com/rust-lang/rust/issues/120257 r? `@dtolnay`
2024-02-25Use generic `NonZero` in tests.Markus Reiter-1/+1
2024-02-24Add test case for primitive links in alias jsMichael Howell-0/+19
2024-02-24Add test cases for inlining compiler-private itemsMichael Howell-0/+25
Closes #106421 This was already fixed by f5d43a052b9eb464e54af819143467954d814a24, but now the test cases are added.
2024-02-22[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives许杰友 Jieyou Xu (Joe)-466/+466
2024-02-18Rollup merge of #121218 - ShoyuVanilla:fix-issue-76736, r=notriddleLeón Orell Valerian Liehr-0/+58
Fix missing trait impls for type in rustc docs Fixes #76736
2024-02-18Rollup merge of #121160 - fmease:rustdoc-fix-n-refactor-html-rendering, ↵León Orell Valerian Liehr-1/+13
r=GuillaumeGomez rustdoc: fix and refactor HTML rendering a bit * refactoring: get rid of a bunch of manual `f.alternate()` branches * not sure why this wasn't done so already, is this perf-sensitive? * fix an ICE in debug builds of rustdoc * rustdoc used to crash on empty outlives-bounds: `where 'a:` * properly escape const generic defaults * actually print empty trait and outlives-bounds (doesn't work for cross-crate reexports yet, will fix that at some other point) since they can have semantic significance * outlives-bounds: forces lifetime params to be early-bound instead of late-bound which is technically speaking part of the public API * trait-bounds: can affect the well-formedness, consider * makeshift “const-evaluatable” bounds under `generic_const_exprs` * bounds to force wf-checking in light of #100041 (quite artificial I know, I couldn't figure out something better), see https://github.com/rust-lang/rust/pull/121160#discussion_r1491563816
2024-02-17Fix missing trait impls for type in rustc docsShoyu Vanilla-0/+58
2024-02-16rustdoc: fix and refactor HTML rendering a bitLeón Orell Valerian Liehr-1/+13
2024-02-16Rollup merge of #121095 - chenyukang:yukang-fix-120998-rust-playground-link, ↵Guillaume Gomez-2/+2
r=GuillaumeGomez Add extra indent spaces for rust-playground link Fixes #120998 Seems add `rustfmt` for this is somehow too heavy, only adding indent spaces at the starting of each line of code seems good enough.
2024-02-15add extra indent spaces for rust-playground linkyukang-2/+2
2024-02-15Rollup merge of #121022 - fmease:rustdoc-x-crate-late-bound-lt-src-order, ↵Matthias Krüger-0/+34
r=GuillaumeGomez rustdoc: cross-crate re-exports: correctly render late-bound params in source order even if early-bound params are present r? ghost
2024-02-15rustdoc: cross-crate re-exports: correctly render late-bound params in ↵León Orell Valerian Liehr-0/+34
source order even if early-bound params are present
2024-02-13Rollup merge of #120548 - GuillaumeGomez:glob-reexport-cfg-merge, ↵Matthias Krüger-0/+29
r=GuillaumeGomez rustdoc: Fix handling of doc_auto_cfg feature for cfg attributes on glob reexport This is a follow-up of #120501 and a part of https://github.com/rust-lang/rust/issues/120487. r? `@notriddle`
2024-02-09Unify item relative path computation in one functionGuillaume Gomez-4/+37
2024-02-09Add regression test for non local items link generationGuillaume Gomez-0/+15
2024-02-01Add regression test for `doc_auto_cfg` feature handling with glob reexportsGuillaume Gomez-0/+29
2024-01-31Rollup merge of #120501 - GuillaumeGomez:glob-reexport-attr-merge-bugfix, ↵Nadrieril-0/+32
r=notriddle rustdoc: Correctly handle attribute merge if this is a glob reexport Fixes #120487. The regression was introduced in https://github.com/rust-lang/rust/pull/113091. Only non-glob reexports should have been impacted. cc `````@Nemo157````` r? `````@notriddle`````
2024-01-30Add regression test for #120487Guillaume Gomez-0/+32
2024-01-29Add regression test for #100638Guillaume Gomez-0/+15
2024-01-23Remove uses of no-system-llvmNikita Popov-1/+0
It looks like none of these are actually needed.
2024-01-20Add regression test for #119015 and update testsGuillaume Gomez-7/+38
2024-01-19Rollup merge of #117662 - GuillaumeGomez:links-in-headings, r=notriddleMatthias Krüger-11/+35
[rustdoc] Allows links in headings Reopening of https://github.com/rust-lang/rust/pull/94360. # Explanations Rustdoc currently doesn't follow the markdown spec on headings: we don't allow links in them. So instead of having headings linking to themselves, this PR generates an anchor on the left side like this: ![image](https://github.com/rust-lang/rust/assets/3050060/a118a7e9-5ef8-4d07-914f-46defc3245c3) <details> <summary>previous version</summary> ![image](https://github.com/rust-lang/rust/assets/3050060/c34fa844-9cd4-47dc-bb51-b37f5f66afee) </details> Having the anchor always displayed allows for mobile devices users to be able to have a link to the anchor. The different color used for the anchor itself is the same as links so people notice when looking at it that they can click on it. You can test it [here](https://rustdoc.crud.net/imperio/links-in-headings/std/index.html). cc `@camelid` r? `@notriddle`
2024-01-14Rollup merge of #119561 - notriddle:master, r=fmeaseGuillaume Gomez-258/+108
rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 5) Follow up * https://github.com/rust-lang/rust/pull/116214 * https://github.com/rust-lang/rust/pull/116432 * https://github.com/rust-lang/rust/pull/116824 * https://github.com/rust-lang/rust/pull/118105
2024-01-10Rollup merge of #119769 - fmease:rustdoc-off-by-one-dyn-trait-def-gen-args, ↵Matthias Krüger-14/+30
r=GuillaumeGomez rustdoc: offset generic args of cross-crate trait object types when cleaning Fixes #119529. This PR contains several refactorings apart from the bug fix. Best reviewed commit by commit. r? GuillaumeGomez
2024-01-09Update testsLeón Orell Valerian Liehr-14/+30
2024-01-05Rollup merge of #119216 - weiznich:use_diagnostic_namespace_in_stdlib, ↵Michael Goulet-0/+3
r=compiler-errors Use diagnostic namespace in stdlib This required a minor fix to have the diagnostics shown in third party crates when the `diagnostic_namespace` feature is not enabled. See https://github.com/rust-lang/rust/pull/119216/commits/5d63f5d8d1a72167c1d5242b2e1ed5b7259fd526 for details. I've opted for having a single PR for both changes as it's really not that much code. If it is required it should be easy to split up the change into several PR's. r? `@compiler-errors`
2024-01-05Ignore a rustdoc testLeón Orell Valerian Liehr-0/+3
2024-01-05Rollup merge of #119586 - GuillaumeGomez:jump-to-def-static-methods, r=notriddleMichael Goulet-1/+28
[rustdoc] Fix invalid handling for static method calls in jump to definition feature I realized when working on a clippy lint that static method calls on `Self` could not give me the method `Res`. For that, we need to use `typeck` and so that's what I did in here. It fixes the linking to static method calls. r? ````@notriddle````
2024-01-04Add regression test for jump to def static method callsGuillaume Gomez-1/+28
2024-01-03rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 5)Michael Howell-208/+0
2024-01-03Add `crate_name` and URL to test casesMichael Howell-37/+95
2023-12-31Auto merge of #119066 - notriddle:notriddle/sidebar-source-redesign, ↵bors-4/+0
r=GuillaumeGomez rustdoc: clean up source sidebar hide button This is a redesign of the feature, with parts pulled from https://github.com/rust-lang/rust/pull/119049 but with a button that looks more like a button and matches the one used on other sidebar pages. Preview: * http://notriddle.com/rustdoc-html-demo-8/source-sidebar-resize/src/std/lib.rs.html * http://notriddle.com/rustdoc-html-demo-8/source-sidebar-resize/std/index.html | | Before | After | |--|--|--| | Closed | ![image](https://github.com/rust-lang/rust/assets/1593513/092bed75-79c3-412f-8e7b-557f30dfb1e3) | ![image](https://github.com/rust-lang/rust/assets/1593513/b68e1ee9-9aef-484d-a5b1-2fd29c9d72ea) | Open | ![image](https://github.com/rust-lang/rust/assets/1593513/95cf9545-25b1-48ec-820b-02e1aec99839) | ![image](https://github.com/rust-lang/rust/assets/1593513/923532f6-59e0-4d7c-9976-21699c30d42e) | Mobile Closed | ![image](https://github.com/rust-lang/rust/assets/1593513/9bc00cc5-937c-4120-94be-94c7cb6d5297) | ![image](https://github.com/rust-lang/rust/assets/1593513/76a744d8-aac2-46fe-abb9-3b34e2d3ccaa) | Mobile Open | ![image](https://github.com/rust-lang/rust/assets/1593513/d19a94fe-47b1-462d-a280-44fc215b9b72) | ![image](https://github.com/rust-lang/rust/assets/1593513/2b2e3dec-b610-4b12-8a72-35b86359ba45)
2023-12-23Strenghten `tests/rustdoc/trait-object-safe.rs` to prevent unforeseen regressionGuillaume Gomez-2/+2
2023-12-18Stop using the trigram of heaven as a hamburger buttonMichael Howell-4/+0
It doesn't look quite right, because the lines are too far apart, and it's not going to be announced by screenreaders as a menu button, since that's not what the symbol means. This adds a real tooltip and uses a better drawing of the icon.
2023-12-15Rollup merge of #113091 - GuillaumeGomez:prevent-cfg-merge-reexport, r=rustdocGuillaume Gomez-4/+34
Don't merge cfg and doc(cfg) attributes for re-exports Fixes #112881. ## Explanations When re-exporting things with different `cfg`s there are two things that can happen: * The re-export uses a subset of `cfg`s, this subset is sufficient so that the item will appear exactly with the subset * The re-export uses a non-subset of `cfg`s (e.g. like the example I posted just above where the re-export is ungated), if the non-subset `cfg`s are active (e.g. compiling that example on windows) then this will be a compile error as the item doesn't exist to re-export, if the subset `cfg`s are active it behaves like 1. ### Glob re-exports? **This only applies to non-glob inlined re-exports.** For glob re-exports the item may or may not exist to be re-exported (potentially the `cfg`s on the path up until the glob can be removed, and only `cfg`s on the globbed item itself matter), for non-inlined re-exports see https://github.com/rust-lang/rust/issues/85043. cc `@Nemo157` r? `@notriddle`
2023-12-05Rollup merge of #118594 - hdost:patch-1, r=fmeaseMatthias Krüger-1/+1
Remove mention of rust to make the error message generic. The deprecation notice is used when in crates as well. This applies to versions Rust or Crates. Relates #118148
2023-12-05Add tests for headings anchor and links in headingsGuillaume Gomez-0/+14