Skip to content

Commit b82aaf4

Browse files
committed
Constify identify conversions
1 parent e846f9c commit b82aaf4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

library/core/src/convert/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,8 @@ where
532532

533533
// From implies Into
534534
#[stable(feature = "rust1", since = "1.0.0")]
535-
impl<T, U> Into<U> for T
535+
#[rustc_const_unstable(feature = "const_convert", issue = "none")]
536+
impl<T, U> const Into<U> for T
536537
where
537538
U: From<T>,
538539
{
@@ -543,7 +544,8 @@ where
543544

544545
// From (and thus Into) is reflexive
545546
#[stable(feature = "rust1", since = "1.0.0")]
546-
impl<T> From<T> for T {
547+
#[rustc_const_unstable(feature = "const_convert", issue = "none")]
548+
impl<T> const From<T> for T {
547549
fn from(t: T) -> T {
548550
t
549551
}

library/core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
#![feature(const_float_bits_conv)]
8383
#![feature(const_float_classify)]
8484
#![feature(const_heap)]
85+
#![feature(const_convert)]
8586
#![feature(const_inherent_unchecked_arith)]
8687
#![feature(const_int_unchecked_arith)]
8788
#![feature(const_intrinsic_copy)]

0 commit comments

Comments
 (0)