@@ -485,9 +485,10 @@ pub trait TryFrom<T>: Sized {
485
485
486
486
// As lifts over &
487
487
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
488
- impl < T : ?Sized , U : ?Sized > AsRef < U > for & T
488
+ #[ rustc_const_unstable( feature = "const_convert" , issue = "88674" ) ]
489
+ impl < T : ?Sized , U : ?Sized > const AsRef < U > for & T
489
490
where
490
- T : AsRef < U > ,
491
+ T : ~ const AsRef < U > ,
491
492
{
492
493
fn as_ref ( & self ) -> & U {
493
494
<T as AsRef < U > >:: as_ref ( * self )
@@ -496,9 +497,10 @@ where
496
497
497
498
// As lifts over &mut
498
499
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
499
- impl < T : ?Sized , U : ?Sized > AsRef < U > for & mut T
500
+ #[ rustc_const_unstable( feature = "const_convert" , issue = "88674" ) ]
501
+ impl < T : ?Sized , U : ?Sized > const AsRef < U > for & mut T
500
502
where
501
- T : AsRef < U > ,
503
+ T : ~ const AsRef < U > ,
502
504
{
503
505
fn as_ref ( & self ) -> & U {
504
506
<T as AsRef < U > >:: as_ref ( * self )
@@ -515,9 +517,10 @@ where
515
517
516
518
// AsMut lifts over &mut
517
519
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
518
- impl < T : ?Sized , U : ?Sized > AsMut < U > for & mut T
520
+ #[ rustc_const_unstable( feature = "const_convert" , issue = "88674" ) ]
521
+ impl < T : ?Sized , U : ?Sized > const AsMut < U > for & mut T
519
522
where
520
- T : AsMut < U > ,
523
+ T : ~ const AsMut < U > ,
521
524
{
522
525
fn as_mut ( & mut self ) -> & mut U {
523
526
( * self ) . as_mut ( )
@@ -571,9 +574,10 @@ impl<T> const From<!> for T {
571
574
572
575
// TryFrom implies TryInto
573
576
#[ stable( feature = "try_from" , since = "1.34.0" ) ]
574
- impl < T , U > TryInto < U > for T
577
+ #[ rustc_const_unstable( feature = "const_convert" , issue = "88674" ) ]
578
+ impl < T , U > const TryInto < U > for T
575
579
where
576
- U : TryFrom < T > ,
580
+ U : ~ const TryFrom < T > ,
577
581
{
578
582
type Error = U :: Error ;
579
583
@@ -585,9 +589,10 @@ where
585
589
// Infallible conversions are semantically equivalent to fallible conversions
586
590
// with an uninhabited error type.
587
591
#[ stable( feature = "try_from" , since = "1.34.0" ) ]
588
- impl < T , U > TryFrom < U > for T
592
+ #[ rustc_const_unstable( feature = "const_convert" , issue = "88674" ) ]
593
+ impl < T , U > const TryFrom < U > for T
589
594
where
590
- U : Into < T > ,
595
+ U : ~ const Into < T > ,
591
596
{
592
597
type Error = Infallible ;
593
598
0 commit comments