Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 11 pull requests #76394

Closed
wants to merge 25 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
81e85ce
Move to Arc::clone(&x) over x.clone() in library/std
poliorcetics Aug 30, 2020
6b75e3d
Move to Arc::clone(&x) over x.clone() in library/core
poliorcetics Aug 30, 2020
8142457
Update tracking issue for const_caller_location
ArekPiekarz Aug 31, 2020
8783c62
Add missing link in README
camelid Sep 2, 2020
3e29fdb
Remove a number of vec UI tests, make them unit tests in the alloc li…
CraftSpider Sep 3, 2020
791f93c
Allow try blocks as the argument to return expressions
scottmcm Sep 3, 2020
2278c72
Remove vec-to_str.rs, merge the remaining test in with vec
CraftSpider Sep 3, 2020
2bc4c03
Disable use of `--eh-frame-hdr` on wasm32.
sunfishcode Sep 4, 2020
a2fbf39
Fix rust.use-lld when linker is not set
mati865 Sep 4, 2020
9e7ef65
Account for version number in NtIdent hack
Aaron1011 Sep 4, 2020
578e714
Fix dropck issue of SyncOnceCell.
m-ou-se Sep 5, 2020
e56ea68
Add compile_fail test for SyncOnceCell's dropck issue.
m-ou-se Sep 5, 2020
8af85fa
Improve the documentation of `filter()` and `filter_map()`.
vext01 Aug 26, 2020
39a3517
Update llvm-project to include PR 73
richkadel Sep 4, 2020
bdb8d48
Rollup merge of #75949 - vext01:filter-docs, r=jyn514
Dylan-DPC Sep 5, 2020
54cf3aa
Rollup merge of #76128 - poliorcetics:doc-use-arc-clone, r=KodrAus
Dylan-DPC Sep 5, 2020
8ea2087
Rollup merge of #76157 - ArekPiekarz:const_caller_location_tracking_i…
Dylan-DPC Sep 5, 2020
91df663
Rollup merge of #76229 - camelid:patch-3, r=jonas-schievink
Dylan-DPC Sep 5, 2020
a8a0689
Rollup merge of #76273 - CraftSpider:master, r=matklad
Dylan-DPC Sep 5, 2020
41eb03b
Rollup merge of #76274 - scottmcm:fix-76271, r=petrochenkov
Dylan-DPC Sep 5, 2020
9310922
Rollup merge of #76307 - sunfishcode:wasm-no-eh-frame-header, r=alexc…
Dylan-DPC Sep 5, 2020
18b785e
Rollup merge of #76326 - mati865:use_lld-no-linker, r=Mark-Simulacrum
Dylan-DPC Sep 5, 2020
c9eb60f
Rollup merge of #76331 - Aaron1011:fix/group-compat-hack-test, r=petr…
Dylan-DPC Sep 5, 2020
c20add7
Rollup merge of #76341 - richkadel:ignore-gcc-destructor-priority, r=…
Dylan-DPC Sep 5, 2020
5910882
Rollup merge of #76370 - fusion-engineering-forks:synconcecell-soundn…
Dylan-DPC Sep 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove a number of vec UI tests, make them unit tests in the alloc li…
…brary
CraftSpider committed Sep 3, 2020

Verified

This commit was signed with the committer’s verified signature.
CraftSpider Rune Tynan
commit 3e29fdb0fb3be5a35d3e2d55d902be8b4ecbe7bb
53 changes: 53 additions & 0 deletions library/alloc/tests/vec.rs
Original file line number Diff line number Diff line change
@@ -72,6 +72,39 @@ fn test_zst_capacity() {
assert_eq!(Vec::<()>::new().capacity(), usize::MAX);
}

#[test]
fn test_indexing() {
let v: Vec<isize> = vec![10, 20];
assert_eq!(v[0], 10);
assert_eq!(v[1], 20);
let mut x: usize = 0;
assert_eq!(v[x], 10);
assert_eq!(v[x + 1], 20);
x = x + 1;
assert_eq!(v[x], 20);
assert_eq!(v[x - 1], 10);
}

#[test]
fn test_debug_fmt() {
let vec1: Vec<isize> = vec![];
assert_eq!("[]", format!("{:?}", vec1));

let vec2 = vec![0, 1];
assert_eq!("[0, 1]", format!("{:?}", vec2));
}

#[test]
fn test_push() {
let mut v = vec![];
v.push(1);
assert_eq!(v, [1]);
v.push(2);
assert_eq!(v, [1, 2]);
v.push(3);
assert_eq!(v, [1, 2, 3]);
}

#[test]
fn test_extend() {
let mut v = Vec::new();
@@ -117,6 +150,18 @@ fn test_extend() {
assert_eq!(count_x, 1);
}

#[test]
fn test_extend_from_slice() {
let a: Vec<isize> = vec![1, 2, 3, 4, 5];
let b: Vec<isize> = vec![6, 7, 8, 9, 0];

let mut v: Vec<isize> = a;

v.extend_from_slice(&b);

assert_eq!(v, [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]);
}

#[test]
fn test_extend_ref() {
let mut v = vec![1, 2];
@@ -132,6 +177,14 @@ fn test_extend_ref() {
assert_eq!(v, [1, 2, 3, 4, 5, 6, 7]);
}

#[test]
fn test_slice_from_ref() {
let values = vec![1, 2, 3, 4, 5];
let slice = &values[1..3];

assert_eq!(slice, [2, 3]);
}

#[test]
fn test_slice_from_mut() {
let mut values = vec![1, 2, 3, 4, 5];
14 changes: 0 additions & 14 deletions src/test/ui/array-slice-vec/vec-concat.rs

This file was deleted.

16 changes: 0 additions & 16 deletions src/test/ui/array-slice-vec/vec-growth.rs

This file was deleted.

3 changes: 0 additions & 3 deletions src/test/ui/array-slice-vec/vec-push.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/ui/array-slice-vec/vec-slice.rs

This file was deleted.

5 changes: 0 additions & 5 deletions src/test/ui/array-slice-vec/vec-to_str.rs
Original file line number Diff line number Diff line change
@@ -2,11 +2,6 @@


pub fn main() {
assert_eq!(format!("{:?}", vec![0, 1]), "[0, 1]".to_string());

let foo = vec![3, 4];
let bar: &[isize] = &[4, 5];

assert_eq!(format!("{:?}", foo), "[3, 4]");
assert_eq!(format!("{:?}", bar), "[4, 5]");
}
15 changes: 0 additions & 15 deletions src/test/ui/array-slice-vec/vec.rs

This file was deleted.