summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.stderr
blob: ee941762196151209d43f978516dc2024801d0ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
error: variables can be used directly in the `format!` string
  --> $DIR/uninlined_format_args.rs:9:5
   |
LL |     println!("val='{}'", local_i32);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `-D clippy::uninlined-format-args` implied by `-D warnings`
help: change this to
   |
LL -     println!("val='{}'", local_i32);
LL +     println!("val='{local_i32}'");
   |

error: literal with an empty format string
  --> $DIR/uninlined_format_args.rs:10:35
   |
LL |     println!("Hello {} is {:.*}", "x", local_i32, local_f64);
   |                                   ^^^
   |
   = note: `-D clippy::print-literal` implied by `-D warnings`
help: try this
   |
LL -     println!("Hello {} is {:.*}", "x", local_i32, local_f64);
LL +     println!("Hello x is {:.*}", local_i32, local_f64);
   |

error: variables can be used directly in the `format!` string
  --> $DIR/uninlined_format_args.rs:10:5
   |
LL |     println!("Hello {} is {:.*}", "x", local_i32, local_f64);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: change this to
   |
LL -     println!("Hello {} is {:.*}", "x", local_i32, local_f64);
LL +     println!("Hello {} is {local_f64:.local_i32$}", "x");
   |

error: variables can be used directly in the `format!` string
  --> $DIR/uninlined_format_args.rs:11:5
   |
LL |     println!("Hello {} is {:.*}", local_i32, 5, local_f64);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: change this to
   |
LL -     println!("Hello {} is {:.*}", local_i32, 5, local_f64);
LL +     println!("Hello {local_i32} is {local_f64:.*}", 5);
   |

error: variables can be used directly in the `format!` string
  --> $DIR/uninlined_format_args.rs:12:5
   |
LL |     println!("Hello {} is {2:.*}", local_i32, 5, local_f64);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: change this to
   |
LL -     println!("Hello {} is {2:.*}", local_i32, 5, local_f64);
LL +     println!("Hello {local_i32} is {local_f64:.*}", 5);
   |

error: variables can be used directly in the `format!` string
  --> $DIR/uninlined_format_args.rs:13:5
   |
LL |     println!("{}, {}", local_i32, local_opt.unwrap());
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
help: change this to
   |
LL -     println!("{}, {}", local_i32, local_opt.unwrap());
LL +     println!("{local_i32}, {}", local_opt.unwrap());
   |

error: aborting due to 6 previous errors