xref: /third_party/rust/crates/clap/clap_derive/src/macros.rs
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/rust/crates/clap/clap_derive/src/
119625d8cSopenharmony_cimacro_rules! format_err {
219625d8cSopenharmony_ci    ($obj:expr, $($format:tt)+) => {{
319625d8cSopenharmony_ci        #[allow(unused_imports)]
419625d8cSopenharmony_ci        use $crate::utils::error::*;
519625d8cSopenharmony_ci        let msg = format!($($format)+);
619625d8cSopenharmony_ci        $obj.EXPECTED_Span_OR_ToTokens(msg)
719625d8cSopenharmony_ci    }};
819625d8cSopenharmony_ci}
919625d8cSopenharmony_ci
1019625d8cSopenharmony_cimacro_rules! abort {
1119625d8cSopenharmony_ci    ($obj:expr, $($format:tt)+) => {{
1219625d8cSopenharmony_ci        return Err(format_err!($obj, $($format)+));
1319625d8cSopenharmony_ci    }};
1419625d8cSopenharmony_ci}
1519625d8cSopenharmony_ci
1619625d8cSopenharmony_cimacro_rules! abort_call_site {
1719625d8cSopenharmony_ci    ($($format:tt)+) => {{
1819625d8cSopenharmony_ci        let span = proc_macro2::Span::call_site();
1919625d8cSopenharmony_ci        abort!(span, $($format)+)
2019625d8cSopenharmony_ci    }};
2119625d8cSopenharmony_ci}
22

Indexes created Thu Nov 07 10:32:03 CST 2024