| Age | Commit message (Collapse) | Author | Lines |
|
This currently calls `std` a "crate" in one part of the message and a
"module" in another part. The next commits fix this so it says "crate"
in both places.
|
|
r=Manishearth
Rustdoc: resolve associated traits for non-generic primitive types
Fixes #90703
This seems to work:
<img width="457" alt="image" src="https://user-images.githubusercontent.com/2807772/147774059-9556ff96-4519-409e-8ed0-c33ecc436171.png">
I'm just afraid I might have missed some cases / broken previous functionality.
I also have not written tests yet, I will have to take a look to see where tests are and how they are structured, but any help there is also appreciated.
|
|
Fix rustdoc::private_doc_tests lint for public re-exported items
Closes #72081
This involves changing the lint to check the access level is exported, rather than public.
The [exported access level](https://github.com/rust-lang/rust/blob/e91ad5fc62bdee4a29c18baa5fad2ca42fc91bf4/compiler/rustc_middle/src/middle/privacy.rs#L24) accounts for public items and items accessible to other crates with the help of `pub use` re-exports.
The pattern of re-exporting public items from a private module is usage seen in a number of popular crates.
|
|
Fixes #90703
|
|
This issue was fixed using a hacky recursion "fuel" argument, but the
issue was never minimized nor was a regression test added. The
underlying bug is still unfixed, so this test should help with fixing it
and removing the `recurse` hack.
|
|
- Ensure standard public items are accepted
- Ensure public items not re-exported from private modules are denied
|
|
This involves changing the lint to check the access level is exported,
rather than public. The exported access level accounts for public items
and items accessible to other crates with the help of `pub use`
re-exports. The pattern of re-exporting public items from a private
module is usage seen in a number of popular crates.
|
|
rustdoc: make `--passes` and `--no-defaults` have no effect
Fixes #91714
One potential issue is that currently there is no stable way to achieve `--document-hidden-items`. This affects test `issue-15347`.
I also had to modify the tests `issue-42875` and `no-compiler-export`. Regardless of combinations of `--document-hidden-items` and `--document-private-items`, I was unable to get these to pass without the modifications. I left behind a comment noting the change.
|
|
Lint bare traits in AstConv.
Removing the lint from lowering allows to:
- make lowering querification easier;
- have the lint implementation in only one place.
r? `@estebank`
|
|
- flags no longer function, see #44136
- adjust tests to match new behavior
- removed test issue-42875 (covered regression with --no-defaults)
- moved input-format to removed flags
- move all removed flags to bottom
- note flag removal in command help
- remove DefaultPassOption enum (now redundant with `show_coverage`)
|
|
Add deprecation warning for --passes
Issue https://github.com/rust-lang/rust/issues/91713 mentored by ```@jyn514```
|
|
Add --out-dir flag for rustdoc
part of https://github.com/rust-lang/rust/issues/91260
Add --out-dir flag for rustdoc and change the `-o` option to point to out-dir.
I'm not quite sure if it should be stable, also I'm not sure if this parameter priority is appropriate? Or should I just refuse to pass both parameters at the same time?
r? `@jyn514`
|
|
Co-authored-by: Joshua Nelson <github@jyn.dev>
|
|
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #88502 (Add slice take methods)
- #91313 (expand: Turn `ast::Crate` into a first class expansion target)
- #91424 (Update LLVM with patches for better llvm-cov diagnostics)
- #91425 (Include lint errors in error count for `-Ztreat-err-as-bug`)
- #91430 (Add tests for `normalize-docs` overflow errors)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
This unfortunately is still giving an unsilenceable overflow error :(
|
|
Deny warnings in rustdoc non-UI tests
These warnings were silently ignored since they did not appear in a
`.stderr` file and did not fail the test. With this change, warnings in
tests are denied, causing the tests to fail if they have warnings.
This change has already led me to find a bug in rustdoc (#91274) and a
useless test (`src/test/rustdoc/primitive/primitive-generic-impl.rs`,
though its uselessness is unrelated to its warnings).
r? `@jyn514`
|
|
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
|
|
Now that compiletest denies warnings in these tests, they need fixing!
|
|
Change output path to {{build-base}} for rustdoc scrape_examples ui test
See https://github.com/rust-lang/rust/pull/90611#issuecomment-981092909
r? `@jyn514`
cc `@petrochenkov`
|
|
|
|
Remove `--display-doctest-warnings`
`--display-doctest-warnings` can be replicated in full with other existing features, there's no
need to have a separate option for it. This removes the option and documents the combination of other features to replicate it.
This also fixes a bug where `--test-args=--show-output` had no effect.
cc `@ollie27,` https://github.com/rust-lang/rust/pull/73314#issuecomment-668317262
Fixes https://github.com/rust-lang/rust/issues/41574
r? `@GuillaumeGomez`
|
|
This can be replicated in full with other existing features, there's no
need to have a separate option for it.
This also fixes a bug where `--test-args=--show-output` had no effect,
and updates the documentation.
|
|
|
|
|
|
Create rustdoc_internals feature gate
As suggested by ``@camelid`` [here](https://github.com/rust-lang/rust/pull/90398#issuecomment-955093851), since `doc_keyword` and `doc_primitive` aren't meant to be stabilized, we could put them behind a same feature flag.
This is pretty much what it would look like (needs to update the tests too).
The tracking issue is https://github.com/rust-lang/rust/issues/90418.
What do you think ``@rust-lang/rustdoc`` ?
|
|
|
|
|
|
This partially reverts #91026, because rustdoc needs to detect the extern statements,
even when they appear inside implicit `main()`. It does not entirely revert it,
so the old bug is still fixed, by duplicating some of the logic from `parse_mod`
instead of trying to use it directly.
Fixes #91134
|
|
The basic problem with this is that rustdoc, when hunting for `fn main`, will stop
parsing after it reaches a fatal error. This unexpected semicolon was a fatal error,
so in `src/test/rustdoc-ui/failed-doctest-extra-semicolon-on-item.rs`, it would wrap
the doctest in an implied main function, turning it into this:
fn main() {
struct S {};
fn main() {
assert_eq!(0, 1);
}
}
This, as it turns out, is totally valid, and it executes no assertions, so *it passes,*
even though the user wanted it to execute the assertion.
The Rust parser already has the ability to recover from these unexpected semicolons,
but to do so, it needs to use the `parse_mod` function, so this commit changes it to do that.
|
|
This helps with (but does not fix)
https://github.com/rust-lang/rust/issues/84738. I tested on
https://github.com/jyn514/objr/commit/edcee7b8124abf0e4c63873e8422ff81beb11ebb
and still hit ICEs.
|
|
Show all Deref implementations recursively
Fixes #87783.
This is a re-implementation of #80653, so taking the original PR comment:
This changes `rustdoc` to recursively follow `Deref` targets so that methods from all levels are added to the rendered output. This implementation displays the methods from all levels in the expanded state with separate sections for each level.

cc `@camelid`
r? `@jyn514`
|
|
|
|
|
|
Scrape code examples from examples/ directory for Rustdoc
Adds support for the functionality described in https://github.com/rust-lang/rfcs/pull/3123
Matching changes to Cargo are here: https://github.com/rust-lang/cargo/pull/9525
Live demo here: https://willcrichton.net/example-analyzer/warp/trait.Filter.html#method.and
|
|
scrape-examples options
|
|
foreign trait implementations
|
|
Remove FIXME since there is nothing to be fixed
Resolves #88593.
The errors are deduplicated when displayed to users. They only appear
multiple times in UI tests.
cc ``@jyn514``
r? ``@camelid``
|
|
The errors are deduplicated when displayed to users. They only appear
multiple times in UI tests.
|
|
|
|
Move test to rustdoc-ui
Fix test writing to wrong directory
Formatting
Fix test
Add FIXME
Remove raw multiline strings
|
|
are not useful
|
|
|
|
Previously it would unconditionally use edition 2015, which was
incorrect.
|
|
Fixes #81775
|
|
Rename "--display-warnings" to "--display-doctest-warnings"
Fixes #41574.
cc `@ollie27`
r? `@kinnison`
|
|
|
|
Use smaller spans for some structured suggestions
Use more accurate suggestion spans for
* argument parse error
* fully qualified path
* missing code block type
* numeric casts
|
|
Allow missing code examples in trait impls.
Excludes Trait implementations from the items that need to have doc code examples when using the `rustdoc::missing_doc_code_examples` lint.
For details see #88741
fixes #88741
r? `@jyn514`
|