Skip to content

Commit ff02add

Browse files
committed
Auto merge of #15093 - HKalbasi:format-args, r=HKalbasi
Use `ArgumentV1` instead of `Argument` Now that the choice is between supporting stable and supporting nothing, let's support stable. cc #15082
2 parents f993485 + 3c87825 commit ff02add

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

crates/hir-def/src/macro_expansion_tests/builtin_fn_macro.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ macro_rules! format_args {
201201
}
202202
203203
fn main() {
204-
::core::fmt::Arguments::new_v1(&["", " ", ], &[::core::fmt::Argument::new(&(arg1(a, b, c)), ::core::fmt::Display::fmt), ::core::fmt::Argument::new(&(arg2), ::core::fmt::Debug::fmt), ]);
204+
::core::fmt::Arguments::new_v1(&["", " ", ], &[::core::fmt::ArgumentV1::new(&(arg1(a, b, c)), ::core::fmt::Display::fmt), ::core::fmt::ArgumentV1::new(&(arg2), ::core::fmt::Debug::fmt), ]);
205205
}
206206
"##]],
207207
);
@@ -237,9 +237,9 @@ fn main() {
237237
/* error: no rule matches input tokens */;
238238
/* error: no rule matches input tokens */;
239239
/* error: no rule matches input tokens */;
240-
/* error: no rule matches input tokens */::core::fmt::Arguments::new_v1(&["", ], &[::core::fmt::Argument::new(&(), ::core::fmt::Display::fmt), ]);
240+
/* error: no rule matches input tokens */::core::fmt::Arguments::new_v1(&["", ], &[::core::fmt::ArgumentV1::new(&(), ::core::fmt::Display::fmt), ]);
241241
/* error: no rule matches input tokens */;
242-
::core::fmt::Arguments::new_v1(&["", ], &[::core::fmt::Argument::new(&(5), ::core::fmt::Display::fmt), ]);
242+
::core::fmt::Arguments::new_v1(&["", ], &[::core::fmt::ArgumentV1::new(&(5), ::core::fmt::Display::fmt), ]);
243243
}
244244
"##]],
245245
);
@@ -267,7 +267,7 @@ macro_rules! format_args {
267267
}
268268
269269
fn main() {
270-
::core::fmt::Arguments::new_v1(&["", " ", ], &[::core::fmt::Argument::new(&(a::<A, B>()), ::core::fmt::Display::fmt), ::core::fmt::Argument::new(&(b), ::core::fmt::Debug::fmt), ]);
270+
::core::fmt::Arguments::new_v1(&["", " ", ], &[::core::fmt::ArgumentV1::new(&(a::<A, B>()), ::core::fmt::Display::fmt), ::core::fmt::ArgumentV1::new(&(b), ::core::fmt::Debug::fmt), ]);
271271
}
272272
"##]],
273273
);
@@ -300,7 +300,7 @@ macro_rules! format_args {
300300
}
301301
302302
fn main() {
303-
::core::fmt::Arguments::new_v1(&[r#""#, r#",mismatch,""#, r#"",""#, r#"""#, ], &[::core::fmt::Argument::new(&(location_csv_pat(db, &analysis, vfs, &sm, pat_id)), ::core::fmt::Display::fmt), ::core::fmt::Argument::new(&(mismatch.expected.display(db)), ::core::fmt::Display::fmt), ::core::fmt::Argument::new(&(mismatch.actual.display(db)), ::core::fmt::Display::fmt), ]);
303+
::core::fmt::Arguments::new_v1(&[r#""#, r#",mismatch,""#, r#"",""#, r#"""#, ], &[::core::fmt::ArgumentV1::new(&(location_csv_pat(db, &analysis, vfs, &sm, pat_id)), ::core::fmt::Display::fmt), ::core::fmt::ArgumentV1::new(&(mismatch.expected.display(db)), ::core::fmt::Display::fmt), ::core::fmt::ArgumentV1::new(&(mismatch.actual.display(db)), ::core::fmt::Display::fmt), ]);
304304
}
305305
"##]],
306306
);
@@ -334,7 +334,7 @@ macro_rules! format_args {
334334
}
335335
336336
fn main() {
337-
::core::fmt::Arguments::new_v1(&["xxx", "y", "zzz", ], &[::core::fmt::Argument::new(&(2), ::core::fmt::Display::fmt), ::core::fmt::Argument::new(&(b), ::core::fmt::Debug::fmt), ]);
337+
::core::fmt::Arguments::new_v1(&["xxx", "y", "zzz", ], &[::core::fmt::ArgumentV1::new(&(2), ::core::fmt::Display::fmt), ::core::fmt::ArgumentV1::new(&(b), ::core::fmt::Debug::fmt), ]);
338338
}
339339
"##]],
340340
);
@@ -365,7 +365,7 @@ macro_rules! format_args {
365365
fn main() {
366366
let _ =
367367
/* error: no rule matches input tokens *//* parse error: expected field name or number */
368-
::core::fmt::Arguments::new_v1(&["", " ", ], &[::core::fmt::Argument::new(&(a.), ::core::fmt::Display::fmt), ::core::fmt::Argument::new(&(), ::core::fmt::Debug::fmt), ]);
368+
::core::fmt::Arguments::new_v1(&["", " ", ], &[::core::fmt::ArgumentV1::new(&(a.), ::core::fmt::Display::fmt), ::core::fmt::ArgumentV1::new(&(), ::core::fmt::Debug::fmt), ]);
369369
}
370370
"##]],
371371
);

crates/hir-expand/src/builtin_fn_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ fn format_args_expand_general(
361361
quote!(::core::fmt::Display::fmt)
362362
}
363363
};
364-
arg_tts.push(quote! { ::core::fmt::Argument::new(&(#arg_tree), #formatter), });
364+
arg_tts.push(quote! { ::core::fmt::ArgumentV1::new(&(#arg_tree), #formatter), });
365365
}
366366
'}' => {
367367
if format_iter.peek() == Some(&'}') {

0 commit comments

Comments
 (0)