about summary refs log tree commit diff
path: root/tests/rustdoc-json
AgeCommit message (Collapse)AuthorLines
2025-01-22rustdoc-json: Rename `Path::name` to `path`, and give it path (again).Alona Enraght-Moony-15/+110
Closes https://github.com/rust-lang/rust/issues/135600 Effectivly reverts https://github.com/rust-lang/rust/pull/134880
2025-01-14Rollup merge of #134880 - as1100k-forks:fix-rustdoc-json-path-name, ↵Matthias Krüger-1/+1
r=aDotInTheVoid Made `Path::name` only have item name rather than full name Closes #134853 This PR makes `Path::name` to only have item name rather than full name, i.e. with the following code ```rust pub mod foo { pub struct Bar; } pub fn get_bar() -> foo::Bar { foo::Bar } ``` and running `./rustdoc ./demo.rs -wjson -Zunstable-options` gives: ```json { "41": { "id": 41, "name": "get_bar", "inner": { "function": { "sig": { "inputs": [], "output": { "resolved_path": { "name": "Bar", "id": 0, "args": { "angle_bracketed": { "args": [], "constraints": [] } } } } } } } } } ``` _Information which isn't useful here was trimmed_ r? aDotInTheVoid
2025-01-14Made `Path::name` only have item name rather than full nameAditya Kumar-1/+1
2025-01-10rustdoc-json: Include items in stripped modules in `Crate::paths`.Alona Enraght-Moony-0/+11
2024-12-17Remove `rustc::existing_doc_keyword` lint.Nicholas Nethercote-5/+5
`CheckAttrVisitor::check_doc_keyword` checks `#[doc(keyword = "..")]` attributes to ensure they are on an empty module, and that the value is a non-empty identifier. The `rustc::existing_doc_keyword` lint checks these attributes to ensure that the value is the name of a keyword. It's silly to have two different checking mechanisms for these attributes. This commit does the following. - Changes `check_doc_keyword` to check that the value is the name of a keyword (avoiding the need for the identifier check, which removes a dependency on `rustc_lexer`). - Removes the lint. - Updates tests accordingly. There is one hack: the `SelfTy` FIXME case used to used to be handled by disabling the lint, but now is handled with a special case in `is_doc_keyword`. That hack will go away if/when the FIXME is fixed. Co-Authored-By: Guillaume Gomez <guillaume1.gomez@gmail.com>
2024-12-02Rollup merge of #133721 - aDotInTheVoid:rdj-dyn-link, r=GuillaumeGomezGuillaume Gomez-0/+15
rustdoc-json: Add test for `impl Trait for dyn Trait` Found while investigating #133719 Helps with #81359 r? `@GuillaumeGomez`
2024-12-01rustdoc-json: Add test for `impl Trait for dyn Trait`Alona Enraght-Moony-0/+15
2024-12-01rustdoc-json: Include safety of `static`sAlona Enraght-Moony-0/+41
2024-12-01rustdoc-json: Add tests for `static`sAlona Enraght-Moony-0/+10
2024-10-22Rename Receiver -> LegacyReceiverAdrian Taylor-2/+2
As part of the "arbitrary self types v2" project, we are going to replace the current `Receiver` trait with a new mechanism based on a new, different `Receiver` trait. This PR renames the old trait to get it out the way. Naming is hard. Options considered included: * HardCodedReceiver (because it should only be used for things in the standard library, and hence is sort-of hard coded) * LegacyReceiver * TargetLessReceiver * OldReceiver These are all bad names, but fortunately this will be temporary. Assuming the new mechanism proceeds to stabilization as intended, the legacy trait will be removed altogether. Although we expect this trait to be used only in the standard library, we suspect it may be in use elsehwere, so we're landing this change separately to identify any surprising breakages. It's known that this trait is used within the Rust for Linux project; a patch is in progress to remove their dependency. This is a part of the arbitrary self types v2 project, https://github.com/rust-lang/rfcs/pull/3519 https://github.com/rust-lang/rust/issues/44874 r? @wesleywiser
2024-10-16rustdoc-JSON: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-19/+19
2024-10-11Remove unadornedMichael Goulet-1/+1
2024-10-10rustdoc-json: Add tests for unsafe/safe extern blocks (RFC 3484)Alona Enraght-Moony-0/+17
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-2/+5
2024-09-01rustdoc: normalise type/field names in rustdoc-json-types/jsondoclintschvv31n-245/+245
2024-08-31Rollup merge of #129123 - aDotInTheVoid:rustdoc-json-self, r=fmeaseMatthias Krüger-0/+58
rustdoc-json: Add test for `Self` type Inspired by #128471, the rustdoc-json suite had no tests in place for the `Self` type. This PR adds one. I've also manually checked locally that this test passes on 29e924841f06bb181d87494eba2783761bc1ddec, confirming that adding `clean::Type::SelfTy` didn't change the JSON output. (potentially adding a self type to json (insead of (ab)using generic) is tracked in #128522) Updates #81359 r? ````````@fmease````````
2024-08-17Stabilize opaque type precise capturingMichael Goulet-2/+0
2024-08-15rustdoc-json: Add test for `Self` typeAlona Enraght-Moony-0/+58
2024-08-09Rollup merge of #128836 - its-the-shrimp:add_test_for_107278, r=aDotInTheVoidMatthias Krüger-0/+10
rustdoc-json: add a test for impls on private & hidden types Fixes #107278 (or rather just ensures it won't resurface) r? ``@aDotInTheVoid``
2024-08-08rustdoc-json: added a test for #107278schvv31n-0/+10
2024-08-08rustdoc: fixed #101105schvv31n-0/+6
modules are now stripped based on the same logic that's used to strip other item kinds
2024-08-05Rollup merge of #128385 - its-the-shrimp:fix_114039, r=aDotInTheVoidMatthias Krüger-0/+5
rustdoc-json: discard non-local inherent impls for primitives Fixes #114039 at least it should r? `@aDotInTheVoid`
2024-08-05rustdoc-json: discard non-local inherent implsschvv31n-0/+5
2024-08-01rustdoc: Add test for `impl_trait_in_accos_type`Alona Enraght-Moony-0/+29
2024-07-29Reformat `use` declarations.Nicholas Nethercote-1/+0
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-19Update all rustdoc-json/ tests to use the new styleLeón Orell Valerian Liehr-1043/+1043
2024-07-12Add rustdoc-json support for use<>Michael Goulet-0/+6
2024-07-07rustdoc-json: add trait/type alias testsschvv31n-0/+33
2024-07-03rustdoc-json: Better representation of lifetime bounds in where clauses.Alona Enraght-Moony-0/+32
As suggested [on zulip][1], there's no need to use `GenericBound` here, as the only bound a lifetime can have is that it outlives other lifetimes. While we're making breaking changes here, I also renamed it from using "region" to "lifetime", as this is more user-aligned. See [this comment][2] for details. [1]: https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/.60ItemEnum.3A.3AOpaqueTy.60/near/448871430 [2]: https://github.com/rust-lang/rust/issues/100961#issuecomment-2206565556
2024-06-04rustfmt `tests/rustdoc-json/`.Nicholas Nethercote-12/+18
2024-05-24rustdoc-json: Add test for keywords with `--document-private-items`Alona Enraght-Moony-0/+20
2024-02-22[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives许杰友 Jieyou Xu (Joe)-28/+28
2023-12-23Add regression test for `is_object_safe` field on traitsGuillaume Gomez-0/+19
2023-11-09rustdoc-json: Fix test so it actuall checks thingsAlona Enraght-Moony-2/+3
After #111427, no item has a `kind` field, so these assertions could never fail. Instead, assert that those two items arn't present.
2023-11-08Rollup merge of #117713 - GuillaumeGomez:document-hidden-json, r=notriddleGuillaume Gomez-0/+10
Add test for reexported hidden item with `--document-hidden-items` Coming from [this discussion on zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/Using.20cargo-semver-checks.20in.20rustdoc.20JSON.20tests.3A.20revisited). cc ``@aDotInTheVoid`` r? ``@notriddle``
2023-11-08Add test for reexported hidden item with `--document-hidden-items`Guillaume Gomez-0/+10
2023-11-07tests/rustdoc-json: Rewrite tests no not use `#![no_core]`.Alona Enraght-Moony-37/+31
2023-11-07tests/rustdoc-json: Remove more needless uses of `#![no_core]`.Alona Enraght-Moony-39/+1
These were'nt done with regex, but don't require changes to assertions.
2023-11-07tests/rustdoc-json: Remove some needless uses of `#![no_core]`.Alona Enraght-Moony-126/+9
Done by removing all uses of `#![no_core]`, and the reverting the ones that failed. More involved ones are in a later commit.
2023-10-31Accept less invalid Rust in rustdocOli Scherer-8/+23
2023-08-23Fix rustdoc-json testsNoah Lev-97/+97
2023-08-09rustdoc-json: Add tests for field/variant ordering.Alona Enraght-Moony-0/+154
2023-08-03Handle inherent associated types falloutLeón Orell Valerian Liehr-13/+16
2023-07-18Auto merge of #113574 - GuillaumeGomez:rustdoc-json-strip-hidden-impl, ↵bors-0/+50
r=aDotInTheVoid,notriddle Strip impl if not re-exported and is doc(hidden) Part of #112852. r? `@aDotInTheVoid`
2023-07-17Improve issue-112852 testsGuillaume Gomez-2/+12
2023-07-14Add more tests for not-reexported implGuillaume Gomez-0/+26
2023-07-14Add regression test for #112852Guillaume Gomez-0/+14
2023-07-14rustdoc-json: Add test for private supertrait.Alona Enraght-Moony-0/+15
2023-05-22Serialize all enums as externally tagged to guarantee compatibility with ↵Luca Palmieri-711/+701
binary formats such as bincode or postcard
2023-05-15rustdoc-json: Add tests for visibility of implsAlona Enraght-Moony-0/+81