]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/uninit_vec.rs
Move MSRV tests into the lint specific test files
[rust.git] / tests / ui / uninit_vec.rs
index dc150cf28f2cce48b79d9df965539d5482cc445f..194e4fc157ef1d80bc76206b2b7a0d2ab4995212 100644 (file)
@@ -91,4 +91,10 @@ fn main() {
         vec1.set_len(200);
         vec2.set_len(200);
     }
+
+    // set_len(0) should not be detected
+    let mut vec: Vec<u8> = Vec::with_capacity(1000);
+    unsafe {
+        vec.set_len(0);
+    }
 }