diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:50 +0000 |
commit | 9835e2ae736235810b4ea1c162ca5e65c547e770 (patch) | |
tree | 3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/time-macros/src/error.rs | |
parent | Releasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff) | |
download | rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/time-macros/src/error.rs')
-rw-r--r-- | vendor/time-macros/src/error.rs | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/vendor/time-macros/src/error.rs b/vendor/time-macros/src/error.rs index 4de369daf..849317f15 100644 --- a/vendor/time-macros/src/error.rs +++ b/vendor/time-macros/src/error.rs @@ -3,9 +3,6 @@ use std::fmt; use proc_macro::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; -#[cfg(any(feature = "formatting", feature = "parsing"))] -use crate::format_description::error::InvalidFormatDescription; - trait WithSpan { fn with_span(self, span: Span) -> Self; } @@ -38,12 +35,6 @@ pub(crate) enum Error { tree: TokenTree, }, UnexpectedEndOfInput, - #[cfg(any(feature = "formatting", feature = "parsing"))] - InvalidFormatDescription { - error: InvalidFormatDescription, - span_start: Option<Span>, - span_end: Option<Span>, - }, Custom { message: Cow<'static, str>, span_start: Option<Span>, @@ -59,11 +50,9 @@ impl fmt::Display for Error { write!(f, "invalid component: {name} was {value}") } #[cfg(any(feature = "formatting", feature = "parsing"))] - Self::ExpectedString { .. } => f.write_str("expected string"), + Self::ExpectedString { .. } => f.write_str("expected string literal"), Self::UnexpectedToken { tree } => write!(f, "unexpected token: {tree}"), Self::UnexpectedEndOfInput => f.write_str("unexpected end of input"), - #[cfg(any(feature = "formatting", feature = "parsing"))] - Self::InvalidFormatDescription { error, .. } => error.fmt(f), Self::Custom { message, .. } => f.write_str(message), } } @@ -76,8 +65,7 @@ impl Error { | Self::InvalidComponent { span_start, .. } | Self::Custom { span_start, .. } => *span_start, #[cfg(any(feature = "formatting", feature = "parsing"))] - Self::ExpectedString { span_start, .. } - | Self::InvalidFormatDescription { span_start, .. } => *span_start, + Self::ExpectedString { span_start, .. } => *span_start, Self::UnexpectedToken { tree } => Some(tree.span()), Self::UnexpectedEndOfInput => Some(Span::mixed_site()), } @@ -90,8 +78,7 @@ impl Error { | Self::InvalidComponent { span_end, .. } | Self::Custom { span_end, .. } => *span_end, #[cfg(any(feature = "formatting", feature = "parsing"))] - Self::ExpectedString { span_end, .. } - | Self::InvalidFormatDescription { span_end, .. } => *span_end, + Self::ExpectedString { span_end, .. } => *span_end, Self::UnexpectedToken { tree, .. } => Some(tree.span()), Self::UnexpectedEndOfInput => Some(Span::mixed_site()), } |