diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
commit | 837b550238aa671a591ccf282dddeab29cadb206 (patch) | |
tree | 914b6b8862bace72bd3245ca184d374b08d8a672 /vendor/time-macros/src/error.rs | |
parent | Adding debian version 1.70.0+dfsg2-1. (diff) | |
download | rustc-837b550238aa671a591ccf282dddeab29cadb206.tar.xz rustc-837b550238aa671a591ccf282dddeab29cadb206.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()), } |