Skip to content

Commit

Permalink
Rollup merge of rust-lang#66086 - RalfJung:smallvec, r=nagisa
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Centril committed Nov 6, 2019
2 parents 98cbe17 + 90b8d34 commit 167b8fe
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 47 deletions.
56 changes: 31 additions & 25 deletions Cargo.lock
Expand Up @@ -68,7 +68,7 @@ name = "arena"
version = "0.0.0"
dependencies = [
"rustc_data_structures",
"smallvec",
"smallvec 1.0.0",
]

[[package]]
Expand Down Expand Up @@ -487,7 +487,7 @@ dependencies = [
"regex-syntax",
"semver",
"serde",
"smallvec",
"smallvec 0.6.10",
"toml",
"unicode-normalization",
"url 2.1.0",
Expand Down Expand Up @@ -655,7 +655,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f0ed1a4de2235cabda8558ff5840bffb97fcb64c97827f354a451307df5f72b"
dependencies = [
"crossbeam-utils 0.6.5",
"smallvec",
"smallvec 0.6.10",
]

[[package]]
Expand Down Expand Up @@ -2392,7 +2392,7 @@ dependencies = [
"libc",
"rand 0.6.1",
"rustc_version",
"smallvec",
"smallvec 0.6.10",
"winapi 0.3.6",
]

Expand All @@ -2407,7 +2407,7 @@ dependencies = [
"libc",
"redox_syscall",
"rustc_version",
"smallvec",
"smallvec 0.6.10",
"winapi 0.3.6",
]

Expand Down Expand Up @@ -3135,7 +3135,7 @@ dependencies = [
"rustc_target",
"scoped-tls",
"serialize",
"smallvec",
"smallvec 1.0.0",
"syntax",
"syntax_pos",
]
Expand All @@ -3147,7 +3147,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a623fd4805842e9bd0bb6e6dace63efede0ee22de4522a0b03b7c3d15a22f009"
dependencies = [
"rustc-ap-rustc_data_structures",
"smallvec",
"smallvec 0.6.10",
]

[[package]]
Expand Down Expand Up @@ -3176,7 +3176,7 @@ dependencies = [
"rustc-hash",
"rustc-rayon 0.2.0",
"rustc-rayon-core 0.2.0",
"smallvec",
"smallvec 0.6.10",
"stable_deref_trait",
]

Expand Down Expand Up @@ -3204,7 +3204,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "457a5c204ae2fdaa5bdb5b196e58ca59896870d80445fe423063c9453496e3ea"
dependencies = [
"rustc-ap-serialize",
"smallvec",
"smallvec 0.6.10",
]

[[package]]
Expand Down Expand Up @@ -3250,7 +3250,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92679240e86f4583cc05f8dcf6439bdab87bac9e6555718469176de9bd52ba20"
dependencies = [
"indexmap",
"smallvec",
"smallvec 0.6.10",
]

[[package]]
Expand All @@ -3270,7 +3270,7 @@ dependencies = [
"rustc-ap-serialize",
"rustc-ap-syntax_pos",
"scoped-tls",
"smallvec",
"smallvec 0.6.10",
]

[[package]]
Expand Down Expand Up @@ -3393,7 +3393,7 @@ dependencies = [
"crossbeam-utils 0.6.5",
"serde",
"serde_json",
"smallvec",
"smallvec 0.6.10",
"syn 0.15.35",
"url 2.1.0",
"winapi 0.3.6",
Expand All @@ -3404,7 +3404,7 @@ name = "rustc_apfloat"
version = "0.0.0"
dependencies = [
"bitflags",
"smallvec",
"smallvec 1.0.0",
]

[[package]]
Expand Down Expand Up @@ -3484,7 +3484,7 @@ dependencies = [
"rustc-rayon-core 0.3.0",
"rustc_index",
"serialize",
"smallvec",
"smallvec 1.0.0",
"stable_deref_trait",
]

Expand Down Expand Up @@ -3552,7 +3552,7 @@ name = "rustc_index"
version = "0.0.0"
dependencies = [
"serialize",
"smallvec",
"smallvec 1.0.0",
]

[[package]]
Expand All @@ -3579,7 +3579,7 @@ dependencies = [
"rustc_traits",
"rustc_typeck",
"serialize",
"smallvec",
"smallvec 1.0.0",
"syntax",
"syntax_expand",
"syntax_ext",
Expand Down Expand Up @@ -3650,7 +3650,7 @@ dependencies = [
"rustc_index",
"rustc_target",
"serialize",
"smallvec",
"smallvec 1.0.0",
"stable_deref_trait",
"syntax",
"syntax_expand",
Expand All @@ -3675,7 +3675,7 @@ dependencies = [
"rustc_lexer",
"rustc_target",
"serialize",
"smallvec",
"smallvec 1.0.0",
"syntax",
"syntax_pos",
]
Expand Down Expand Up @@ -3746,7 +3746,7 @@ dependencies = [
"rustc_data_structures",
"rustc_errors",
"rustc_metadata",
"smallvec",
"smallvec 1.0.0",
"syntax",
"syntax_expand",
"syntax_pos",
Expand Down Expand Up @@ -3799,7 +3799,7 @@ dependencies = [
"rustc",
"rustc_data_structures",
"rustc_target",
"smallvec",
"smallvec 1.0.0",
"syntax",
"syntax_pos",
]
Expand All @@ -3826,7 +3826,7 @@ dependencies = [
"rustc_errors",
"rustc_index",
"rustc_target",
"smallvec",
"smallvec 1.0.0",
"syntax",
"syntax_pos",
]
Expand Down Expand Up @@ -4070,7 +4070,7 @@ name = "serialize"
version = "0.0.0"
dependencies = [
"indexmap",
"smallvec",
"smallvec 1.0.0",
]

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

[[package]]
name = "smallvec"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86"

[[package]]
name = "socket2"
version = "0.3.8"
Expand Down Expand Up @@ -4359,7 +4365,7 @@ dependencies = [
"rustc_target",
"scoped-tls",
"serialize",
"smallvec",
"smallvec 1.0.0",
"syntax_pos",
]

Expand All @@ -4377,7 +4383,7 @@ dependencies = [
"rustc_target",
"scoped-tls",
"serialize",
"smallvec",
"smallvec 1.0.0",
"syntax",
"syntax_pos",
]
Expand All @@ -4391,7 +4397,7 @@ dependencies = [
"rustc_data_structures",
"rustc_errors",
"rustc_target",
"smallvec",
"smallvec 1.0.0",
"syntax",
"syntax_expand",
"syntax_pos",
Expand Down
2 changes: 1 addition & 1 deletion src/libarena/Cargo.toml
Expand Up @@ -10,4 +10,4 @@ path = "lib.rs"

[dependencies]
rustc_data_structures = { path = "../librustc_data_structures" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2 changes: 1 addition & 1 deletion src/librustc/Cargo.toml
Expand Up @@ -39,5 +39,5 @@ parking_lot = "0.9"
byteorder = { version = "1.3" }
chalk-engine = { version = "0.9.0", default-features=false }
rustc_fs_util = { path = "../librustc_fs_util" }
smallvec = { version = "0.6.8", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
measureme = "0.4"
2 changes: 1 addition & 1 deletion src/librustc/arena.rs
Expand Up @@ -304,7 +304,7 @@ impl DropArena {
// Move the content to the arena by copying it and then forgetting
// the content of the SmallVec
vec.as_ptr().copy_to_nonoverlapping(start_ptr, len);
mem::forget(vec.drain());
mem::forget(vec.drain(..));

// Record the destructors after doing the allocation as that may panic
// and would cause `object`'s destuctor to run twice if it was recorded before
Expand Down
10 changes: 5 additions & 5 deletions src/librustc/ty/inhabitedness/def_id_forest.rs
Expand Up @@ -76,19 +76,19 @@ impl<'tcx> DefIdForest {
break;
}

for id in ret.root_ids.drain() {
for id in ret.root_ids.drain(..) {
if next_forest.contains(tcx, id) {
next_ret.push(id);
} else {
old_ret.push(id);
}
}
ret.root_ids.extend(old_ret.drain());
ret.root_ids.extend(old_ret.drain(..));

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

mem::swap(&mut next_ret, &mut ret.root_ids);
next_ret.drain();
next_ret.drain(..);
}
ret
}
Expand All @@ -101,7 +101,7 @@ impl<'tcx> DefIdForest {
let mut ret = DefIdForest::empty();
let mut next_ret = SmallVec::new();
for next_forest in iter {
next_ret.extend(ret.root_ids.drain().filter(|&id| !next_forest.contains(tcx, id)));
next_ret.extend(ret.root_ids.drain(..).filter(|&id| !next_forest.contains(tcx, id)));

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

mem::swap(&mut next_ret, &mut ret.root_ids);
next_ret.drain();
next_ret.drain(..);
}
ret
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_apfloat/Cargo.toml
Expand Up @@ -10,4 +10,4 @@ path = "lib.rs"

[dependencies]
bitflags = "1.2.1"
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2 changes: 1 addition & 1 deletion src/librustc_data_structures/Cargo.toml
Expand Up @@ -23,7 +23,7 @@ stable_deref_trait = "1.0.0"
rayon = { version = "0.3.0", package = "rustc-rayon" }
rayon-core = { version = "0.3.0", package = "rustc-rayon-core" }
rustc-hash = "1.0.1"
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
rustc_index = { path = "../librustc_index", package = "rustc_index" }

[dependencies.parking_lot]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_index/Cargo.toml
Expand Up @@ -11,4 +11,4 @@ doctest = false

[dependencies]
rustc_serialize = { path = "../libserialize", package = "serialize" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2 changes: 1 addition & 1 deletion src/librustc_interface/Cargo.toml
Expand Up @@ -12,7 +12,7 @@ doctest = false
[dependencies]
log = "0.4"
rayon = { version = "0.3.0", package = "rustc-rayon" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
syntax = { path = "../libsyntax" }
syntax_ext = { path = "../libsyntax_ext" }
syntax_expand = { path = "../libsyntax_expand" }
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/Cargo.toml
Expand Up @@ -13,7 +13,7 @@ doctest = false
flate2 = "1.0"
log = "0.4"
memmap = "0.6"
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
rustc = { path = "../librustc" }
rustc_data_structures = { path = "../librustc_data_structures" }
errors = { path = "../librustc_errors", package = "rustc_errors" }
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/Cargo.toml
Expand Up @@ -26,4 +26,4 @@ rustc_serialize = { path = "../libserialize", package = "serialize" }
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
rustc_apfloat = { path = "../librustc_apfloat" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2 changes: 1 addition & 1 deletion src/librustc_resolve/Cargo.toml
Expand Up @@ -21,4 +21,4 @@ errors = { path = "../librustc_errors", package = "rustc_errors" }
syntax_pos = { path = "../libsyntax_pos" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_metadata = { path = "../librustc_metadata" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2 changes: 1 addition & 1 deletion src/librustc_traits/Cargo.toml
Expand Up @@ -16,4 +16,4 @@ rustc_target = { path = "../librustc_target" }
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
chalk-engine = { version = "0.9.0", default-features=false }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2 changes: 1 addition & 1 deletion src/librustc_typeck/Cargo.toml
Expand Up @@ -17,7 +17,7 @@ rustc = { path = "../librustc" }
rustc_data_structures = { path = "../librustc_data_structures" }
errors = { path = "../librustc_errors", package = "rustc_errors" }
rustc_target = { path = "../librustc_target" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
syntax = { path = "../libsyntax" }
syntax_pos = { path = "../libsyntax_pos" }
rustc_index = { path = "../librustc_index" }
2 changes: 1 addition & 1 deletion src/libserialize/Cargo.toml
Expand Up @@ -10,4 +10,4 @@ path = "lib.rs"

[dependencies]
indexmap = "1"
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2 changes: 1 addition & 1 deletion src/libsyntax/Cargo.toml
Expand Up @@ -21,4 +21,4 @@ rustc_data_structures = { path = "../librustc_data_structures" }
rustc_index = { path = "../librustc_index" }
rustc_lexer = { path = "../librustc_lexer" }
rustc_target = { path = "../librustc_target" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2 changes: 1 addition & 1 deletion src/libsyntax/tokenstream.rs
Expand Up @@ -243,7 +243,7 @@ impl TokenStream {

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

// Append the elements to the first stream, after reserving
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax_expand/Cargo.toml
Expand Up @@ -22,5 +22,5 @@ rustc_data_structures = { path = "../librustc_data_structures" }
rustc_index = { path = "../librustc_index" }
rustc_lexer = { path = "../librustc_lexer" }
rustc_target = { path = "../librustc_target" }
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
syntax = { path = "../libsyntax" }

0 comments on commit 167b8fe

Please sign in to comment.