about summary refs log tree commit diff
path: root/tests/rustdoc-ui
AgeCommit message (Collapse)AuthorLines
2024-12-12Filter empty lines, comments and delimiters from previous to last multiline ↵Esteban Küber-25/+0
span rendering
2024-12-12Tweak multispan renderingEsteban Küber-135/+24
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
2024-12-08rustdoc: rename `issue-\d+.rs` tests to have meaningful namesMichael Howell-80/+80
2024-12-08Add URL to test casesMichael Howell-0/+9
2024-12-07fix rustdoc testEsteban Küber-2/+2
2024-12-07Use trait name instead of full constraint in suggestion messageEsteban Küber-2/+2
``` help: consider restricting type parameter `T` with traits `Copy` and `Trait` | LL | fn duplicate_custom<T: Copy + Trait>(t: S<T>) -> (S<T>, S<T>) { | ++++++++++++++ ``` ``` help: consider restricting type parameter `V` with trait `Copy` | LL | fn index<'a, K, V: std::marker::Copy>(map: &'a HashMap<K, V>, k: K) -> &'a V { | +++++++++++++++++++ ```
2024-12-07reword trait bound suggestion message to include the boundsEsteban Küber-4/+4
2024-12-01Rollup merge of #133595 - GuillaumeGomez:missing_doc_code_examples, r=notriddleMatthias Krüger-62/+26
Do not emit `missing_doc_code_examples` rustdoc lint on module and a few other items It doesn't make sense to expect modules to have code examples. Same goes for: * Trait aliases * Foreign items * Associated types and constants Should make the use of this lint a bit nicer. r? ``@notriddle``
2024-11-29Rollup merge of #133584 - ehuss:more-2024-unstable-options, r=compiler-errorsMatthias Krüger-3/+3
Update more 2024 tests to remove -Zunstable-options This removes `-Zunsable-options` from more tests that I missed in https://github.com/rust-lang/rust/pull/133349.
2024-11-29Remove last vestiges of `HybridBitSet`.Nicholas Nethercote-6/+6
This is in a test where the arrangement of backticks matters, but the exact words do not.
2024-11-28Update more 2024 tests to remove -Zunstable-optionsEric Huss-3/+3
2024-11-28Do not emit `missing_doc_code_examples` rustdoc lint on module and a few ↵Guillaume Gomez-62/+26
other items
2024-11-26Rollup merge of #133394 - compiler-errors:dyn-more-errors, r=lcnrMichael Goulet-11/+3
Bail on more errors in dyn ty lowering If we have more than one principal trait, or if we have a principal trait with errors in it, then bail with `TyKind::Error` rather than attempting lowering. Lowering a dyn trait with more than one principal just arbitrarily chooses the first one and drops the subsequent ones, and lowering a dyn trait path with errors in it is just kinda useless. This suppresses unnecessary errors which I think is net-good, but also is important to make sure that we don't end up leaking `{type error}` in https://github.com/rust-lang/rust/issues/133388 error messaging :) r? types
2024-11-23Dont create trait object if it has errors in itMichael Goulet-11/+3
2024-11-23only store valid proc marco item for doc linkbohan-0/+28
2024-11-22Stabilize the 2024 editionEric Huss-47/+53
2024-11-11Auto merge of #126597 - estebank:unicode-output, r=fmeasebors-1/+1
Add Unicode block-drawing compiler output support Add nightly-only theming support to rustc output using Unicode box drawing characters instead of ASCII-art to draw the terminal UI. In order to enable, the flags `-Zunstable-options=yes --error-format=human-unicode` must be passed in. After: ``` error: foo ╭▸ test.rs:3:3 │ 3 │ X0 Y0 Z0 │ ┌───╿──│──┘ │ ┌│───│──┘ │ ┏││━━━┙ │ ┃││ 4 │ ┃││ X1 Y1 Z1 5 │ ┃││ X2 Y2 Z2 │ ┃│└────╿──│──┘ `Z` label │ ┃└─────│──┤ │ ┗━━━━━━┥ `Y` is a good letter too │ `X` is a good letter ╰╴ note: bar ╭▸ test.rs:4:3 │ 4 │ ┏ X1 Y1 Z1 5 │ ┃ X2 Y2 Z2 6 │ ┃ X3 Y3 Z3 │ ┗━━━━━━━━━━┛ ├ note: bar ╰ note: baz note: qux ╭▸ test.rs:4:3 │ 4 │ X1 Y1 Z1 ╰╴ ━━━━━━━━ ``` Before: ``` error: foo --> test.rs:3:3 | 3 | X0 Y0 Z0 | ___^__-__- | |___|__| | ||___| | ||| 4 | ||| X1 Y1 Z1 5 | ||| X2 Y2 Z2 | |||____^__-__- `Z` label | ||_____|__| | |______| `Y` is a good letter too | `X` is a good letter | note: bar --> test.rs:4:3 | 4 | / X1 Y1 Z1 5 | | X2 Y2 Z2 6 | | X3 Y3 Z3 | |__________^ = note: bar = note: baz note: qux --> test.rs:4:3 | 4 | X1 Y1 Z1 | ^^^^^^^^ ``` After: ![rustc output with unicode box drawing characters](https://github.com/rust-lang/rust/assets/1606434/d210b79a-6579-4407-9706-ba8edc6e9f25) Before: ![current rustc output with ASCII art](https://github.com/rust-lang/rust/assets/1606434/5aecccf8-a6ee-4469-8b39-72fb0d979a9f)
2024-11-10Add Unicode block-drawing compiler output supportEsteban Küber-1/+1
Add nightly-only theming support to rustc output using Unicode box drawing characters instead of ASCII-art to draw the terminal UI: After: ``` error: foo ╭▸ test.rs:3:3 │ 3 │ X0 Y0 Z0 │ ┌───╿──│──┘ │ ┌│───│──┘ │ ┏││━━━┙ │ ┃││ 4 │ ┃││ X1 Y1 Z1 5 │ ┃││ X2 Y2 Z2 │ ┃│└────╿──│──┘ `Z` label │ ┃└─────│──┤ │ ┗━━━━━━┥ `Y` is a good letter too │ `X` is a good letter ╰╴ note: bar ╭▸ test.rs:4:3 │ 4 │ ┏ X1 Y1 Z1 5 │ ┃ X2 Y2 Z2 6 │ ┃ X3 Y3 Z3 │ ┗━━━━━━━━━━┛ ├ note: bar ╰ note: baz note: qux ╭▸ test.rs:4:3 │ 4 │ X1 Y1 Z1 ╰╴ ━━━━━━━━ ``` Before: ``` error: foo --> test.rs:3:3 | 3 | X0 Y0 Z0 | ___^__-__- | |___|__| | ||___| | ||| 4 | ||| X1 Y1 Z1 5 | ||| X2 Y2 Z2 | |||____^__-__- `Z` label | ||_____|__| | |______| `Y` is a good letter too | `X` is a good letter | note: bar --> test.rs:4:3 | 4 | / X1 Y1 Z1 5 | | X2 Y2 Z2 6 | | X3 Y3 Z3 | |__________^ = note: bar = note: baz note: qux --> test.rs:4:3 | 4 | X1 Y1 Z1 | ^^^^^^^^ ```
2024-11-04Add UI regressions tests for rustdoc `--show-coverage` optionGuillaume Gomez-0/+34
2024-10-30Rollup merge of #132210 - notriddle:notriddle/doctest-span-hack, ↵Jubilee-12/+86
r=GuillaumeGomez rustdoc: make doctest span tweak a 2024 edition change Fixes #132203 This is a compatibility hack, because I think the new behavior is better. When an A `include_str!` B, and B `include_str!` C, the path to C should be resolved relative to B, not A. That's how `include!` itself works, so that's how `include_str!` with should work.
2024-10-30Ignore Windows due to its differing path syntaxMichael Howell-4/+5
2024-10-30Rollup merge of #131096 - GuillaumeGomez:rm-no_unused, r=notriddle许杰友 Jieyou Xu (Joe)-0/+88
rustdoc: Remove usage of `allow(unused)` attribute on `no_run` merged doctests Fixes [#130681](https://github.com/rust-lang/rust/issues/130681). It fixes the behaviour difference with the current doctests. r? ``@notriddle``
2024-10-26rustdoc: make doctest span tweak a 2024 edition changeMichael Howell-12/+85
Fixes #132203 This is a compatibility hack, because I think the new behavior is better. When an A `include_str!` B, and B `include_str!` C, the path to C should be resolved relative to B, not A. That's how `include!` itself works, so that's how `include_str!` with should work.
2024-10-24Add regression test for #131893Guillaume Gomez-0/+31
2024-10-22Auto merge of #132035 - matthiaskrgr:rollup-ty1e4q0, r=matthiaskrgrbors-23/+31
Rollup of 8 pull requests Successful merges: - #125205 (Fixup Windows verbatim paths when used with the `include!` macro) - #131049 (Validate args are correct for `UnevaluatedConst`, `ExistentialTraitRef`/`ExistentialProjection`) - #131549 (Add a note for `?` on a `impl Future<Output = Result<..>>` in sync function) - #131731 (add `TestFloatParse` to `tools.rs` for bootstrap) - #131732 (Add doc(plugins), doc(passes), etc. to INVALID_DOC_ATTRIBUTES) - #132006 (don't stage-off to previous compiler when CI rustc is available) - #132022 (Move `cmp_in_dominator_order` out of graph dominator computation) - #132033 (compiletest: Make `line_directive` return a `DirectiveLine`) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-22Rollup merge of #131732 - m4tx:fix-82824, r=davidtwcoMatthias Krüger-23/+31
Add doc(plugins), doc(passes), etc. to INVALID_DOC_ATTRIBUTES This fixes #82824.
2024-10-22terminology: #[feature] *enables* a feature (instead of "declaring" or ↵Ralf Jung-1/+1
"activating" it)
2024-10-16Rollup merge of #131691 - GuillaumeGomez:intra-doc-link-filter-out-2, ↵Matthias Krüger-0/+64
r=notriddle Delay ambiguous intra-doc link resolution after `Cache` has been populated Fixes https://github.com/rust-lang/rust/issues/130233. I was getting nowhere with #130278. I took a wrong turn at some point and ended making way too many changes so instead I started again back from 0 and this time it worked out as expected. r? ```@notriddle```
2024-10-15Improve documentation for intra-doc links computationGuillaume Gomez-2/+2
2024-10-15Add doc(plugins), doc(passes), etc. to INVALID_DOC_ATTRIBUTESMateusz Maćkowski-23/+31
2024-10-14Add regression tests for #130233Guillaume Gomez-0/+64
2024-10-11Remove deprecation note in the `non_local_definitions` warningUrgau-2/+0
2024-10-04Rollup merge of #131260 - notriddle:notriddle/disambiguator-error, ↵Jubilee-18/+18
r=GuillaumeGomez rustdoc: cleaner errors on disambiguator/namespace mismatches Resolves https://github.com/rust-lang/rust/pull/131224#pullrequestreview-2348407077 r? `@jyn514`
2024-10-04rustdoc: cleaner errors on disambiguator/namespace mismatchesMichael Howell-18/+18
2024-10-04Auto merge of #131237 - GuillaumeGomez:rollup-il2i7z7, r=GuillaumeGomezbors-0/+19
Rollup of 4 pull requests Successful merges: - #131034 (Implement RFC3695 Allow boolean literals as cfg predicates) - #131202 (Use wide pointers consistenly across the compiler) - #131230 (Enable `--no-sandbox` option by default for rustdoc GUI tests) - #131232 (Week off of reviews to focus on docs) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-04Rollup merge of #131034 - Urgau:cfg-true-false, r=nnethercoteGuillaume Gomez-0/+19
Implement RFC3695 Allow boolean literals as cfg predicates This PR implements https://github.com/rust-lang/rfcs/pull/3695: allow boolean literals as cfg predicates, i.e. `cfg(true)` and `cfg(false)`. r? `@nnethercote` *(or anyone with parser knowledge)* cc `@clubby789`
2024-10-04Adjust rustdoc for literal boolean supportUrgau-0/+19
2024-10-03rustdoc: prevent ctors from resolvingMichael Howell-5/+102
2024-10-01Add regression tests for #130681Guillaume Gomez-0/+88
2024-10-01Auto merge of #131076 - lukas-code:doc-stab2, r=notriddlebors-0/+2
rustdoc: rewrite stability inheritance as a doc pass Since doc inlining can almost arbitrarily change the module hierarchy, we can't just use the HIR ancestors of an item to compute its effective stability. This PR moves the stability inheritance that I implemented in https://github.com/rust-lang/rust/pull/130798 into a new doc pass `propagate-stability` that runs after doc inlining and uses the post-inlining ancestors of an item to correctly compute its effective stability. fixes https://github.com/rust-lang/rust/issues/131020 r? `@notriddle`
2024-10-01Auto merge of #130587 - coolreader18:field-variant-doclink-disambig, ↵bors-23/+62
r=notriddle,jyn514 Add `field@` and `variant@` doc-link disambiguators I'm not sure if this is big enough to need an fcp or not, but this is something I found missing when trying to refer to a field in macro-generated docs, not knowing if a method might be defined as well. Obviously, there are definitely other uses. In the case where it's not disambiguated, methods (and I suppose other associated items in the value namespace) still take priority, which `@jyn514` said was an oversight but I think is probably the desired behavior 99% of the time anyway - shadowing a field with an accessor method is a very common pattern. If fields and methods with the same name started conflicting, it would be a breaking change. Though, to quote them: > jyn: maybe you can break this only if both [the method and the field] are public > jyn: rustc has some future-incompat warning level > jyn: that gets through -A warnings and --cap-lints from cargo That'd be out of scope of this PR, though. Fixes #80283
2024-09-30rustdoc: rewrite stability inheritance as a passLukas Markeffsky-0/+2
2024-09-29Rename doctest attribute `standalone-crate` into `standalone_crate` for ↵Guillaume Gomez-7/+7
coherency
2024-09-28Improve mistyped docblock attribute warning messagesGuillaume Gomez-58/+58
2024-09-28Add regression tests for mistyped `standalone-crate` attributeGuillaume Gomez-0/+64
2024-09-25Compiler: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-2/+2
2024-09-23Update rustdoc doctest non_local_defs impl testUrgau-11/+13
2024-09-23Revert "Switch back `non_local_definitions` lint to allow-by-default"Urgau-9/+3
This reverts commit 0c0dfb88eeefbbaa4c10cfa4a7f0e16541e086eb.
2024-09-19Add `field@` and `variant@` doc-link disambiguatorsNoa-23/+62
2024-09-19rustdoc: use the correct span for doctestsMichael Howell-1/+39