@@ -267,7 +267,7 @@ extern "C" {
267267#[ allow( missing_debug_implementations) ]
268268#[ unstable( feature = "fmt_internals" , reason = "internal to format_args!" , issue = "none" ) ]
269269#[ doc( hidden) ]
270- pub struct ArgumentV1 < ' a > {
270+ pub struct Argument < ' a > {
271271 value : & ' a Opaque ,
272272 formatter : fn ( & Opaque , & mut Formatter < ' _ > ) -> Result ,
273273}
@@ -321,18 +321,18 @@ macro_rules! arg_new {
321321 #[ doc( hidden) ]
322322 #[ unstable( feature = "fmt_internals" , reason = "internal to format_args!" , issue = "none" ) ]
323323 #[ inline]
324- pub fn $f<' b, T : $t>( x: & ' b T ) -> ArgumentV1 <' _> {
324+ pub fn $f<' b, T : $t>( x: & ' b T ) -> Argument <' _> {
325325 Self :: new( x, $t:: fmt)
326326 }
327327 } ;
328328}
329329
330- #[ rustc_diagnostic_item = "ArgumentV1Methods " ]
331- impl < ' a > ArgumentV1 < ' a > {
330+ #[ rustc_diagnostic_item = "ArgumentMethods " ]
331+ impl < ' a > Argument < ' a > {
332332 #[ doc( hidden) ]
333333 #[ unstable( feature = "fmt_internals" , reason = "internal to format_args!" , issue = "none" ) ]
334334 #[ inline]
335- pub fn new < ' b , T > ( x : & ' b T , f : fn ( & T , & mut Formatter < ' _ > ) -> Result ) -> ArgumentV1 < ' b > {
335+ pub fn new < ' b , T > ( x : & ' b T , f : fn ( & T , & mut Formatter < ' _ > ) -> Result ) -> Argument < ' b > {
336336 // SAFETY: `mem::transmute(x)` is safe because
337337 // 1. `&'b T` keeps the lifetime it originated with `'b`
338338 // (so as to not have an unbounded lifetime)
@@ -341,7 +341,7 @@ impl<'a> ArgumentV1<'a> {
341341 // `mem::transmute(f)` is safe since `fn(&T, &mut Formatter<'_>) -> Result`
342342 // and `fn(&Opaque, &mut Formatter<'_>) -> Result` have the same ABI
343343 // (as long as `T` is `Sized`)
344- unsafe { ArgumentV1 { formatter : mem:: transmute ( f) , value : mem:: transmute ( x) } }
344+ unsafe { Argument { formatter : mem:: transmute ( f) , value : mem:: transmute ( x) } }
345345 }
346346
347347 arg_new ! ( new_display, Display ) ;
@@ -356,8 +356,8 @@ impl<'a> ArgumentV1<'a> {
356356
357357 #[ doc( hidden) ]
358358 #[ unstable( feature = "fmt_internals" , reason = "internal to format_args!" , issue = "none" ) ]
359- pub fn from_usize ( x : & usize ) -> ArgumentV1 < ' _ > {
360- ArgumentV1 :: new ( x, USIZE_MARKER )
359+ pub fn from_usize ( x : & usize ) -> Argument < ' _ > {
360+ Argument :: new ( x, USIZE_MARKER )
361361 }
362362
363363 fn as_usize ( & self ) -> Option < usize > {
@@ -377,7 +377,7 @@ impl<'a> ArgumentV1<'a> {
377377
378378// flags available in the v1 format of format_args
379379#[ derive( Copy , Clone ) ]
380- enum FlagV1 {
380+ enum Flag {
381381 SignPlus ,
382382 SignMinus ,
383383 Alternate ,
@@ -404,7 +404,7 @@ impl<'a> Arguments<'a> {
404404 #[ doc( hidden) ]
405405 #[ inline]
406406 #[ unstable( feature = "fmt_internals" , reason = "internal to format_args!" , issue = "none" ) ]
407- pub fn new_v1 ( pieces : & ' a [ & ' static str ] , args : & ' a [ ArgumentV1 < ' a > ] ) -> Arguments < ' a > {
407+ pub fn new_v1 ( pieces : & ' a [ & ' static str ] , args : & ' a [ Argument < ' a > ] ) -> Arguments < ' a > {
408408 if pieces. len ( ) < args. len ( ) || pieces. len ( ) > args. len ( ) + 1 {
409409 panic ! ( "invalid args" ) ;
410410 }
@@ -416,7 +416,7 @@ impl<'a> Arguments<'a> {
416416 #[ inline]
417417 #[ unstable( feature = "fmt_internals" , reason = "internal to format_args!" , issue = "none" ) ]
418418 #[ rustc_const_unstable( feature = "const_fmt_arguments_new" , issue = "none" ) ]
419- pub const fn new_v1 ( pieces : & ' a [ & ' static str ] , args : & ' a [ ArgumentV1 < ' a > ] ) -> Arguments < ' a > {
419+ pub const fn new_v1 ( pieces : & ' a [ & ' static str ] , args : & ' a [ Argument < ' a > ] ) -> Arguments < ' a > {
420420 if pieces. len ( ) < args. len ( ) || pieces. len ( ) > args. len ( ) + 1 {
421421 panic ! ( "invalid args" ) ;
422422 }
@@ -435,7 +435,7 @@ impl<'a> Arguments<'a> {
435435 #[ unstable( feature = "fmt_internals" , reason = "internal to format_args!" , issue = "none" ) ]
436436 pub fn new_v1_formatted (
437437 pieces : & ' a [ & ' static str ] ,
438- args : & ' a [ ArgumentV1 < ' a > ] ,
438+ args : & ' a [ Argument < ' a > ] ,
439439 fmt : & ' a [ rt:: Placeholder ] ,
440440 _unsafe_arg : UnsafeArg ,
441441 ) -> Arguments < ' a > {
@@ -502,7 +502,7 @@ pub struct Arguments<'a> {
502502
503503 // Dynamic arguments for interpolation, to be interleaved with string
504504 // pieces. (Every argument is preceded by a string piece.)
505- args : & ' a [ ArgumentV1 < ' a > ] ,
505+ args : & ' a [ Argument < ' a > ] ,
506506}
507507
508508impl < ' a > Arguments < ' a > {
@@ -1274,7 +1274,7 @@ pub fn write(output: &mut dyn Write, args: Arguments<'_>) -> Result {
12741274 Ok ( ( ) )
12751275}
12761276
1277- unsafe fn run ( fmt : & mut Formatter < ' _ > , arg : & rt:: Placeholder , args : & [ ArgumentV1 < ' _ > ] ) -> Result {
1277+ unsafe fn run ( fmt : & mut Formatter < ' _ > , arg : & rt:: Placeholder , args : & [ Argument < ' _ > ] ) -> Result {
12781278 fmt. fill = arg. fill ;
12791279 fmt. align = arg. align ;
12801280 fmt. flags = arg. flags ;
@@ -1295,7 +1295,7 @@ unsafe fn run(fmt: &mut Formatter<'_>, arg: &rt::Placeholder, args: &[ArgumentV1
12951295 ( value. formatter ) ( value. value , fmt)
12961296}
12971297
1298- unsafe fn getcount ( args : & [ ArgumentV1 < ' _ > ] , cnt : & rt:: Count ) -> Option < usize > {
1298+ unsafe fn getcount ( args : & [ Argument < ' _ > ] , cnt : & rt:: Count ) -> Option < usize > {
12991299 match * cnt {
13001300 rt:: Count :: Is ( n) => Some ( n) ,
13011301 rt:: Count :: Implied => None ,
@@ -1878,7 +1878,7 @@ impl<'a> Formatter<'a> {
18781878 #[ must_use]
18791879 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
18801880 pub fn sign_plus ( & self ) -> bool {
1881- self . flags & ( 1 << FlagV1 :: SignPlus as u32 ) != 0
1881+ self . flags & ( 1 << Flag :: SignPlus as u32 ) != 0
18821882 }
18831883
18841884 /// Determines if the `-` flag was specified.
@@ -1907,7 +1907,7 @@ impl<'a> Formatter<'a> {
19071907 #[ must_use]
19081908 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
19091909 pub fn sign_minus ( & self ) -> bool {
1910- self . flags & ( 1 << FlagV1 :: SignMinus as u32 ) != 0
1910+ self . flags & ( 1 << Flag :: SignMinus as u32 ) != 0
19111911 }
19121912
19131913 /// Determines if the `#` flag was specified.
@@ -1935,7 +1935,7 @@ impl<'a> Formatter<'a> {
19351935 #[ must_use]
19361936 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
19371937 pub fn alternate ( & self ) -> bool {
1938- self . flags & ( 1 << FlagV1 :: Alternate as u32 ) != 0
1938+ self . flags & ( 1 << Flag :: Alternate as u32 ) != 0
19391939 }
19401940
19411941 /// Determines if the `0` flag was specified.
@@ -1961,17 +1961,17 @@ impl<'a> Formatter<'a> {
19611961 #[ must_use]
19621962 #[ stable( feature = "fmt_flags" , since = "1.5.0" ) ]
19631963 pub fn sign_aware_zero_pad ( & self ) -> bool {
1964- self . flags & ( 1 << FlagV1 :: SignAwareZeroPad as u32 ) != 0
1964+ self . flags & ( 1 << Flag :: SignAwareZeroPad as u32 ) != 0
19651965 }
19661966
19671967 // FIXME: Decide what public API we want for these two flags.
19681968 // https://github.com/rust-lang/rust/issues/48584
19691969 fn debug_lower_hex ( & self ) -> bool {
1970- self . flags & ( 1 << FlagV1 :: DebugLowerHex as u32 ) != 0
1970+ self . flags & ( 1 << Flag :: DebugLowerHex as u32 ) != 0
19711971 }
19721972
19731973 fn debug_upper_hex ( & self ) -> bool {
1974- self . flags & ( 1 << FlagV1 :: DebugUpperHex as u32 ) != 0
1974+ self . flags & ( 1 << Flag :: DebugUpperHex as u32 ) != 0
19751975 }
19761976
19771977 /// Creates a [`DebugStruct`] builder designed to assist with creation of
@@ -2531,13 +2531,13 @@ pub(crate) fn pointer_fmt_inner(ptr_addr: usize, f: &mut Formatter<'_>) -> Resul
25312531 // or not to zero extend, and then unconditionally set it to get the
25322532 // prefix.
25332533 if f. alternate ( ) {
2534- f. flags |= 1 << ( FlagV1 :: SignAwareZeroPad as u32 ) ;
2534+ f. flags |= 1 << ( Flag :: SignAwareZeroPad as u32 ) ;
25352535
25362536 if f. width . is_none ( ) {
25372537 f. width = Some ( ( usize:: BITS / 4 ) as usize + 2 ) ;
25382538 }
25392539 }
2540- f. flags |= 1 << ( FlagV1 :: Alternate as u32 ) ;
2540+ f. flags |= 1 << ( Flag :: Alternate as u32 ) ;
25412541
25422542 let ret = LowerHex :: fmt ( & ptr_addr, f) ;
25432543
0 commit comments