Skip to content

Commit 167b8fe

Browse files
authored
Rollup merge of rust-lang#66086 - RalfJung:smallvec, r=nagisa
bump smallvec to 1.0 This includes servo/rust-smallvec#162, fixing an unsoundness in smallvec. See servo/rust-smallvec#175 for the 1.0 release announcement. Cc @mbrubeck @emilio
2 parents 98cbe17 + 90b8d34 commit 167b8fe

File tree

19 files changed

+53
-47
lines changed

19 files changed

+53
-47
lines changed

Cargo.lock

+31-25
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ name = "arena"
6868
version = "0.0.0"
6969
dependencies = [
7070
"rustc_data_structures",
71-
"smallvec",
71+
"smallvec 1.0.0",
7272
]
7373

7474
[[package]]
@@ -487,7 +487,7 @@ dependencies = [
487487
"regex-syntax",
488488
"semver",
489489
"serde",
490-
"smallvec",
490+
"smallvec 0.6.10",
491491
"toml",
492492
"unicode-normalization",
493493
"url 2.1.0",
@@ -655,7 +655,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
655655
checksum = "0f0ed1a4de2235cabda8558ff5840bffb97fcb64c97827f354a451307df5f72b"
656656
dependencies = [
657657
"crossbeam-utils 0.6.5",
658-
"smallvec",
658+
"smallvec 0.6.10",
659659
]
660660

661661
[[package]]
@@ -2392,7 +2392,7 @@ dependencies = [
23922392
"libc",
23932393
"rand 0.6.1",
23942394
"rustc_version",
2395-
"smallvec",
2395+
"smallvec 0.6.10",
23962396
"winapi 0.3.6",
23972397
]
23982398

@@ -2407,7 +2407,7 @@ dependencies = [
24072407
"libc",
24082408
"redox_syscall",
24092409
"rustc_version",
2410-
"smallvec",
2410+
"smallvec 0.6.10",
24112411
"winapi 0.3.6",
24122412
]
24132413

@@ -3135,7 +3135,7 @@ dependencies = [
31353135
"rustc_target",
31363136
"scoped-tls",
31373137
"serialize",
3138-
"smallvec",
3138+
"smallvec 1.0.0",
31393139
"syntax",
31403140
"syntax_pos",
31413141
]
@@ -3147,7 +3147,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
31473147
checksum = "a623fd4805842e9bd0bb6e6dace63efede0ee22de4522a0b03b7c3d15a22f009"
31483148
dependencies = [
31493149
"rustc-ap-rustc_data_structures",
3150-
"smallvec",
3150+
"smallvec 0.6.10",
31513151
]
31523152

31533153
[[package]]
@@ -3176,7 +3176,7 @@ dependencies = [
31763176
"rustc-hash",
31773177
"rustc-rayon 0.2.0",
31783178
"rustc-rayon-core 0.2.0",
3179-
"smallvec",
3179+
"smallvec 0.6.10",
31803180
"stable_deref_trait",
31813181
]
31823182

@@ -3204,7 +3204,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
32043204
checksum = "457a5c204ae2fdaa5bdb5b196e58ca59896870d80445fe423063c9453496e3ea"
32053205
dependencies = [
32063206
"rustc-ap-serialize",
3207-
"smallvec",
3207+
"smallvec 0.6.10",
32083208
]
32093209

32103210
[[package]]
@@ -3250,7 +3250,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
32503250
checksum = "92679240e86f4583cc05f8dcf6439bdab87bac9e6555718469176de9bd52ba20"
32513251
dependencies = [
32523252
"indexmap",
3253-
"smallvec",
3253+
"smallvec 0.6.10",
32543254
]
32553255

32563256
[[package]]
@@ -3270,7 +3270,7 @@ dependencies = [
32703270
"rustc-ap-serialize",
32713271
"rustc-ap-syntax_pos",
32723272
"scoped-tls",
3273-
"smallvec",
3273+
"smallvec 0.6.10",
32743274
]
32753275

32763276
[[package]]
@@ -3393,7 +3393,7 @@ dependencies = [
33933393
"crossbeam-utils 0.6.5",
33943394
"serde",
33953395
"serde_json",
3396-
"smallvec",
3396+
"smallvec 0.6.10",
33973397
"syn 0.15.35",
33983398
"url 2.1.0",
33993399
"winapi 0.3.6",
@@ -3404,7 +3404,7 @@ name = "rustc_apfloat"
34043404
version = "0.0.0"
34053405
dependencies = [
34063406
"bitflags",
3407-
"smallvec",
3407+
"smallvec 1.0.0",
34083408
]
34093409

34103410
[[package]]
@@ -3484,7 +3484,7 @@ dependencies = [
34843484
"rustc-rayon-core 0.3.0",
34853485
"rustc_index",
34863486
"serialize",
3487-
"smallvec",
3487+
"smallvec 1.0.0",
34883488
"stable_deref_trait",
34893489
]
34903490

@@ -3552,7 +3552,7 @@ name = "rustc_index"
35523552
version = "0.0.0"
35533553
dependencies = [
35543554
"serialize",
3555-
"smallvec",
3555+
"smallvec 1.0.0",
35563556
]
35573557

35583558
[[package]]
@@ -3579,7 +3579,7 @@ dependencies = [
35793579
"rustc_traits",
35803580
"rustc_typeck",
35813581
"serialize",
3582-
"smallvec",
3582+
"smallvec 1.0.0",
35833583
"syntax",
35843584
"syntax_expand",
35853585
"syntax_ext",
@@ -3650,7 +3650,7 @@ dependencies = [
36503650
"rustc_index",
36513651
"rustc_target",
36523652
"serialize",
3653-
"smallvec",
3653+
"smallvec 1.0.0",
36543654
"stable_deref_trait",
36553655
"syntax",
36563656
"syntax_expand",
@@ -3675,7 +3675,7 @@ dependencies = [
36753675
"rustc_lexer",
36763676
"rustc_target",
36773677
"serialize",
3678-
"smallvec",
3678+
"smallvec 1.0.0",
36793679
"syntax",
36803680
"syntax_pos",
36813681
]
@@ -3746,7 +3746,7 @@ dependencies = [
37463746
"rustc_data_structures",
37473747
"rustc_errors",
37483748
"rustc_metadata",
3749-
"smallvec",
3749+
"smallvec 1.0.0",
37503750
"syntax",
37513751
"syntax_expand",
37523752
"syntax_pos",
@@ -3799,7 +3799,7 @@ dependencies = [
37993799
"rustc",
38003800
"rustc_data_structures",
38013801
"rustc_target",
3802-
"smallvec",
3802+
"smallvec 1.0.0",
38033803
"syntax",
38043804
"syntax_pos",
38053805
]
@@ -3826,7 +3826,7 @@ dependencies = [
38263826
"rustc_errors",
38273827
"rustc_index",
38283828
"rustc_target",
3829-
"smallvec",
3829+
"smallvec 1.0.0",
38303830
"syntax",
38313831
"syntax_pos",
38323832
]
@@ -4070,7 +4070,7 @@ name = "serialize"
40704070
version = "0.0.0"
40714071
dependencies = [
40724072
"indexmap",
4073-
"smallvec",
4073+
"smallvec 1.0.0",
40744074
]
40754075

40764076
[[package]]
@@ -4134,6 +4134,12 @@ version = "0.6.10"
41344134
source = "registry+https://github.com/rust-lang/crates.io-index"
41354135
checksum = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7"
41364136

4137+
[[package]]
4138+
name = "smallvec"
4139+
version = "1.0.0"
4140+
source = "registry+https://github.com/rust-lang/crates.io-index"
4141+
checksum = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86"
4142+
41374143
[[package]]
41384144
name = "socket2"
41394145
version = "0.3.8"
@@ -4359,7 +4365,7 @@ dependencies = [
43594365
"rustc_target",
43604366
"scoped-tls",
43614367
"serialize",
4362-
"smallvec",
4368+
"smallvec 1.0.0",
43634369
"syntax_pos",
43644370
]
43654371

@@ -4377,7 +4383,7 @@ dependencies = [
43774383
"rustc_target",
43784384
"scoped-tls",
43794385
"serialize",
4380-
"smallvec",
4386+
"smallvec 1.0.0",
43814387
"syntax",
43824388
"syntax_pos",
43834389
]
@@ -4391,7 +4397,7 @@ dependencies = [
43914397
"rustc_data_structures",
43924398
"rustc_errors",
43934399
"rustc_target",
4394-
"smallvec",
4400+
"smallvec 1.0.0",
43954401
"syntax",
43964402
"syntax_expand",
43974403
"syntax_pos",

src/libarena/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ path = "lib.rs"
1010

1111
[dependencies]
1212
rustc_data_structures = { path = "../librustc_data_structures" }
13-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
13+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

src/librustc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ parking_lot = "0.9"
3939
byteorder = { version = "1.3" }
4040
chalk-engine = { version = "0.9.0", default-features=false }
4141
rustc_fs_util = { path = "../librustc_fs_util" }
42-
smallvec = { version = "0.6.8", features = ["union", "may_dangle"] }
42+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
4343
measureme = "0.4"

src/librustc/arena.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl DropArena {
304304
// Move the content to the arena by copying it and then forgetting
305305
// the content of the SmallVec
306306
vec.as_ptr().copy_to_nonoverlapping(start_ptr, len);
307-
mem::forget(vec.drain());
307+
mem::forget(vec.drain(..));
308308

309309
// Record the destructors after doing the allocation as that may panic
310310
// and would cause `object`'s destuctor to run twice if it was recorded before

src/librustc/ty/inhabitedness/def_id_forest.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,19 @@ impl<'tcx> DefIdForest {
7676
break;
7777
}
7878

79-
for id in ret.root_ids.drain() {
79+
for id in ret.root_ids.drain(..) {
8080
if next_forest.contains(tcx, id) {
8181
next_ret.push(id);
8282
} else {
8383
old_ret.push(id);
8484
}
8585
}
86-
ret.root_ids.extend(old_ret.drain());
86+
ret.root_ids.extend(old_ret.drain(..));
8787

8888
next_ret.extend(next_forest.root_ids.into_iter().filter(|&id| ret.contains(tcx, id)));
8989

9090
mem::swap(&mut next_ret, &mut ret.root_ids);
91-
next_ret.drain();
91+
next_ret.drain(..);
9292
}
9393
ret
9494
}
@@ -101,7 +101,7 @@ impl<'tcx> DefIdForest {
101101
let mut ret = DefIdForest::empty();
102102
let mut next_ret = SmallVec::new();
103103
for next_forest in iter {
104-
next_ret.extend(ret.root_ids.drain().filter(|&id| !next_forest.contains(tcx, id)));
104+
next_ret.extend(ret.root_ids.drain(..).filter(|&id| !next_forest.contains(tcx, id)));
105105

106106
for id in next_forest.root_ids {
107107
if !next_ret.contains(&id) {
@@ -110,7 +110,7 @@ impl<'tcx> DefIdForest {
110110
}
111111

112112
mem::swap(&mut next_ret, &mut ret.root_ids);
113-
next_ret.drain();
113+
next_ret.drain(..);
114114
}
115115
ret
116116
}

src/librustc_apfloat/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ path = "lib.rs"
1010

1111
[dependencies]
1212
bitflags = "1.2.1"
13-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
13+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

src/librustc_data_structures/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ stable_deref_trait = "1.0.0"
2323
rayon = { version = "0.3.0", package = "rustc-rayon" }
2424
rayon-core = { version = "0.3.0", package = "rustc-rayon-core" }
2525
rustc-hash = "1.0.1"
26-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
26+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2727
rustc_index = { path = "../librustc_index", package = "rustc_index" }
2828

2929
[dependencies.parking_lot]

src/librustc_index/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ doctest = false
1111

1212
[dependencies]
1313
rustc_serialize = { path = "../libserialize", package = "serialize" }
14-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
14+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

src/librustc_interface/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ doctest = false
1212
[dependencies]
1313
log = "0.4"
1414
rayon = { version = "0.3.0", package = "rustc-rayon" }
15-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
15+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
1616
syntax = { path = "../libsyntax" }
1717
syntax_ext = { path = "../libsyntax_ext" }
1818
syntax_expand = { path = "../libsyntax_expand" }

src/librustc_metadata/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ doctest = false
1313
flate2 = "1.0"
1414
log = "0.4"
1515
memmap = "0.6"
16-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
16+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
1717
rustc = { path = "../librustc" }
1818
rustc_data_structures = { path = "../librustc_data_structures" }
1919
errors = { path = "../librustc_errors", package = "rustc_errors" }

src/librustc_mir/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ rustc_serialize = { path = "../libserialize", package = "serialize" }
2626
syntax = { path = "../libsyntax" }
2727
syntax_pos = { path = "../libsyntax_pos" }
2828
rustc_apfloat = { path = "../librustc_apfloat" }
29-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
29+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

src/librustc_resolve/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ errors = { path = "../librustc_errors", package = "rustc_errors" }
2121
syntax_pos = { path = "../libsyntax_pos" }
2222
rustc_data_structures = { path = "../librustc_data_structures" }
2323
rustc_metadata = { path = "../librustc_metadata" }
24-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
24+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

src/librustc_traits/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ rustc_target = { path = "../librustc_target" }
1616
syntax = { path = "../libsyntax" }
1717
syntax_pos = { path = "../libsyntax_pos" }
1818
chalk-engine = { version = "0.9.0", default-features=false }
19-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
19+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

src/librustc_typeck/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rustc = { path = "../librustc" }
1717
rustc_data_structures = { path = "../librustc_data_structures" }
1818
errors = { path = "../librustc_errors", package = "rustc_errors" }
1919
rustc_target = { path = "../librustc_target" }
20-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
20+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2121
syntax = { path = "../libsyntax" }
2222
syntax_pos = { path = "../libsyntax_pos" }
2323
rustc_index = { path = "../librustc_index" }

src/libserialize/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ path = "lib.rs"
1010

1111
[dependencies]
1212
indexmap = "1"
13-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
13+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

src/libsyntax/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ rustc_data_structures = { path = "../librustc_data_structures" }
2121
rustc_index = { path = "../librustc_index" }
2222
rustc_lexer = { path = "../librustc_lexer" }
2323
rustc_target = { path = "../librustc_target" }
24-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
24+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

src/libsyntax/tokenstream.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ impl TokenStream {
243243

244244
// Get the first stream. If it's `None`, create an empty
245245
// stream.
246-
let mut iter = streams.drain();
246+
let mut iter = streams.drain(..);
247247
let mut first_stream_lrc = iter.next().unwrap().0;
248248

249249
// Append the elements to the first stream, after reserving

src/libsyntax_expand/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ rustc_data_structures = { path = "../librustc_data_structures" }
2222
rustc_index = { path = "../librustc_index" }
2323
rustc_lexer = { path = "../librustc_lexer" }
2424
rustc_target = { path = "../librustc_target" }
25-
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
25+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2626
syntax = { path = "../libsyntax" }

0 commit comments

Comments
 (0)