File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 36
36
37
37
#![ stable( feature = "rust1" , since = "1.0.0" ) ]
38
38
39
- use crate :: marker:: PointeeSized ;
39
+ use crate :: marker:: { Destruct , PointeeSized } ;
40
40
41
41
mod uninit;
42
42
@@ -157,6 +157,8 @@ mod uninit;
157
157
#[ lang = "clone" ]
158
158
#[ rustc_diagnostic_item = "Clone" ]
159
159
#[ rustc_trivial_field_reads]
160
+ #[ rustc_const_unstable( feature = "const_clone" , issue = "12345" ) ]
161
+ #[ const_trait]
160
162
pub trait Clone : Sized {
161
163
/// Returns a duplicate of the value.
162
164
///
@@ -208,7 +210,9 @@ pub trait Clone: Sized {
208
210
/// allocations.
209
211
#[ inline]
210
212
#[ 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 , {
212
216
* self = source. clone ( )
213
217
}
214
218
}
Original file line number Diff line number Diff line change 103
103
#![ feature( cfg_select) ]
104
104
#![ feature( cfg_target_has_reliable_f16_f128) ]
105
105
#![ feature( const_carrying_mul_add) ]
106
+ #![ feature( const_destruct) ]
106
107
#![ feature( const_eval_select) ]
107
108
#![ feature( core_intrinsics) ]
108
109
#![ feature( coverage_attribute) ]
You can’t perform that action at this time.
0 commit comments