diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-06-12 16:43:49 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-06-12 16:47:46 +0200 |
| commit | d3b4d7da9a801dac3af6a3cf52eb55af83adc5f5 (patch) | |
| tree | 72ab79ed75dddfb7b97ddf02ba4d19c4efc9ea5a /src/diag.rs | |
| parent | 378ebe5f5601f11c3f428c17bed492012feb251e (diff) | |
More `bail!` usage
Diffstat (limited to 'src/diag.rs')
| -rw-r--r-- | src/diag.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/diag.rs b/src/diag.rs index d9f88024..4fb9ecc0 100644 --- a/src/diag.rs +++ b/src/diag.rs @@ -13,6 +13,15 @@ use crate::syntax::{ErrorPos, Span, Spanned}; use crate::World; /// Early-return with a [`StrResult`] or [`SourceResult`]. +/// +/// If called with just a string and format args, returns with a +/// `StrResult`. If called with a span, a string and format args, returns +/// a `SourceResult`. +/// +/// ``` +/// bail!("bailing with a {}", "string result"); +/// bail!(span, "bailing with a {}", "source result"); +/// ``` #[macro_export] #[doc(hidden)] macro_rules! __bail { |
