summaryrefslogtreecommitdiffstats
path: root/vendor/time/src/error/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/time/src/error/mod.rs')
-rw-r--r--vendor/time/src/error/mod.rs24
1 files changed, 21 insertions, 3 deletions
diff --git a/vendor/time/src/error/mod.rs b/vendor/time/src/error/mod.rs
index 346b89f74..d2730c462 100644
--- a/vendor/time/src/error/mod.rs
+++ b/vendor/time/src/error/mod.rs
@@ -36,31 +36,47 @@ pub use parse_from_description::ParseFromDescription;
#[cfg(feature = "parsing")]
pub use try_from_parsed::TryFromParsed;
+#[cfg(feature = "parsing")]
+use crate::internal_macros::bug;
+
/// A unified error type for anything returned by a method in the time crate.
///
/// This can be used when you either don't know or don't care about the exact error returned.
/// `Result<_, time::Error>` (or its alias `time::Result<_>`) will work in these situations.
#[allow(missing_copy_implementations, variant_size_differences)]
-#[allow(clippy::missing_docs_in_private_items)] // variants only
#[non_exhaustive]
#[derive(Debug)]
pub enum Error {
+ #[allow(missing_docs)]
ConversionRange(ConversionRange),
+ #[allow(missing_docs)]
ComponentRange(ComponentRange),
#[cfg(feature = "local-offset")]
+ #[allow(missing_docs)]
IndeterminateOffset(IndeterminateOffset),
#[cfg(feature = "formatting")]
+ #[allow(missing_docs)]
Format(Format),
#[cfg(feature = "parsing")]
+ #[allow(missing_docs)]
ParseFromDescription(ParseFromDescription),
#[cfg(feature = "parsing")]
+ #[allow(missing_docs)]
#[non_exhaustive]
+ #[deprecated(
+ since = "0.3.28",
+ note = "no longer output. moved to the `ParseFromDescription` variant"
+ )]
UnexpectedTrailingCharacters,
#[cfg(feature = "parsing")]
+ #[allow(missing_docs)]
TryFromParsed(TryFromParsed),
#[cfg(all(any(feature = "formatting", feature = "parsing"), feature = "alloc"))]
+ #[allow(missing_docs)]
InvalidFormatDescription(InvalidFormatDescription),
+ #[allow(missing_docs)]
DifferentVariant(DifferentVariant),
+ #[allow(missing_docs)]
InvalidVariant(InvalidVariant),
}
@@ -76,7 +92,8 @@ impl fmt::Display for Error {
#[cfg(feature = "parsing")]
Self::ParseFromDescription(e) => e.fmt(f),
#[cfg(feature = "parsing")]
- Self::UnexpectedTrailingCharacters => f.write_str("unexpected trailing characters"),
+ #[allow(deprecated)]
+ Self::UnexpectedTrailingCharacters => bug!("variant should not be used"),
#[cfg(feature = "parsing")]
Self::TryFromParsed(e) => e.fmt(f),
#[cfg(all(any(feature = "formatting", feature = "parsing"), feature = "alloc"))]
@@ -100,7 +117,8 @@ impl std::error::Error for Error {
#[cfg(feature = "parsing")]
Self::ParseFromDescription(err) => Some(err),
#[cfg(feature = "parsing")]
- Self::UnexpectedTrailingCharacters => None,
+ #[allow(deprecated)]
+ Self::UnexpectedTrailingCharacters => bug!("variant should not be used"),
#[cfg(feature = "parsing")]
Self::TryFromParsed(err) => Some(err),
#[cfg(all(any(feature = "formatting", feature = "parsing"), feature = "alloc"))]