summaryrefslogtreecommitdiffstats
path: root/src/test/ui/macros/issue-99907.rs
blob: eebcfc2efecc9d097b40db2c16604760b538af8e (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
// check-pass
// run-rustfix

fn main() {
    println!("Hello {:.1}!", f = 0.02f32);
    //~^ WARNING named argument `f` is not used by name [named_arguments_used_positionally]
    //~| HELP use the named argument by name to avoid ambiguity

    println!("Hello {:1.1}!", f = 0.02f32);
    //~^ WARNING named argument `f` is not used by name [named_arguments_used_positionally]
    //~| HELP use the named argument by name to avoid ambiguity

    println!("Hello {}!", f = 0.02f32);
    //~^ WARNING named argument `f` is not used by name [named_arguments_used_positionally]
    //~| HELP use the named argument by name to avoid ambiguity

    println!("Hello { }!", f = 0.02f32);
    //~^ WARNING named argument `f` is not used by name [named_arguments_used_positionally]
    //~| HELP use the named argument by name to avoid ambiguity

    println!("Hello {  }!", f = 0.02f32);
    //~^ WARNING named argument `f` is not used by name [named_arguments_used_positionally]
    //~| HELP use the named argument by name to avoid ambiguity
}