summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/uninit_vec.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/uninit_vec.rs')
-rw-r--r--src/tools/clippy/tests/ui/uninit_vec.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/uninit_vec.rs b/src/tools/clippy/tests/ui/uninit_vec.rs
index dc150cf28..194e4fc15 100644
--- a/src/tools/clippy/tests/ui/uninit_vec.rs
+++ b/src/tools/clippy/tests/ui/uninit_vec.rs
@@ -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);
+ }
}