| Age | Commit message (Collapse) | Author | Lines |
|
Closes https://github.com/rust-lang/rust/issues/135600
Effectivly reverts https://github.com/rust-lang/rust/pull/134880
|
|
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
|
|
|
|
|
|
`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>
|
|
rustdoc-json: Add test for `impl Trait for dyn Trait`
Found while investigating #133719
Helps with #81359
r? `@GuillaumeGomez`
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
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````````
|
|
|
|
|
|
rustdoc-json: add a test for impls on private & hidden types
Fixes #107278 (or rather just ensures it won't resurface)
r? ``@aDotInTheVoid``
|
|
|
|
modules are now stripped based on the same logic that's used to strip other item kinds
|
|
rustdoc-json: discard non-local inherent impls for primitives
Fixes #114039
at least it should
r? `@aDotInTheVoid`
|
|
|
|
|
|
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
After #111427, no item has a `kind` field, so these assertions could never
fail. Instead, assert that those two items arn't present.
|
|
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``
|
|
|
|
|
|
These were'nt done with regex, but don't require changes to assertions.
|
|
Done by removing all uses of `#![no_core]`, and the reverting the ones
that failed. More involved ones are in a later commit.
|
|
|
|
|
|
|
|
|
|
r=aDotInTheVoid,notriddle
Strip impl if not re-exported and is doc(hidden)
Part of #112852.
r? `@aDotInTheVoid`
|
|
|
|
|
|
|
|
|
|
binary formats such as bincode or postcard
|
|
|