File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
- // compile-flags: -Zmiri-tag-raw-pointers
1
+ // compile-flags: -Zmiri-tag-raw-pointers -Zmiri-check-number-validity
2
2
// Gather all references from a mutable iterator and make sure Miri notices if
3
3
// using them is dangerous.
4
4
fn test_all_refs < ' a , T : ' a > ( dummy : & mut T , iter : impl Iterator < Item = & ' a mut T > ) {
@@ -148,6 +148,16 @@ fn swap_remove() {
148
148
vec. swap_remove ( 1 ) ;
149
149
}
150
150
151
+ fn reverse ( ) {
152
+ #[ repr( align( 2 ) ) ]
153
+ #[ derive( Debug ) ]
154
+ struct Foo ( u8 ) ;
155
+
156
+ let mut v: Vec < _ > = ( 0 ..50 ) . map ( Foo ) . collect ( ) ;
157
+ v. reverse ( ) ;
158
+ assert ! ( v[ 0 ] . 0 == 49 ) ;
159
+ }
160
+
151
161
fn main ( ) {
152
162
assert_eq ! ( vec_reallocate( ) . len( ) , 5 ) ;
153
163
@@ -176,4 +186,5 @@ fn main() {
176
186
sort ( ) ;
177
187
swap ( ) ;
178
188
swap_remove ( ) ;
189
+ reverse ( ) ;
179
190
}
You can’t perform that action at this time.
0 commit comments