File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 9
9
// except according to those terms.
10
10
#![ feature( attr_literals) ]
11
11
#![ feature( repr_align) ]
12
+ #![ feature( box_syntax) ]
12
13
13
14
use std:: mem;
14
15
@@ -201,13 +202,14 @@ pub fn main() {
201
202
assert_eq ! ( mem:: size_of_val( & a) , 16 ) ;
202
203
assert ! ( is_aligned_to( & a, 16 ) ) ;
203
204
204
- let mut arr = [ 0 ; 0x10000 ] ;
205
- arr[ 0 ] = 132 ;
206
- let large = AlignLarge {
207
- stuff : arr,
205
+ let mut large = box AlignLarge {
206
+ stuff : [ 0 ; 0x10000 ] ,
208
207
} ;
208
+ large. stuff [ 0 ] = 132 ;
209
+ * large. stuff . last_mut ( ) . unwrap ( ) = 102 ;
209
210
assert_eq ! ( large. stuff[ 0 ] , 132 ) ;
211
+ assert_eq ! ( large. stuff. last( ) , Some ( & 102 ) ) ;
210
212
assert_eq ! ( mem:: align_of:: <AlignLarge >( ) , 0x10000 ) ;
211
- assert_eq ! ( mem:: align_of_val( & large) , 0x10000 ) ;
212
- assert ! ( is_aligned_to( & large, 0x10000 ) ) ;
213
+ assert_eq ! ( mem:: align_of_val( & * large) , 0x10000 ) ;
214
+ assert ! ( is_aligned_to( & * large, 0x10000 ) ) ;
213
215
}
You can’t perform that action at this time.
0 commit comments