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 @@ -567,7 +567,7 @@ pub mod intrinsics {
567567 pub fn copy < T > ( src : * const T , dst : * mut T , count : usize ) ;
568568 pub fn transmute < T , U > ( e : T ) -> U ;
569569 pub fn ctlz_nonzero < T > ( x : T ) -> T ;
570- pub fn needs_drop < T > ( ) -> bool ;
570+ pub fn needs_drop < T : ? :: Sized > ( ) -> bool ;
571571 pub fn bitreverse < T > ( x : T ) -> T ;
572572 pub fn bswap < T > ( x : T ) -> T ;
573573 pub fn write_bytes < T > ( dst : * mut T , val : u8 , count : usize ) ;
Original file line number Diff line number Diff line change @@ -55,6 +55,11 @@ struct NoisyDrop {
5555 inner : NoisyDropInner ,
5656}
5757
58+ struct NoisyDropUnsized {
59+ text : str ,
60+ inner : NoisyDropInner ,
61+ }
62+
5863struct NoisyDropInner ;
5964
6065impl Drop for NoisyDrop {
@@ -170,7 +175,9 @@ fn main() {
170175 assert_eq ! ( intrinsics:: min_align_of_val( & a) as u8 , intrinsics:: min_align_of:: <& str >( ) as u8 ) ;
171176
172177 assert ! ( !intrinsics:: needs_drop:: <u8 >( ) ) ;
178+ assert ! ( !intrinsics:: needs_drop:: <[ u8 ] >( ) ) ;
173179 assert ! ( intrinsics:: needs_drop:: <NoisyDrop >( ) ) ;
180+ assert ! ( intrinsics:: needs_drop:: <NoisyDropUnsized >( ) ) ;
174181
175182 Unique {
176183 pointer : NonNull ( 1 as * mut & str ) ,
You can’t perform that action at this time.
0 commit comments