Add rustdoc-json support for use<>
This commit is contained in:
parent
843f5dd93b
commit
bd135e487f
@ -22,6 +22,8 @@ ignore = [
|
||||
"/tests/rustdoc-ui/", # Some have syntax errors, some are whitespace-sensitive.
|
||||
"/tests/ui/", # Some have syntax errors, some are whitespace-sensitive.
|
||||
"/tests/ui-fulldeps/", # Some are whitespace-sensitive (e.g. `// ~ERROR` comments).
|
||||
# #[cfg(bootstrap)] so that t-release sees this when they search for it
|
||||
"/tests/rustdoc-json/impl-trait-precise-capturing.rs",
|
||||
|
||||
# Do not format submodules.
|
||||
# FIXME: sync submodule list with tidy/bootstrap/etc
|
||||
|
@ -542,6 +542,7 @@ fn from_tcx(bound: clean::GenericBound, tcx: TyCtxt<'_>) -> Self {
|
||||
}
|
||||
}
|
||||
Outlives(lifetime) => GenericBound::Outlives(convert_lifetime(lifetime)),
|
||||
Use(args) => GenericBound::Use(args.into_iter().map(|arg| arg.to_string()).collect()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// rustdoc format-version.
|
||||
pub const FORMAT_VERSION: u32 = 31;
|
||||
pub const FORMAT_VERSION: u32 = 32;
|
||||
|
||||
/// A `Crate` is the root of the emitted JSON blob. It contains all type/documentation information
|
||||
/// about the language items in the local crate, as well as info about external items to allow
|
||||
@ -538,6 +538,8 @@ pub enum GenericBound {
|
||||
modifier: TraitBoundModifier,
|
||||
},
|
||||
Outlives(String),
|
||||
/// `use<'a, T>` precise-capturing bound syntax
|
||||
Use(Vec<String>),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
|
@ -298,6 +298,7 @@ fn check_generic_bound(&mut self, x: &'a GenericBound) {
|
||||
generic_params.iter().for_each(|gpd| self.check_generic_param_def(gpd));
|
||||
}
|
||||
GenericBound::Outlives(_) => {}
|
||||
GenericBound::Use(_) => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
6
tests/rustdoc-json/impl-trait-precise-capturing.rs
Normal file
6
tests/rustdoc-json/impl-trait-precise-capturing.rs
Normal file
@ -0,0 +1,6 @@
|
||||
#![feature(precise_capturing)]
|
||||
|
||||
// @is "$.index[*][?(@.name=='hello')].inner.function.decl.output.impl_trait[1].use[0]" \"\'a\"
|
||||
// @is "$.index[*][?(@.name=='hello')].inner.function.decl.output.impl_trait[1].use[1]" \"T\"
|
||||
// @is "$.index[*][?(@.name=='hello')].inner.function.decl.output.impl_trait[1].use[2]" \"N\"
|
||||
pub fn hello<'a, T, const N: usize>() -> impl Sized + use<'a, T, N> {}
|
Loading…
Reference in New Issue
Block a user