File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
branches/snap-stage3/src/libcore Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 242ed0b7c0f6a21096f2cc3e1ad1bdb176d02545
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 5bc35b1852ea3b7871befeeeec7531107e147278
4
+ refs/heads/snap-stage3: 5733726508bbfddebf1024e41b2d34439d548bdb
5
5
refs/heads/try: 961e0358e1a5c0faaef606e31e9965742c1643bf
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
Original file line number Diff line number Diff line change @@ -173,12 +173,15 @@ pub unsafe fn zeroed<T>() -> T {
173
173
#[ inline]
174
174
#[ unstable( feature = "filling_drop" ) ]
175
175
pub unsafe fn dropped < T > ( ) -> T {
176
- let mut x: T = uninitialized ( ) ;
177
- let p: * mut u8 = transmute ( & mut x as * mut T ) ;
178
- for i in 0 ..size_of :: < T > ( ) {
179
- * p. offset ( i as isize ) = POST_DROP_U8 ;
180
- }
181
- x
176
+ #[ cfg( stage0) ]
177
+ #[ inline( always) ]
178
+ unsafe fn dropped_impl < T > ( ) -> T { zeroed ( ) }
179
+
180
+ #[ cfg( not( stage0) ) ]
181
+ #[ inline( always) ]
182
+ unsafe fn dropped_impl < T > ( ) -> T { intrinsics:: init_dropped ( ) }
183
+
184
+ dropped_impl ( )
182
185
}
183
186
184
187
/// Create an uninitialized value.
You can’t perform that action at this time.
0 commit comments