| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
Handle projection predicates in the param env for auto-trait docs
Fixes #72213
Any predicates in the param env are guaranteed to hold, so we don't need
to do any additional processing of them if we come across them as
sub-obligations of a different predicate. This allows us to avoid adding
the same predicate to the computed ParamEnv multiple times (but with
different regions each time), which causes an ambiguity error during
fulfillment.
|
|
Don't print "const" keyword on non-nightly build if rustc_const_unstable is used on the item
Fixes #74579.
|
|
|
|
This has less surprising behavior when there is a module with the same
name as a primitive in scope.
|
|
|
|
|
|
Display elided lifetime for non-reference type in doc
In edition 2018 we encourage writing `<'_>` explicitly, so rustdoc should display like such as well.
Fixes #75225
~~Somehow when I run the compiled rustdoc using `cargo +stage2 doc` on other crates, it correctly produces `<'_>`, but I couldn't get the std doc to do the same with `./x.py doc --stage 2`. Might this be related to the recent change to x.py about how the doc is built?~~
|
|
|
|
|
|
|
|
|
|
|
|
Fixes #72213
Any predicates in the param env are guaranteed to hold, so we don't need
to do any additional processing of them if we come across them as
sub-obligations of a different predicate. This allows us to avoid adding
the same predicate to the computed ParamEnv multiple times (but with
different regions each time), which causes an ambiguity error during
fulfillment.
|
|
This caused the following false positive:
```
warning: unresolved link to `Default::default`
--> /home/joshua/rustc2/default.rs:1:14
|
1 | /// Link to [Default::default()]
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(broken_intra_doc_links)]` on by default
note: this item resolved to a trait, which did not match the disambiguator 'fn'
--> /home/joshua/rustc2/default.rs:1:14
|
1 | /// Link to [Default::default()]
| ^^^^^^^^^^^^^^^^^^
```
|
|
fix rustdoc generic param order
fixes #61292
r? @varkor cc @GuillaumeGomez
|
|
|
|
|
|
|
|
|
|
|
|
Previously unstable impls were skipped, which meant that any impl with an
unstable method would get skipped.
|
|
|
|
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
|
|
|
|
r=Mark-Simulacrum
Do not render unstable items for rustc doc
See the zulip conversion: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rustc.20doc.3A.20.22internal.20compiler.20API.22.20warns.20are.20everywhere!/near/203850782
Before:

After:

Nothing changes in unstable items of std:
Before:

After:

Closes #54682
|
|
intra_doc_resolution_failure is not a lint.
|
|
|
|
Trait implementations are treated the same as modules for the purposes
of intra-doc links.
|
|
This includes both `macro_rules!` and proc-macros.
|
|
This fixes a failure in stage2 rustdoc tests.
|
|
|
|
|
|
|
|
I had a hard time getting this to work without the `extern crate`,
suggestions are welcome.
|
|
|
|
Reintroduce spotlight / "important traits" feature
(Reopened version of https://github.com/rust-lang/rust/pull/74111 because Github is broken, see discussion there)
Fixes https://github.com/rust-lang/rust/issues/73785
This PR reintroduces the "spotlight" ("important traits") feature.
A couple changes have been made:
As there were concerns about its visibility, it has been moved to be next to the return type, as opposed to being on the side.
It also no longer produces a modal, it shows the traits on hover, and it can be clicked on to pin the hover bubble.


It also works fine on mobile:

|
|
This reverts commit 1244ced9580b942926afc06815e0691cf3f4a846.
|
|
|
|
Instead, report the error.
This emits the errors on-demand, without special-casing `impl Trait`, so
it should catch all ICEs of this kind, including ones that haven't been
found yet.
Since the error is emitted during type-checking there is less info about
the error; see comments in the code for details.
- Add test case for -> impl Trait
- Add test for impl trait with alias
- Move EmitIgnoredResolutionErrors to rustdoc
This makes `fn typeck_item_bodies` public, which is not desired behavior.
That change should be removed once
https://github.com/rust-lang/rust/pull/74070 is merged.
- Don't visit nested closures twice
|
|
|
|
- Remove unnecessary `should_loop` variable
- Report errors for trait implementations
These should give resolution errors because they are visible outside the
current scope. Without these errors, rustdoc will give ICEs:
```
thread 'rustc' panicked at 'attempted .def_id() on invalid res: Err', /home/joshua/src/rust/src/libstd/macros.rs:16:9
15: rustc_hir::def::Res<Id>::def_id
at /home/joshua/src/rust/src/librustc_hir/def.rs:382
16: rustdoc::clean::utils::register_res
at src/librustdoc/clean/utils.rs:627
17: rustdoc::clean::utils::resolve_type
at src/librustdoc/clean/utils.rs:587
```
- Add much more extensive tests
+ fn -> impl -> fn
+ fn -> impl -> fn -> macro
+ errors in function parameters
+ errors in trait bounds
+ errors in the type implementing the trait
+ unknown bounds for the type
+ unknown types in function bodies
+ errors generated by macros
- Use explicit state instead of trying to reconstruct it from random info
- Use an enum instead of a boolean
- Add example of ignored error
|
|
Instead, ignore resolution errors that occur in item bodies.
The reason this can't ignore item bodies altogether is because
`const fn` could be used in generic types, for example `[T; f()]`
|
|
As rustc is permanently unstable. So marking every items
with unstable is essential useless.
|
|
|
|
Hide `&mut self` methods from Deref in sidebar if there are no `DerefMut` impl for the type.
This partially addresses #74083.
|
|
Use relative path for local links to primitives
Else, links to `char::foo` would point into `/path/to/src/libcore/std/primitive.char.html#method.foo`.
Split out from #73804.
|
|
|