diff options
| author | morine0122 <k0000.m000.job@gmail.com> | 2025-03-02 18:06:06 +0900 |
|---|---|---|
| committer | morine0122 <k0000.m000.job@gmail.com> | 2025-03-10 21:40:09 +0900 |
| commit | 112f7b01a1b25035cd8b288d6936c6be48a3d845 (patch) | |
| tree | f4a728856fabc5589315bdfe140cd7ce128f9468 /src/rustdoc-json-types | |
| parent | cdd8af229960d05c8dfe5ca3e5f5e2066e676213 (diff) | |
make precise capturing args in rustdoc Json typed
Diffstat (limited to 'src/rustdoc-json-types')
| -rw-r--r-- | src/rustdoc-json-types/lib.rs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/rustdoc-json-types/lib.rs b/src/rustdoc-json-types/lib.rs index 8f6496e9626..8ec7cffe066 100644 --- a/src/rustdoc-json-types/lib.rs +++ b/src/rustdoc-json-types/lib.rs @@ -30,7 +30,7 @@ pub type FxHashMap<K, V> = HashMap<K, V>; // re-export for use in src/librustdoc /// This integer is incremented with every breaking change to the API, /// and is returned along with the JSON blob as [`Crate::format_version`]. /// Consuming code should assert that this value matches the format version(s) that it supports. -pub const FORMAT_VERSION: u32 = 40; +pub const FORMAT_VERSION: u32 = 41; /// The root of the emitted JSON blob. /// @@ -909,7 +909,7 @@ pub enum GenericBound { /// ``` Outlives(String), /// `use<'a, T>` precise-capturing bound syntax - Use(Vec<String>), + Use(Vec<PreciseCapturingArg>), } /// A set of modifiers applied to a trait. @@ -927,6 +927,22 @@ pub enum TraitBoundModifier { MaybeConst, } +/// One precise capturing argument. See [the rust reference](https://doc.rust-lang.org/reference/types/impl-trait.html#precise-capturing). +#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +pub enum PreciseCapturingArg { + /// A lifetime. + /// ```rust + /// pub fn hello<'a, T, const N: usize>() -> impl Sized + use<'a, T, N> {} + /// // ^^ + Lifetime(String), + /// A type or constant parameter. + /// ```rust + /// pub fn hello<'a, T, const N: usize>() -> impl Sized + use<'a, T, N> {} + /// // ^ ^ + Param(String), +} + /// Either a type or a constant, usually stored as the right-hand side of an equation in places like /// [`AssocItemConstraint`] #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] |
