@@ -29,7 +29,7 @@ use serde::{Deserialize, Serialize};
2929/// This integer is incremented with every breaking change to the API,
3030/// and is returned along with the JSON blob as [`Crate::format_version`].
3131/// Consuming code should assert that this value matches the format version(s) that it supports.
32- pub const FORMAT_VERSION : u32 = 40 ;
32+ pub const FORMAT_VERSION : u32 = 41 ;
3333
3434/// The root of the emitted JSON blob.
3535///
@@ -908,7 +908,7 @@ pub enum GenericBound {
908908 /// ```
909909 Outlives ( String ) ,
910910 /// `use<'a, T>` precise-capturing bound syntax
911- Use ( Vec < String > ) ,
911+ Use ( Vec < PreciseCapturingArg > ) ,
912912}
913913
914914/// A set of modifiers applied to a trait.
@@ -926,6 +926,22 @@ pub enum TraitBoundModifier {
926926 MaybeConst ,
927927}
928928
929+ /// One precise capturing argument. See [the rust reference](https://doc.rust-lang.org/reference/types/impl-trait.html#precise-capturing).
930+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
931+ #[ serde( rename_all = "snake_case" ) ]
932+ pub enum PreciseCapturingArg {
933+ /// A lifetime.
934+ /// ```rust
935+ /// pub fn hello<'a, T, const N: usize>() -> impl Sized + use<'a, T, N> {}
936+ /// // ^^
937+ Lifetime ( String ) ,
938+ /// A type or constant parameter.
939+ /// ```rust
940+ /// pub fn hello<'a, T, const N: usize>() -> impl Sized + use<'a, T, N> {}
941+ /// // ^ ^
942+ Param ( String ) ,
943+ }
944+
929945/// Either a type or a constant, usually stored as the right-hand side of an equation in places like
930946/// [`AssocItemConstraint`]
931947#[ derive( Clone , Debug , PartialEq , Eq , Hash , Serialize , Deserialize ) ]
0 commit comments