@@ -15,12 +15,12 @@ pub trait Constant: Sized {
1515 type Name : AsRef < str > ;
1616
1717 /// Transforms the given Constant to a BorrowedConstant
18- fn borrow_constant ( & self ) -> BorrowedConstant < Self > ;
18+ fn borrow_constant ( & self ) -> BorrowedConstant < ' _ , Self > ;
1919}
2020
2121impl Constant for ConstantData {
2222 type Name = String ;
23- fn borrow_constant ( & self ) -> BorrowedConstant < Self > {
23+ fn borrow_constant ( & self ) -> BorrowedConstant < ' _ , Self > {
2424 use BorrowedConstant :: * ;
2525 match self {
2626 ConstantData :: Integer { value } => Integer { value } ,
@@ -40,7 +40,7 @@ impl Constant for ConstantData {
4040/// A Constant Bag
4141pub trait ConstantBag : Sized + Copy {
4242 type Constant : Constant ;
43- fn make_constant < C : Constant > ( & self , constant : BorrowedConstant < C > ) -> Self :: Constant ;
43+ fn make_constant < C : Constant > ( & self , constant : BorrowedConstant < ' _ , C > ) -> Self :: Constant ;
4444 fn make_int ( & self , value : BigInt ) -> Self :: Constant ;
4545 fn make_tuple ( & self , elements : impl Iterator < Item = Self :: Constant > ) -> Self :: Constant ;
4646 fn make_code ( & self , code : CodeObject < Self :: Constant > ) -> Self :: Constant ;
@@ -65,7 +65,7 @@ pub struct BasicBag;
6565
6666impl ConstantBag for BasicBag {
6767 type Constant = ConstantData ;
68- fn make_constant < C : Constant > ( & self , constant : BorrowedConstant < C > ) -> Self :: Constant {
68+ fn make_constant < C : Constant > ( & self , constant : BorrowedConstant < ' _ , C > ) -> Self :: Constant {
6969 constant. to_owned ( )
7070 }
7171 fn make_int ( & self , value : BigInt ) -> Self :: Constant {
@@ -306,7 +306,7 @@ impl<T: OpArgType> PartialEq for Arg<T> {
306306impl < T : OpArgType > Eq for Arg < T > { }
307307
308308impl < T : OpArgType > fmt:: Debug for Arg < T > {
309- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
309+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
310310 write ! ( f, "Arg<{}>" , std:: any:: type_name:: <T >( ) )
311311 }
312312}
@@ -329,7 +329,7 @@ impl OpArgType for Label {
329329}
330330
331331impl fmt:: Display for Label {
332- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
332+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
333333 self . 0 . fmt ( f)
334334 }
335335}
@@ -752,7 +752,7 @@ impl<C: Constant> Clone for BorrowedConstant<'_, C> {
752752}
753753
754754impl < C : Constant > BorrowedConstant < ' _ , C > {
755- pub fn fmt_display ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
755+ pub fn fmt_display ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
756756 match self {
757757 BorrowedConstant :: Integer { value } => write ! ( f, "{value}" ) ,
758758 BorrowedConstant :: Float { value } => write ! ( f, "{value}" ) ,
@@ -939,7 +939,7 @@ impl<N: AsRef<str>> fmt::Debug for Arguments<'_, N> {
939939impl < C : Constant > CodeObject < C > {
940940 /// Get all arguments of the code object
941941 /// like inspect.getargs
942- pub fn arg_names ( & self ) -> Arguments < C :: Name > {
942+ pub fn arg_names ( & self ) -> Arguments < ' _ , C :: Name > {
943943 let nargs = self . arg_count as usize ;
944944 let nkwargs = self . kwonlyarg_count as usize ;
945945 let mut varargs_pos = nargs + nkwargs;
@@ -984,7 +984,7 @@ impl<C: Constant> CodeObject<C> {
984984
985985 fn display_inner (
986986 & self ,
987- f : & mut fmt:: Formatter ,
987+ f : & mut fmt:: Formatter < ' _ > ,
988988 expand_code_objects : bool ,
989989 level : usize ,
990990 ) -> fmt:: Result {
@@ -1034,7 +1034,7 @@ impl<C: Constant> CodeObject<C> {
10341034 pub fn display_expand_code_objects ( & self ) -> impl fmt:: Display + ' _ {
10351035 struct Display < ' a , C : Constant > ( & ' a CodeObject < C > ) ;
10361036 impl < C : Constant > fmt:: Display for Display < ' _ , C > {
1037- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1037+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
10381038 self . 0 . display_inner ( f, true , 1 )
10391039 }
10401040 }
@@ -1107,7 +1107,7 @@ impl<C: Constant> CodeObject<C> {
11071107}
11081108
11091109impl < C : Constant > fmt:: Display for CodeObject < C > {
1110- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1110+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
11111111 self . display_inner ( f, false , 1 ) ?;
11121112 for constant in & * self . constants {
11131113 if let BorrowedConstant :: Code { code } = constant. borrow_constant ( ) {
@@ -1302,19 +1302,19 @@ impl Instruction {
13021302 ctx : & ' a impl InstrDisplayContext ,
13031303 ) -> impl fmt:: Display + ' a {
13041304 struct FmtFn < F > ( F ) ;
1305- impl < F : Fn ( & mut fmt:: Formatter ) -> fmt:: Result > fmt:: Display for FmtFn < F > {
1306- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1305+ impl < F : Fn ( & mut fmt:: Formatter < ' _ > ) -> fmt:: Result > fmt:: Display for FmtFn < F > {
1306+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
13071307 ( self . 0 ) ( f)
13081308 }
13091309 }
1310- FmtFn ( move |f : & mut fmt:: Formatter | self . fmt_dis ( arg, f, ctx, false , 0 , 0 ) )
1310+ FmtFn ( move |f : & mut fmt:: Formatter < ' _ > | self . fmt_dis ( arg, f, ctx, false , 0 , 0 ) )
13111311 }
13121312
13131313 #[ allow( clippy:: too_many_arguments) ]
13141314 fn fmt_dis (
13151315 & self ,
13161316 arg : OpArg ,
1317- f : & mut fmt:: Formatter ,
1317+ f : & mut fmt:: Formatter < ' _ > ,
13181318 ctx : & impl InstrDisplayContext ,
13191319 expand_code_objects : bool ,
13201320 pad : usize ,
@@ -1346,7 +1346,7 @@ impl Instruction {
13461346 let cell_name = |i : u32 | ctx. get_cell_name ( i as usize ) ;
13471347
13481348 let fmt_const =
1349- |op : & str , arg : OpArg , f : & mut fmt:: Formatter , idx : & Arg < u32 > | -> fmt:: Result {
1349+ |op : & str , arg : OpArg , f : & mut fmt:: Formatter < ' _ > , idx : & Arg < u32 > | -> fmt:: Result {
13501350 let value = ctx. get_constant ( idx. get ( arg) as usize ) ;
13511351 match value. borrow_constant ( ) {
13521352 BorrowedConstant :: Code { code } if expand_code_objects => {
@@ -1496,13 +1496,13 @@ impl<C: Constant> InstrDisplayContext for CodeObject<C> {
14961496}
14971497
14981498impl fmt:: Display for ConstantData {
1499- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1499+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
15001500 self . borrow_constant ( ) . fmt_display ( f)
15011501 }
15021502}
15031503
15041504impl < C : Constant > fmt:: Debug for CodeObject < C > {
1505- fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1505+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
15061506 write ! (
15071507 f,
15081508 "<code object {} at ??? file {:?}, line {}>" ,
0 commit comments