diff options
| author | bors <bors@rust-lang.org> | 2019-01-14 23:00:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-01-14 23:00:50 +0000 |
| commit | aea9f0aa976db2f5de28be3b6b287c6889cd926b (patch) | |
| tree | 1f45e79c5694619f8b0ea8a4652abce5a2c49a52 /src/liballoc/vec.rs | |
| parent | 03acbd71c977cd63ce5f39ba9b6fe9ffd578785a (diff) | |
| parent | 8a62e393b8fba95e989020f2efbf846ca02113f9 (diff) | |
| download | rust-aea9f0aa976db2f5de28be3b6b287c6889cd926b.tar.gz rust-aea9f0aa976db2f5de28be3b6b287c6889cd926b.zip | |
Auto merge of #57607 - Centril:rollup, r=Centril
Rollup of 8 pull requests Successful merges: - #57043 (Fix poor worst case performance of set intersection) - #57480 (Clean up and fix a bug in query plumbing) - #57481 (provide suggestion for invalid boolean cast) - #57540 (Modify some parser diagnostics to continue evaluating beyond the parser) - #57570 (Querify local `plugin_registrar_fn` and `proc_macro_decls_static`) - #57572 (Unaccept `extern_in_paths`) - #57585 (Recover from item trailing semicolon) - #57589 (Add a debug_assert to Vec::set_len) Failed merges: r? @ghost
Diffstat (limited to 'src/liballoc/vec.rs')
| -rw-r--r-- | src/liballoc/vec.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index e1c5ab15bb5..ba3b3dfbfc2 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -819,6 +819,8 @@ impl<T> Vec<T> { #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub unsafe fn set_len(&mut self, new_len: usize) { + debug_assert!(new_len <= self.capacity()); + self.len = new_len; } |
