Rollup merge of #138109 - Kohei316:feat/rust-doc-precise-capturing-arg, r=aDotInTheVoid,compiler-errors
make precise capturing args in rustdoc Json typed close #137616 This PR includes below changes. - Add `rustc_hir::PreciseCapturingArgKind` which allows the query system to return a arg's data. - Add `rustdoc::clean::types::PreciseCapturingArg` and change to use it. - Add `rustdoc-json-types::PreciseCapturingArg` and change to use it. - Update `tests/rustdoc-json/impl-trait-precise-capturing.rs`. - Bump `rustdoc_json_types::FORMAT_VERSION`.
This commit is contained in:
@@ -3373,13 +3373,16 @@ pub struct OpaqueTy<'hir> {
|
||||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, HashStable_Generic)]
|
||||
pub enum PreciseCapturingArg<'hir> {
|
||||
Lifetime(&'hir Lifetime),
|
||||
#[derive(Debug, Clone, Copy, HashStable_Generic, Encodable, Decodable)]
|
||||
pub enum PreciseCapturingArgKind<T, U> {
|
||||
Lifetime(T),
|
||||
/// Non-lifetime argument (type or const)
|
||||
Param(PreciseCapturingNonLifetimeArg),
|
||||
Param(U),
|
||||
}
|
||||
|
||||
pub type PreciseCapturingArg<'hir> =
|
||||
PreciseCapturingArgKind<&'hir Lifetime, PreciseCapturingNonLifetimeArg>;
|
||||
|
||||
impl PreciseCapturingArg<'_> {
|
||||
pub fn hir_id(self) -> HirId {
|
||||
match self {
|
||||
|
||||
Reference in New Issue
Block a user