File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -514,7 +514,7 @@ pub mod intrinsics {
514
514
pub fn copy < T > ( src : * const T , dst : * mut T , count : usize ) ;
515
515
pub fn transmute < T , U > ( e : T ) -> U ;
516
516
pub fn ctlz_nonzero < T > ( x : T ) -> T ;
517
- pub fn needs_drop < T > ( ) -> bool ;
517
+ pub fn needs_drop < T : ? :: Sized > ( ) -> bool ;
518
518
pub fn bitreverse < T > ( x : T ) -> T ;
519
519
pub fn bswap < T > ( x : T ) -> T ;
520
520
pub fn write_bytes < T > ( dst : * mut T , val : u8 , count : usize ) ;
Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ struct NoisyDrop {
47
47
inner : NoisyDropInner ,
48
48
}
49
49
50
+ struct NoisyDropUnsized {
51
+ text : str ,
52
+ inner : NoisyDropInner ,
53
+ }
54
+
50
55
struct NoisyDropInner ;
51
56
52
57
impl Drop for NoisyDrop {
@@ -184,7 +189,9 @@ fn main() {
184
189
assert_eq ! ( intrinsics:: min_align_of_val( & a) as u8 , intrinsics:: min_align_of:: <& str >( ) as u8 ) ;
185
190
186
191
assert ! ( !intrinsics:: needs_drop:: <u8 >( ) ) ;
192
+ assert ! ( !intrinsics:: needs_drop:: <[ u8 ] >( ) ) ;
187
193
assert ! ( intrinsics:: needs_drop:: <NoisyDrop >( ) ) ;
194
+ assert ! ( intrinsics:: needs_drop:: <NoisyDropUnsized >( ) ) ;
188
195
189
196
Unique {
190
197
pointer : 0 as * const & str ,
You can’t perform that action at this time.
0 commit comments