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 {
514514 pub fn copy < T > ( src : * const T , dst : * mut T , count : usize ) ;
515515 pub fn transmute < T , U > ( e : T ) -> U ;
516516 pub fn ctlz_nonzero < T > ( x : T ) -> T ;
517- pub fn needs_drop < T > ( ) -> bool ;
517+ pub fn needs_drop < T : ? :: Sized > ( ) -> bool ;
518518 pub fn bitreverse < T > ( x : T ) -> T ;
519519 pub fn bswap < T > ( x : T ) -> T ;
520520 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 {
4747 inner : NoisyDropInner ,
4848}
4949
50+ struct NoisyDropUnsized {
51+ text : str ,
52+ inner : NoisyDropInner ,
53+ }
54+
5055struct NoisyDropInner ;
5156
5257impl Drop for NoisyDrop {
@@ -184,7 +189,9 @@ fn main() {
184189 assert_eq ! ( intrinsics:: min_align_of_val( & a) as u8 , intrinsics:: min_align_of:: <& str >( ) as u8 ) ;
185190
186191 assert ! ( !intrinsics:: needs_drop:: <u8 >( ) ) ;
192+ assert ! ( !intrinsics:: needs_drop:: <[ u8 ] >( ) ) ;
187193 assert ! ( intrinsics:: needs_drop:: <NoisyDrop >( ) ) ;
194+ assert ! ( intrinsics:: needs_drop:: <NoisyDropUnsized >( ) ) ;
188195
189196 Unique {
190197 pointer : 0 as * const & str ,
You can’t perform that action at this time.
0 commit comments