// run-rustfix
#![warn(clippy::expect_fun_call)]
+#![allow(clippy::to_string_in_format_args)]
/// Checks implementation of the `EXPECT_FUN_CALL` lint
+macro_rules! one {
+ () => {
+ 1
+ };
+}
+
fn main() {
struct Foo;
let with_none_and_as_str: Option<i32> = None;
with_none_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
+ let with_none_and_format_with_macro: Option<i32> = None;
+ with_none_and_format_with_macro.expect(format!("Error {}: fake error", one!()).as_str());
+
let with_ok: Result<(), ()> = Ok(());
with_ok.expect("error");