Debian Codegraph @

gcc/testsuite/rust/compile/format_args_extra_comma.rs

raw
1 #![feature(rustc_attrs)]
2
3 #[rustc_builtin_macro]
4 macro_rules! format_args {
5 () => {};
6 }
7
8 #[lang = "sized"]
9 trait Sized {}
10
11 pub mod core {
12 pub mod fmt {
13 pub struct Formatter;
14 pub struct Result;
15
16 pub struct Arguments<'a>;
17
18 impl<'a> Arguments<'a> {
19 pub fn new_v1(_: &'a [&'static str], _: &'a [ArgumentV1<'a>]) -> Arguments<'a> {
20 Arguments
21 }
22 }
23
24 pub struct ArgumentV1<'a>;
25
26 impl<'a> ArgumentV1<'a> {
27 pub fn new<'b, T>(_: &'b T, _: fn(&T, &mut Formatter) -> Result) -> ArgumentV1 {
28 ArgumentV1
29 }
30 }
31
32 pub trait Display {
33 fn fmt(&self, _: &mut Formatter) -> Result;
34 }
35
36 impl Display for i32 {
37 fn fmt(&self, _: &mut Formatter) -> Result {
38 // { dg-warning "unused name .self." "" { target *-*-* } .-1 }
39 Result
40 }
41 }
42 }
43 }
44
45 fn main() {
46 let _formatted = format_args!("extra commas {} {}", 15, 14,);
47 }