We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d46b648 + 951ac65 commit 346f8f2Copy full SHA for 346f8f2
tests/run-pass/vec.rs
@@ -1,4 +1,4 @@
1
-// compile-flags: -Zmiri-tag-raw-pointers
+// compile-flags: -Zmiri-tag-raw-pointers -Zmiri-check-number-validity
2
// Gather all references from a mutable iterator and make sure Miri notices if
3
// using them is dangerous.
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
vec.swap_remove(1);
149
}
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
161
fn main() {
162
assert_eq!(vec_reallocate().len(), 5);
163
@@ -176,4 +186,5 @@ fn main() {
176
186
sort();
177
187
swap();
178
188
swap_remove();
189
+ reverse();
179
190
0 commit comments