diff options
| author | Albin Hedman <albin9604@gmail.com> | 2021-07-04 00:13:27 +0200 |
|---|---|---|
| committer | Albin Hedman <albin9604@gmail.com> | 2021-09-15 16:57:58 +0200 |
| commit | b82aaf49132793d490bb21bada9b02fa3cfd49ac (patch) | |
| tree | 3fe65f49fa4482453ea2cb9162af58c1db367227 | |
| parent | e846f9c44f1e17cac66d7b75e2ca099c87a2dfcb (diff) | |
| download | rust-b82aaf49132793d490bb21bada9b02fa3cfd49ac.tar.gz rust-b82aaf49132793d490bb21bada9b02fa3cfd49ac.zip | |
Constify identify conversions
| -rw-r--r-- | library/core/src/convert/mod.rs | 6 | ||||
| -rw-r--r-- | library/core/src/lib.rs | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index 1e512af4805..78d37ebac2d 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -532,7 +532,8 @@ where // From implies Into #[stable(feature = "rust1", since = "1.0.0")] -impl<T, U> Into<U> for T +#[rustc_const_unstable(feature = "const_convert", issue = "none")] +impl<T, U> const Into<U> for T where U: From<T>, { @@ -543,7 +544,8 @@ where // From (and thus Into) is reflexive #[stable(feature = "rust1", since = "1.0.0")] -impl<T> From<T> for T { +#[rustc_const_unstable(feature = "const_convert", issue = "none")] +impl<T> const From<T> for T { fn from(t: T) -> T { t } diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 265ba9f1bb9..9c4429d320f 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -82,6 +82,7 @@ #![feature(const_float_bits_conv)] #![feature(const_float_classify)] #![feature(const_heap)] +#![feature(const_convert)] #![feature(const_inherent_unchecked_arith)] #![feature(const_int_unchecked_arith)] #![feature(const_intrinsic_copy)] |
