diff options
| author | bors <bors@rust-lang.org> | 2015-09-26 21:52:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-09-26 21:52:37 +0000 |
| commit | 6f880eee792e974b18cbb129fd16928939589e7c (patch) | |
| tree | 90988161f5816a73e1b9822e48bc7c6217801df1 /src/libcollections/string.rs | |
| parent | 54f7b1d455915794ab000448799c5092c57535c1 (diff) | |
| parent | 81f0bf76672e2f4d30470920e62dc3cfe70bec6c (diff) | |
| download | rust-6f880eee792e974b18cbb129fd16928939589e7c.tar.gz rust-6f880eee792e974b18cbb129fd16928939589e7c.zip | |
Auto merge of #28635 - alexcrichton:str-parse-error-void, r=aturon
It can never be instantiated, so signify this by having it actually be an empty `enum`. cc #27734
Diffstat (limited to 'src/libcollections/string.rs')
| -rw-r--r-- | src/libcollections/string.rs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index ba921fed68b..acbce825ecc 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -1041,8 +1041,8 @@ impl ops::DerefMut for String { #[unstable(feature = "str_parse_error", reason = "may want to be replaced with \ Void if it ever exists", issue = "27734")] -#[derive(Copy, Clone, Debug, Eq, PartialEq)] -pub struct ParseError(()); +#[derive(Copy)] +pub enum ParseError {} #[stable(feature = "rust1", since = "1.0.0")] impl FromStr for String { @@ -1053,6 +1053,26 @@ impl FromStr for String { } } +impl Clone for ParseError { + fn clone(&self) -> ParseError { + match *self {} + } +} + +impl fmt::Debug for ParseError { + fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result { + match *self {} + } +} + +impl PartialEq for ParseError { + fn eq(&self, _: &ParseError) -> bool { + match *self {} + } +} + +impl Eq for ParseError {} + /// A generic trait for converting a value to a string #[stable(feature = "rust1", since = "1.0.0")] pub trait ToString { |
