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 6 pull requests #67142

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d84eb50
Fix TypedArena.
cjgillot Dec 3, 2019
d358b24
Update tokio crates to latest versions
mati865 Dec 4, 2019
479cc7a
update to polonius 0.11 to compute subset errors
lqd Nov 18, 2019
4b16ae1
Add a way to list the base non-transitive edges in `TransitiveRelation`
lqd Nov 19, 2019
4dd6292
UniversalRegionRelations: add a way to list the base non-transitive `…
lqd Nov 19, 2019
7a3dca6
Polonius: emit `placeholder` and `known_subset` facts, as inputs to t…
lqd Nov 19, 2019
02a6662
Implement subset errors using Polonius
lqd Nov 20, 2019
67b04d5
bless polonius output of test hrtb-perfect-forwarding.rs
lqd Dec 2, 2019
6956408
bless polonius output of test ui/nll/outlives-suggestion-simple.rs
lqd Dec 2, 2019
720716f
bless polonius output due to lacking the 'static special-casing
lqd Dec 2, 2019
e2230a4
appease the vociferous tidy
lqd Dec 2, 2019
1314ba3
add subset relations test using polonius
lqd Dec 3, 2019
0f306a7
Do not ICE on async fn with non-Copy infered type arg
estebank Dec 3, 2019
7ed9066
review comments
estebank Dec 5, 2019
3f1e391
Exclude manually arranged ascii tables from rustfmt
dtolnay Nov 30, 2019
24d7f72
Suppress libcore/ptr/mod.rs filelength lint
dtolnay Nov 30, 2019
c737169
Format libcore with rustfmt (including tests and benches)
dtolnay Dec 7, 2019
2b2b16c
Simplify `Layout::extend_packed`
kraai Dec 6, 2019
f038de2
Rollup merge of #66892 - dtolnay:fmt5, r=KodrAus
Centril Dec 8, 2019
9384dd7
Rollup merge of #67003 - cjgillot:corrida, r=Mark-Simulacrum
Centril Dec 8, 2019
3fd39b9
Rollup merge of #67004 - estebank:issue-66958, r=eddyb
Centril Dec 8, 2019
99a1ae8
Rollup merge of #67016 - lqd:placeholder_loans, r=matthewjasper
Centril Dec 8, 2019
3824e76
Rollup merge of #67031 - mati865:tokio-update, r=nikomatsakis
Centril Dec 8, 2019
4387e7b
Rollup merge of #67138 - kraai:simplify-Layout-extend_packed, r=Amanieu
Centril Dec 8, 2019
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
134 changes: 49 additions & 85 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -734,16 +734,6 @@ dependencies = [
"crossbeam-utils 0.2.2",
]

[[package]]
name = "crossbeam-deque"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05e44b8cf3e1a625844d1750e1f7820da46044ff6d28f4d43e455ba3e5bb2c13"
dependencies = [
"crossbeam-epoch 0.7.2",
"crossbeam-utils 0.6.5",
]

[[package]]
name = "crossbeam-deque"
version = "0.7.1"
Expand Down Expand Up @@ -1760,7 +1750,7 @@ dependencies = [
"jsonrpc-server-utils",
"log",
"parity-tokio-ipc",
"parking_lot 0.9.0",
"parking_lot",
"tokio-service",
]

Expand All @@ -1772,7 +1762,7 @@ checksum = "e2c08b444cc0ed70263798834343d0ac875e664257df8079160f23ac1ea79446"
dependencies = [
"jsonrpc-core",
"log",
"parking_lot 0.9.0",
"parking_lot",
"serde",
]

Expand Down Expand Up @@ -1884,16 +1874,6 @@ dependencies = [
name = "linkchecker"
version = "0.1.0"

[[package]]
name = "lock_api"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "949826a5ccf18c1b3a7c3d57692778d21768b79e46eb9dd07bfc4c2160036c54"
dependencies = [
"owning_ref",
"scopeguard 0.3.3",
]

[[package]]
name = "lock_api"
version = "0.3.1"
Expand Down Expand Up @@ -2358,15 +2338,6 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd20eec3dbe4376829cb7d80ae6ac45e0a766831dca50202ff2d40db46a8a024"

[[package]]
name = "owning_ref"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
dependencies = [
"stable_deref_trait",
]

[[package]]
name = "packed_simd"
version = "0.3.1"
Expand Down Expand Up @@ -2415,38 +2386,15 @@ dependencies = [
"winapi 0.3.8",
]

[[package]]
name = "parking_lot"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337"
dependencies = [
"lock_api 0.1.3",
"parking_lot_core 0.4.0",
]

[[package]]
name = "parking_lot"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252"
dependencies = [
"lock_api 0.3.1",
"parking_lot_core 0.6.2",
"rustc_version",
]

[[package]]
name = "parking_lot_core"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9"
dependencies = [
"libc",
"rand 0.6.1",
"lock_api",
"parking_lot_core",
"rustc_version",
"smallvec 0.6.10",
"winapi 0.3.8",
]

[[package]]
Expand Down Expand Up @@ -2575,9 +2523,9 @@ checksum = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c"

[[package]]
name = "polonius-engine"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50fa9dbfd0d3d60594da338cfe6f94028433eecae4b11b7e83fd99759227bbfe"
checksum = "1e478d7c38eb785c6416cbe58df12aa55d7aefa3759b6d3e044b2ed03f423cec"
dependencies = [
"datafrog",
"log",
Expand Down Expand Up @@ -3193,7 +3141,7 @@ dependencies = [
"log",
"measureme",
"num_cpus",
"parking_lot 0.9.0",
"parking_lot",
"polonius-engine",
"rustc-rayon 0.3.0",
"rustc-rayon-core 0.3.0",
Expand Down Expand Up @@ -3243,7 +3191,7 @@ dependencies = [
"jobserver",
"lazy_static 1.3.0",
"log",
"parking_lot 0.9.0",
"parking_lot",
"rustc-ap-graphviz",
"rustc-ap-rustc_index",
"rustc-ap-serialize",
Expand Down Expand Up @@ -3556,7 +3504,7 @@ dependencies = [
"lazy_static 1.3.0",
"log",
"measureme",
"parking_lot 0.9.0",
"parking_lot",
"rustc-hash",
"rustc-rayon 0.3.0",
"rustc-rayon-core 0.3.0",
Expand Down Expand Up @@ -4692,9 +4640,9 @@ dependencies = [

[[package]]
name = "tokio"
version = "0.1.14"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4790d0be6f4ba6ae4f48190efa2ed7780c9e3567796abdb285003cf39840d9c5"
checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6"
dependencies = [
"bytes",
"futures",
Expand All @@ -4706,6 +4654,7 @@ dependencies = [
"tokio-fs",
"tokio-io",
"tokio-reactor",
"tokio-sync",
"tokio-tcp",
"tokio-threadpool",
"tokio-timer",
Expand Down Expand Up @@ -4737,29 +4686,29 @@ dependencies = [

[[package]]
name = "tokio-current-thread"
version = "0.1.4"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "331c8acc267855ec06eb0c94618dcbbfea45bed2d20b77252940095273fb58f6"
checksum = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443"
dependencies = [
"futures",
"tokio-executor",
]

[[package]]
name = "tokio-executor"
version = "0.1.6"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30c6dbf2d1ad1de300b393910e8a3aa272b724a400b6531da03eed99e329fbf0"
checksum = "ca6df436c42b0c3330a82d855d2ef017cd793090ad550a6bc2184f4b933532ab"
dependencies = [
"crossbeam-utils 0.6.5",
"futures",
]

[[package]]
name = "tokio-fs"
version = "0.1.5"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e9cbbc8a3698b7ab652340f46633364f9eaa928ddaaee79d8b8f356dd79a09d"
checksum = "3fe6dc22b08d6993916647d108a1a7d15b9cd29c4f4496c62b92c45b5041b7af"
dependencies = [
"futures",
"tokio-io",
Expand All @@ -4768,9 +4717,9 @@ dependencies = [

[[package]]
name = "tokio-io"
version = "0.1.11"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b53aeb9d3f5ccf2ebb29e19788f96987fa1355f8fe45ea193928eaaaf3ae820f"
checksum = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926"
dependencies = [
"bytes",
"futures",
Expand All @@ -4792,12 +4741,15 @@ dependencies = [

[[package]]
name = "tokio-process"
version = "0.2.3"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88e1281e412013f1ff5787def044a9577a0bed059f451e835f1643201f8b777d"
checksum = "afbd6ef1b8cc2bd2c2b580d882774d443ebb1c6ceefe35ba9ea4ab586c89dbe8"
dependencies = [
"crossbeam-queue",
"futures",
"lazy_static 1.3.0",
"libc",
"log",
"mio",
"mio-named-pipes",
"tokio-io",
Expand All @@ -4808,20 +4760,21 @@ dependencies = [

[[package]]
name = "tokio-reactor"
version = "0.1.8"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afbcdb0f0d2a1e4c440af82d7bbf0bf91a8a8c0575bcd20c05d15be7e9d3a02f"
checksum = "6732fe6b53c8d11178dcb77ac6d9682af27fc6d4cb87789449152e5377377146"
dependencies = [
"crossbeam-utils 0.6.5",
"futures",
"lazy_static 1.3.0",
"log",
"mio",
"num_cpus",
"parking_lot 0.7.1",
"parking_lot",
"slab",
"tokio-executor",
"tokio-io",
"tokio-sync",
]

[[package]]
Expand Down Expand Up @@ -4850,6 +4803,16 @@ dependencies = [
"winapi 0.3.8",
]

[[package]]
name = "tokio-sync"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d06554cce1ae4a50f42fba8023918afa931413aded705b560e29600ccf7c6d76"
dependencies = [
"fnv",
"futures",
]

[[package]]
name = "tokio-tcp"
version = "0.1.3"
Expand All @@ -4866,25 +4829,26 @@ dependencies = [

[[package]]
name = "tokio-threadpool"
version = "0.1.10"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17465013014410310f9f61fa10bf4724803c149ea1d51efece131c38efca93aa"
checksum = "2bd2c6a3885302581f4401c82af70d792bb9df1700e7437b0aeb4ada94d5388c"
dependencies = [
"crossbeam-channel",
"crossbeam-deque 0.6.3",
"crossbeam-deque 0.7.1",
"crossbeam-queue",
"crossbeam-utils 0.6.5",
"futures",
"lazy_static 1.3.0",
"log",
"num_cpus",
"rand 0.6.1",
"slab",
"tokio-executor",
]

[[package]]
name = "tokio-timer"
version = "0.2.8"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f37f0111d76cc5da132fe9bc0590b9b9cfd079bc7e75ac3846278430a299ff8"
checksum = "1739638e364e558128461fc1ad84d997702c8e31c2e6b18fb99842268199e827"
dependencies = [
"crossbeam-utils 0.6.5",
"futures",
Expand All @@ -4894,9 +4858,9 @@ dependencies = [

[[package]]
name = "tokio-udp"
version = "0.1.3"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66268575b80f4a4a710ef83d087fdfeeabdce9b74c797535fbac18a2cb906e92"
checksum = "f02298505547f73e60f568359ef0d016d5acd6e830ab9bc7c4a5b3403440121b"
dependencies = [
"bytes",
"futures",
Expand Down
59 changes: 12 additions & 47 deletions src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,53 +202,18 @@ impl<T> TypedArena<T> {
#[inline]
pub fn alloc_from_iter<I: IntoIterator<Item = T>>(&self, iter: I) -> &mut [T] {
assert!(mem::size_of::<T>() != 0);
let mut iter = iter.into_iter();
let size_hint = iter.size_hint();

match size_hint {
(min, Some(max)) if min == max => {
// We know the exact number of elements the iterator will produce here
let len = min;

if len == 0 {
return &mut [];
}

self.ensure_capacity(len);

let slice = self.ptr.get();

unsafe {
let mut ptr = self.ptr.get();
for _ in 0..len {
// Write into uninitialized memory.
ptr::write(ptr, iter.next().unwrap());
// Advance the pointer.
ptr = ptr.offset(1);
// Update the pointer per iteration so if `iter.next()` panics
// we destroy the correct amount
self.ptr.set(ptr);
}
slice::from_raw_parts_mut(slice, len)
}
}
_ => {
cold_path(move || -> &mut [T] {
let mut vec: SmallVec<[_; 8]> = iter.collect();
if vec.is_empty() {
return &mut [];
}
// Move the content to the arena by copying it and then forgetting
// the content of the SmallVec
unsafe {
let len = vec.len();
let start_ptr = self.alloc_raw_slice(len);
vec.as_ptr().copy_to_nonoverlapping(start_ptr, len);
vec.set_len(0);
slice::from_raw_parts_mut(start_ptr, len)
}
})
}
let mut vec: SmallVec<[_; 8]> = iter.into_iter().collect();
if vec.is_empty() {
return &mut [];
}
// Move the content to the arena by copying it and then forgetting
// the content of the SmallVec
unsafe {
let len = vec.len();
let start_ptr = self.alloc_raw_slice(len);
vec.as_ptr().copy_to_nonoverlapping(start_ptr, len);
vec.set_len(0);
slice::from_raw_parts_mut(start_ptr, len)
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/libcore/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ impl Layout {
pub fn extend_packed(&self, next: Self) -> Result<Self, LayoutErr> {
let new_size = self.size().checked_add(next.size())
.ok_or(LayoutErr { private: () })?;
let layout = Layout::from_size_align(new_size, self.align())?;
Ok(layout)
Layout::from_size_align(new_size, self.align())
}

/// Creates a layout describing the record for a `[T; n]`.
Expand Down
Loading