summaryrefslogtreecommitdiffstats
path: root/tests/ui/fmt/suggest-inline-args.rs
blob: 515335ed9f40d86e8d685076ad7d8c4f14772d45 (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
mod foo {
    pub fn bar() -> i32 {
        1
    }
}

fn bar() -> i32 {
    2
}

fn main() {
    let stderr = 3;
    eprintln!({stderr});
    //~^ ERROR format argument must be a string literal
    //~| HELP quote your inlined format argument to use as string literal
    eprintln!({1});
    //~^ ERROR format argument must be a string literal
    //~| HELP you might be missing a string literal to format with
    eprintln!({foo::bar()});
    //~^ ERROR format argument must be a string literal
    //~| HELP you might be missing a string literal to format with
    eprintln!({bar()});
    //~^ ERROR format argument must be a string literal
    //~| HELP you might be missing a string literal to format with
    eprintln!({1; 2});
    //~^ ERROR format argument must be a string literal
    //~| HELP you might be missing a string literal to format with
}