Skip to content

Commit 6f880ee

Browse files
committed
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
2 parents 54f7b1d + 81f0bf7 commit 6f880ee

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/libcollections/string.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,8 @@ impl ops::DerefMut for String {
10411041
#[unstable(feature = "str_parse_error", reason = "may want to be replaced with \
10421042
Void if it ever exists",
10431043
issue = "27734")]
1044-
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
1045-
pub struct ParseError(());
1044+
#[derive(Copy)]
1045+
pub enum ParseError {}
10461046

10471047
#[stable(feature = "rust1", since = "1.0.0")]
10481048
impl FromStr for String {
@@ -1053,6 +1053,26 @@ impl FromStr for String {
10531053
}
10541054
}
10551055

1056+
impl Clone for ParseError {
1057+
fn clone(&self) -> ParseError {
1058+
match *self {}
1059+
}
1060+
}
1061+
1062+
impl fmt::Debug for ParseError {
1063+
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
1064+
match *self {}
1065+
}
1066+
}
1067+
1068+
impl PartialEq for ParseError {
1069+
fn eq(&self, _: &ParseError) -> bool {
1070+
match *self {}
1071+
}
1072+
}
1073+
1074+
impl Eq for ParseError {}
1075+
10561076
/// A generic trait for converting a value to a string
10571077
#[stable(feature = "rust1", since = "1.0.0")]
10581078
pub trait ToString {

0 commit comments

Comments
 (0)