Skip to content

Commit 763fbf8

Browse files
Rollup merge of #131697 - ShE3py:rt-arg-lifetimes, r=Amanieu
`rt::Argument`: elide lifetimes `@rustbot` label +C-cleanup
2 parents fe2cbbd + 1364631 commit 763fbf8

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

‎library/core/src/fmt/rt.rs‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ pub struct Argument<'a> {
9494
}
9595

9696
#[rustc_diagnostic_item = "ArgumentMethods"]
97-
impl<'a>Argument<'a>{
97+
implArgument<'_>{
9898
#[inline(always)]
99-
fnnew<'b,T>(x:&'bT,f:fn(&T,&mutFormatter<'_>) -> Result) -> Argument<'b>{
99+
fnnew<'a,T>(x:&'aT,f:fn(&T,&mutFormatter<'_>) -> Result) -> Argument<'a>{
100100
Argument{
101-
// INVARIANT: this creates an `ArgumentType<'b>` from a `&'b T` and
101+
// INVARIANT: this creates an `ArgumentType<'a>` from a `&'a T` and
102102
// a `fn(&T, ...)`, so the invariant is maintained.
103103
ty:ArgumentType::Placeholder{
104104
value:NonNull::from(x).cast(),
@@ -110,43 +110,43 @@ impl<'a> Argument<'a> {
110110
}
111111

112112
#[inline(always)]
113-
pubfnnew_display<'b,T:Display>(x:&'bT) -> Argument<'b>{
113+
pubfnnew_display<T:Display>(x:&T) -> Argument<'_>{
114114
Self::new(x,Display::fmt)
115115
}
116116
#[inline(always)]
117-
pubfnnew_debug<'b,T:Debug>(x:&'bT) -> Argument<'b>{
117+
pubfnnew_debug<T:Debug>(x:&T) -> Argument<'_>{
118118
Self::new(x,Debug::fmt)
119119
}
120120
#[inline(always)]
121-
pubfnnew_debug_noop<'b,T:Debug>(x:&'bT) -> Argument<'b>{
121+
pubfnnew_debug_noop<T:Debug>(x:&T) -> Argument<'_>{
122122
Self::new(x, |_, _| Ok(()))
123123
}
124124
#[inline(always)]
125-
pubfnnew_octal<'b,T:Octal>(x:&'bT) -> Argument<'b>{
125+
pubfnnew_octal<T:Octal>(x:&T) -> Argument<'_>{
126126
Self::new(x,Octal::fmt)
127127
}
128128
#[inline(always)]
129-
pubfnnew_lower_hex<'b,T:LowerHex>(x:&'bT) -> Argument<'b>{
129+
pubfnnew_lower_hex<T:LowerHex>(x:&T) -> Argument<'_>{
130130
Self::new(x,LowerHex::fmt)
131131
}
132132
#[inline(always)]
133-
pubfnnew_upper_hex<'b,T:UpperHex>(x:&'bT) -> Argument<'b>{
133+
pubfnnew_upper_hex<T:UpperHex>(x:&T) -> Argument<'_>{
134134
Self::new(x,UpperHex::fmt)
135135
}
136136
#[inline(always)]
137-
pubfnnew_pointer<'b,T:Pointer>(x:&'bT) -> Argument<'b>{
137+
pubfnnew_pointer<T:Pointer>(x:&T) -> Argument<'_>{
138138
Self::new(x,Pointer::fmt)
139139
}
140140
#[inline(always)]
141-
pubfnnew_binary<'b,T:Binary>(x:&'bT) -> Argument<'b>{
141+
pubfnnew_binary<T:Binary>(x:&T) -> Argument<'_>{
142142
Self::new(x,Binary::fmt)
143143
}
144144
#[inline(always)]
145-
pubfnnew_lower_exp<'b,T:LowerExp>(x:&'bT) -> Argument<'b>{
145+
pubfnnew_lower_exp<T:LowerExp>(x:&T) -> Argument<'_>{
146146
Self::new(x,LowerExp::fmt)
147147
}
148148
#[inline(always)]
149-
pubfnnew_upper_exp<'b,T:UpperExp>(x:&'bT) -> Argument<'b>{
149+
pubfnnew_upper_exp<T:UpperExp>(x:&T) -> Argument<'_>{
150150
Self::new(x,UpperExp::fmt)
151151
}
152152
#[inline(always)]

‎tests/ui/closures/issue-111932.stderr‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LL | println!("{:?}", foo);
1717
| required by a bound introduced by this call
1818
|
1919
= help: the trait `Sized` is not implemented for `dyn Foo`
20-
note: required by an implicit `Sized` bound in `core::fmt::rt::Argument::<'a>::new_debug`
20+
note: required by an implicit `Sized` bound in `core::fmt::rt::Argument::<'_>::new_debug`
2121
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
2222
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
2323

‎tests/ui/const-generics/infer/issue-77092.stderr‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ LL | println!("{:?}", take_array_from_mut(&mut arr, i));
2525
= note: required for `[i32; _]` to implement `Debug`
2626
= note: 1 redundant requirement hidden
2727
= note: required for `&mut [i32; _]` to implement `Debug`
28-
note: required by a bound in `core::fmt::rt::Argument::<'a>::new_debug`
28+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_debug`
2929
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
3030
help: consider specifying the generic arguments
3131
|

‎tests/ui/fmt/ifmt-unimpl.stderr‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LL | format!("{:X}", "3");
1717
i32
1818
and 9 others
1919
= note: required for `&str` to implement `UpperHex`
20-
note: required by a bound in `core::fmt::rt::Argument::<'a>::new_upper_hex`
20+
note: required by a bound in `core::fmt::rt::Argument::<'_>::new_upper_hex`
2121
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
2222
= note: this error originates in the macro `$crate::__export::format_args` which comes from the expansion of the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
2323

0 commit comments

Comments
 (0)