std: Switch string::ParseError to an empty enum
It can never be instantiated, so signify this by having it actually be an empty `enum`. cc #27734
This commit is contained in:
parent
8fe79bdfda
commit
81f0bf7667
@ -1030,8 +1030,8 @@ fn deref_mut(&mut self) -> &mut str {
|
||||
#[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 {
|
||||
@ -1042,6 +1042,26 @@ fn from_str(s: &str) -> Result<String, ParseError> {
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user