Skip to content

Commit

Permalink
Remove "V1" from ArgumentsV1 and FlagsV1.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Apr 24, 2023
1 parent a982959 commit f7bafdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs
Expand Up @@ -201,7 +201,7 @@ macro_rules! format_args {
}
fn main() {
$crate::fmt::Arguments::new_v1(&[], &[$crate::fmt::ArgumentV1::new(&(arg1(a, b, c)), $crate::fmt::Display::fmt), $crate::fmt::ArgumentV1::new(&(arg2), $crate::fmt::Display::fmt), ]);
$crate::fmt::Arguments::new_v1(&[], &[$crate::fmt::Argument::new(&(arg1(a, b, c)), $crate::fmt::Display::fmt), $crate::fmt::Argument::new(&(arg2), $crate::fmt::Display::fmt), ]);
}
"#]],
);
Expand Down Expand Up @@ -229,7 +229,7 @@ macro_rules! format_args {
}
fn main() {
$crate::fmt::Arguments::new_v1(&[], &[$crate::fmt::ArgumentV1::new(&(a::<A, B>()), $crate::fmt::Display::fmt), $crate::fmt::ArgumentV1::new(&(b), $crate::fmt::Display::fmt), ]);
$crate::fmt::Arguments::new_v1(&[], &[$crate::fmt::Argument::new(&(a::<A, B>()), $crate::fmt::Display::fmt), $crate::fmt::Argument::new(&(b), $crate::fmt::Display::fmt), ]);
}
"#]],
);
Expand Down Expand Up @@ -260,7 +260,7 @@ macro_rules! format_args {
fn main() {
let _ =
/* parse error: expected field name or number */
$crate::fmt::Arguments::new_v1(&[], &[$crate::fmt::ArgumentV1::new(&(a.), $crate::fmt::Display::fmt), ]);
$crate::fmt::Arguments::new_v1(&[], &[$crate::fmt::Argument::new(&(a.), $crate::fmt::Display::fmt), ]);
}
"#]],
);
Expand Down
6 changes: 3 additions & 3 deletions crates/hir-expand/src/builtin_fn_macro.rs
Expand Up @@ -241,8 +241,8 @@ fn format_args_expand(
// We expand `format_args!("", a1, a2)` to
// ```
// $crate::fmt::Arguments::new_v1(&[], &[
// $crate::fmt::ArgumentV1::new(&arg1,$crate::fmt::Display::fmt),
// $crate::fmt::ArgumentV1::new(&arg2,$crate::fmt::Display::fmt),
// $crate::fmt::Argument::new(&arg1,$crate::fmt::Display::fmt),
// $crate::fmt::Argument::new(&arg2,$crate::fmt::Display::fmt),
// ])
// ```,
// which is still not really correct, but close enough for now
Expand All @@ -267,7 +267,7 @@ fn format_args_expand(
}
let _format_string = args.remove(0);
let arg_tts = args.into_iter().flat_map(|arg| {
quote! { #DOLLAR_CRATE::fmt::ArgumentV1::new(&(#arg), #DOLLAR_CRATE::fmt::Display::fmt), }
quote! { #DOLLAR_CRATE::fmt::Argument::new(&(#arg), #DOLLAR_CRATE::fmt::Display::fmt), }
}.token_trees);
let expanded = quote! {
#DOLLAR_CRATE::fmt::Arguments::new_v1(&[], &[##arg_tts])
Expand Down

0 comments on commit f7bafdb

Please sign in to comment.