File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 3636
3737#![ stable( feature = "rust1" , since = "1.0.0" ) ]
3838
39- use crate :: marker:: PointeeSized ;
39+ use crate :: marker:: { Destruct , PointeeSized } ;
4040
4141mod uninit;
4242
@@ -157,6 +157,8 @@ mod uninit;
157157#[ lang = "clone" ]
158158#[ rustc_diagnostic_item = "Clone" ]
159159#[ rustc_trivial_field_reads]
160+ #[ rustc_const_unstable( feature = "const_clone" , issue = "142757" ) ]
161+ #[ const_trait]
160162pub trait Clone : Sized {
161163 /// Returns a duplicate of the value.
162164 ///
@@ -208,7 +210,10 @@ pub trait Clone: Sized {
208210 /// allocations.
209211 #[ inline]
210212 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
211- fn clone_from ( & mut self , source : & Self ) {
213+ fn clone_from ( & mut self , source : & Self )
214+ where
215+ Self : ~const Destruct ,
216+ {
212217 * self = source. clone ( )
213218 }
214219}
Original file line number Diff line number Diff line change 103103#![ feature( cfg_select) ]
104104#![ feature( cfg_target_has_reliable_f16_f128) ]
105105#![ feature( const_carrying_mul_add) ]
106+ #![ feature( const_destruct) ]
106107#![ feature( const_eval_select) ]
107108#![ feature( core_intrinsics) ]
108109#![ feature( coverage_attribute) ]
You can’t perform that action at this time.
0 commit comments