about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/convert.rs5
-rw-r--r--src/libstd/error.rs3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs
index 6eb499ad8ab..e815d72d366 100644
--- a/src/libcore/convert.rs
+++ b/src/libcore/convert.rs
@@ -62,8 +62,9 @@ pub enum Infallible {}
 
 #[unstable(feature = "try_from", issue = "33417")]
 impl fmt::Display for Infallible {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        "an error of this type can never exist".fmt(f)
+    fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
+        match *self {
+        }
     }
 }
 /// A cheap reference-to-reference conversion. Used to convert a value to a
diff --git a/src/libstd/error.rs b/src/libstd/error.rs
index 5cb2b00334d..6a4de4ecbff 100644
--- a/src/libstd/error.rs
+++ b/src/libstd/error.rs
@@ -351,7 +351,8 @@ impl Error for char::ParseCharError {
 #[unstable(feature = "try_from", issue = "33417")]
 impl Error for convert::Infallible {
     fn description(&self) -> &str {
-        "an error of this type can never exist"
+        match *self {
+        }
     }
 }