mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
29 lines
859 B
Rust
29 lines
859 B
Rust
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
|
|
}
|