about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-09-26 08:42:34 +0000
committerbors <bors@rust-lang.org>2019-09-26 08:42:34 +0000
commit134004f74db3b4626bde37cc068d9ae6dedd2d38 (patch)
treef0c0cd46c057791d6a65b4a1bce470f262ecfee3 /src/libcore
parentdc45735f29788924b9fc351d100e5bf3ebdca162 (diff)
parente70724c23bd2bd5cfbbac784d103f2a61a40284f (diff)
downloadrust-134004f74db3b4626bde37cc068d9ae6dedd2d38.tar.gz
rust-134004f74db3b4626bde37cc068d9ae6dedd2d38.zip
Auto merge of #62661 - arielb1:never-reserve, r=nikomatsakis
reserve `impl<T> From<!> for T`

this is necessary for never-type stabilization.

cc #57012 #35121

I think we wanted a crater run for this @nikomatsakis?

r? @nikomatsakis
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/convert.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs
index 06f2b7bab12..3cd2337ee59 100644
--- a/src/libcore/convert.rs
+++ b/src/libcore/convert.rs
@@ -554,6 +554,18 @@ impl<T> From<T> for T {
     fn from(t: T) -> T { t }
 }
 
+/// **Stability note:** This impl does not yet exist, but we are
+/// "reserving space" to add it in the future. See
+/// [rust-lang/rust#64715][#64715] for details.
+///
+/// [#64715]: https://github.com/rust-lang/rust/issues/64715
+#[stable(feature = "convert_infallible", since = "1.34.0")]
+#[cfg(not(bootstrap))]
+#[rustc_reservation_impl="permitting this impl would forbid us from adding \
+`impl<T> From<!> for T` later; see rust-lang/rust#64715 for details"]
+impl<T> From<!> for T {
+    fn from(t: !) -> T { t }
+}
 
 // TryFrom implies TryInto
 #[stable(feature = "try_from", since = "1.34.0")]