File tree 2 files changed +8
-1
lines changed 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -567,7 +567,7 @@ pub mod intrinsics {
567
567
pub fn copy < T > ( src : * const T , dst : * mut T , count : usize ) ;
568
568
pub fn transmute < T , U > ( e : T ) -> U ;
569
569
pub fn ctlz_nonzero < T > ( x : T ) -> T ;
570
- pub fn needs_drop < T > ( ) -> bool ;
570
+ pub fn needs_drop < T : ? :: Sized > ( ) -> bool ;
571
571
pub fn bitreverse < T > ( x : T ) -> T ;
572
572
pub fn bswap < T > ( x : T ) -> T ;
573
573
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 {
55
55
inner : NoisyDropInner ,
56
56
}
57
57
58
+ struct NoisyDropUnsized {
59
+ text : str ,
60
+ inner : NoisyDropInner ,
61
+ }
62
+
58
63
struct NoisyDropInner ;
59
64
60
65
impl Drop for NoisyDrop {
@@ -170,7 +175,9 @@ fn main() {
170
175
assert_eq ! ( intrinsics:: min_align_of_val( & a) as u8 , intrinsics:: min_align_of:: <& str >( ) as u8 ) ;
171
176
172
177
assert ! ( !intrinsics:: needs_drop:: <u8 >( ) ) ;
178
+ assert ! ( !intrinsics:: needs_drop:: <[ u8 ] >( ) ) ;
173
179
assert ! ( intrinsics:: needs_drop:: <NoisyDrop >( ) ) ;
180
+ assert ! ( intrinsics:: needs_drop:: <NoisyDropUnsized >( ) ) ;
174
181
175
182
Unique {
176
183
pointer : NonNull ( 1 as * mut & str ) ,
You can’t perform that action at this time.
0 commit comments