Skip to content
Myr

Merge pull request #426 from dtolnay/clippyfmt

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Mark macros with clippy::format_args

authored by David Tolnay · committed by GitHub · parents da5fd9d, 52f2115 · Browse files · 2 files+10 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−0 removed

  • other:+10 added−0 removed

2 files+10 added−0 removed

modified:src/macros.rs+3 added
52 unmodified lines
53/// # Ok(())54/// # }55/// ```56#[macro_export]57#[cfg_attr(not(anyhow_no_clippy_format_args), clippy::format_args)]58macro_rules! bail {59 ($msg:literal $(,)?) => {60 return $crate::__private::Err($crate::__anyhow!($msg))61 };
92 unmodified lines
154155#[cfg(not(doc))]156__ensure![157 #[macro_export]158 #[cfg_attr(not(anyhow_no_clippy_format_args), clippy::format_args)]159 macro_rules! ensure {160 ($($tt:tt)*) => {161 $crate::__parse_ensure!(162 /* state */ 0
36 unmodified lines
199/// # Ok(())200/// }201/// ```202#[macro_export]203#[cfg_attr(not(anyhow_no_clippy_format_args), clippy::format_args)]204macro_rules! anyhow {205 ($msg:literal $(,)?) => {206 $crate::__private::must_use({207 let error = $crate::__private::format_err($crate::__private::format_args!($msg));
38 unmodified lines
modified:build.rs+7 added
68 unmodified lines
6970 if rustc >= 80 {71 println!("cargo:rustc-check-cfg=cfg(anyhow_build_probe)");72 println!("cargo:rustc-check-cfg=cfg(anyhow_nightly_testing)");73 println!("cargo:rustc-check-cfg=cfg(anyhow_no_clippy_format_args)");74 println!("cargo:rustc-check-cfg=cfg(anyhow_no_core_error)");75 println!("cargo:rustc-check-cfg=cfg(anyhow_no_core_unwind_safe)");76 println!("cargo:rustc-check-cfg=cfg(anyhow_no_fmt_arguments_as_str)");77 println!("cargo:rustc-check-cfg=cfg(anyhow_no_ptr_addr_of)");
34 unmodified lines
112 // core::error::Error113 // https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html#coreerrorerror114 println!("cargo:rustc-cfg=anyhow_no_core_error");115 }116117 if rustc < 85 {118 // #[clippy::format_args]119 // https://doc.rust-lang.org/1.85.1/clippy/attribs.html#clippyformat_args120 println!("cargo:rustc-cfg=anyhow_no_clippy_format_args");121 }122}123124fn compile_probe(rustc_bootstrap: bool) -> bool {125 if env::var_os("RUSTC_STAGE").is_some() {
107 unmodified lines