Skip to content

Commit

Permalink
Upgrade rust crates
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed May 11, 2019
1 parent b9286ce commit 5ea0c45
Show file tree
Hide file tree
Showing 538 changed files with 3,019 additions and 1,224 deletions.
7 changes: 3 additions & 4 deletions rust_crates/.gitignore
Expand Up @@ -5,18 +5,17 @@
/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.15/
/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.28/
/registry/src/github.com-1ecc6299db9ec823/blake2-rfc-0.2.18/
/registry/src/github.com-1ecc6299db9ec823/cc-1.0.35/
/registry/src/github.com-1ecc6299db9ec823/cc-1.0.36/
/registry/src/github.com-1ecc6299db9ec823/cloudabi-0.0.3/
/registry/src/github.com-1ecc6299db9ec823/constant_time_eq-0.1.3/
/registry/src/github.com-1ecc6299db9ec823/failure-0.1.5/
/registry/src/github.com-1ecc6299db9ec823/failure_derive-0.1.5/
/registry/src/github.com-1ecc6299db9ec823/fuchsia-cprng-0.1.1/
/registry/src/github.com-1ecc6299db9ec823/fuchsia-zircon-0.3.3/
/registry/src/github.com-1ecc6299db9ec823/fuchsia-zircon-sys-0.3.3/
/registry/src/github.com-1ecc6299db9ec823/nix-0.11.0/
/registry/src/github.com-1ecc6299db9ec823/numtoa-0.1.0/
/registry/src/github.com-1ecc6299db9ec823/owning_ref-0.4.0/
/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.4.28/
/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.4.30/
/registry/src/github.com-1ecc6299db9ec823/quote-0.6.12/
/registry/src/github.com-1ecc6299db9ec823/rand-0.4.6/
/registry/src/github.com-1ecc6299db9ec823/rand_core-0.3.1/
Expand All @@ -30,7 +29,7 @@
/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/
/registry/src/github.com-1ecc6299db9ec823/semver-parser-0.7.0/
/registry/src/github.com-1ecc6299db9ec823/stable_deref_trait-1.1.1/
/registry/src/github.com-1ecc6299db9ec823/syn-0.15.32/
/registry/src/github.com-1ecc6299db9ec823/syn-0.15.34/
/registry/src/github.com-1ecc6299db9ec823/synstructure-0.10.1/
/registry/src/github.com-1ecc6299db9ec823/termion-1.5.2/
/registry/src/github.com-1ecc6299db9ec823/unicode-xid-0.1.0/
Expand Down
@@ -0,0 +1,5 @@
{
"git": {
"sha1": "9936adf473978c0934e7734cb506887f6fc0b025"
}
}
Expand Up @@ -3,7 +3,7 @@
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g. crates.io) dependencies
# to registry (e.g., crates.io) dependencies
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
Expand All @@ -12,7 +12,7 @@

[package]
name = "flatbuffers"
version = "0.5.0"
version = "0.6.0"
authors = ["Robert Winslow <hello@rwinslow.com>", "FlatBuffers Maintainers"]
description = "Official FlatBuffers Rust runtime library."
homepage = "https://google.github.io/flatbuffers/"
Expand Down
@@ -1,6 +1,6 @@
[package]
name = "flatbuffers"
version = "0.5.0"
version = "0.6.0"
authors = ["Robert Winslow <hello@rwinslow.com>", "FlatBuffers Maintainers"]
license = "Apache-2.0"
description = "Official FlatBuffers Rust runtime library."
Expand Down
Expand Up @@ -29,6 +29,8 @@ use vtable::{VTable, field_index_to_field_offset};
use vtable_writer::VTableWriter;
use vector::{SafeSliceAccess, Vector};

pub const N_SMALLVEC_STRING_VECTOR_CAPACITY: usize = 16;

#[derive(Clone, Copy, Debug)]
struct FieldLoc {
off: UOffsetT,
Expand Down Expand Up @@ -268,10 +270,12 @@ impl<'fbb> FlatBufferBuilder<'fbb> {
#[inline]
pub fn create_vector_of_strings<'a, 'b>(&'a mut self, xs: &'b [&'b str]) -> WIPOffset<Vector<'fbb, ForwardsUOffset<&'fbb str>>> {
self.assert_not_nested("create_vector_of_strings can not be called when a table or vector is under construction");
// internally, smallvec can be a stack-allocated or heap-allocated vector.
// we expect it to usually be stack-allocated.
let mut offsets: smallvec::SmallVec<[WIPOffset<&str>; 0]> = smallvec::SmallVec::with_capacity(xs.len());
// internally, smallvec can be a stack-allocated or heap-allocated vector:
// if xs.len() > N_SMALLVEC_STRING_VECTOR_CAPACITY then it will overflow to the heap.
let mut offsets: smallvec::SmallVec<[WIPOffset<&str>; N_SMALLVEC_STRING_VECTOR_CAPACITY]> = smallvec::SmallVec::with_capacity(xs.len());
unsafe { offsets.set_len(xs.len()); }

// note that this happens in reverse, because the buffer is built back-to-front:
for (i, &s) in xs.iter().enumerate().rev() {
let o = self.create_string(s);
offsets[i] = o;
Expand Down
Expand Up @@ -88,7 +88,7 @@ impl EndianScalar for f32 {
}
#[cfg(not(target_endian = "little"))]
{
byte_swap_f32(&self)
byte_swap_f32(self)
}
}
/// Convert f32 from little-endian to host endian-ness.
Expand All @@ -100,7 +100,7 @@ impl EndianScalar for f32 {
}
#[cfg(not(target_endian = "little"))]
{
byte_swap_f32(&self)
byte_swap_f32(self)
}
}
}
Expand All @@ -115,7 +115,7 @@ impl EndianScalar for f64 {
}
#[cfg(not(target_endian = "little"))]
{
byte_swap_f64(&self)
byte_swap_f64(self)
}
}
/// Convert f64 from little-endian to host endian-ness.
Expand All @@ -127,7 +127,7 @@ impl EndianScalar for f64 {
}
#[cfg(not(target_endian = "little"))]
{
byte_swap_f64(&self)
byte_swap_f64(self)
}
}
}
Expand Down
Expand Up @@ -19,7 +19,9 @@ use std::mem::size_of;
use std::slice::from_raw_parts;
use std::str::from_utf8_unchecked;

use endian_scalar::{EndianScalar, read_scalar};
#[cfg(target_endian = "little")]
use endian_scalar::EndianScalar;
use endian_scalar::read_scalar;
use follow::Follow;
use primitives::*;

Expand Down Expand Up @@ -85,6 +87,7 @@ mod le_safe_slice_impls {
impl super::SafeSliceAccess for f64 {}
}

#[cfg(target_endian = "little")]
pub use self::le_safe_slice_impls::*;

pub fn follow_cast_ref<'a, T: Sized + 'a>(buf: &'a [u8], loc: usize) -> &'a T {
Expand All @@ -104,6 +107,7 @@ impl<'a> Follow<'a> for &'a str {
}
}

#[cfg(target_endian = "little")]
fn follow_slice_helper<T>(buf: &[u8], loc: usize) -> &[T] {
let sz = size_of::<T>();
debug_assert!(sz > 0);
Expand Down
Expand Up @@ -12,7 +12,7 @@

[package]
name = "futures"
version = "0.1.26"
version = "0.1.27"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
description = "An implementation of futures and streams featuring zero allocations,\ncomposability, and iterator-like interfaces.\n"
homepage = "https://github.com/rust-lang-nursery/futures-rs"
Expand Down
@@ -1,6 +1,6 @@
[package]
name = "futures"
version = "0.1.26"
version = "0.1.27"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = "MIT/Apache-2.0"
readme = "README.md"
Expand Down
Expand Up @@ -33,7 +33,7 @@
#[allow(deprecated)]
pub use task_impl::{Spawn, spawn, Unpark, Executor, Run, park};

pub use task_impl::{Task, AtomicTask, current, init};
pub use task_impl::{Task, AtomicTask, current, init, is_in_task};

#[allow(deprecated)]
#[cfg(feature = "use_std")]
Expand Down
Expand Up @@ -140,6 +140,15 @@ pub unsafe fn init(get: fn() -> *mut u8, set: fn(*mut u8)) -> bool {
}
}

/// Return whether the caller is running in a task (and so can use task_local!).
pub fn is_in_task() -> bool {
if let Some(ptr) = get_ptr() {
!ptr.is_null()
} else {
false
}
}

#[inline]
pub fn get_ptr() -> Option<*mut u8> {
match GET.load(Relaxed) {
Expand Down
Expand Up @@ -27,6 +27,11 @@ pub use task_impl::core::init;

thread_local!(static CURRENT_TASK: Cell<*mut u8> = Cell::new(ptr::null_mut()));

/// Return whether the caller is running in a task (and so can use task_local!).
pub fn is_in_task() -> bool {
CURRENT_TASK.with(|task| !task.get().is_null())
}

static INIT: Once = ONCE_INIT;

pub fn get_ptr() -> Option<*mut u8> {
Expand Down

This file was deleted.

@@ -0,0 +1,5 @@
{
"git": {
"sha1": "778421eb94f9c194bafb1f5a62723cf4ef9bca06"
}
}
Expand Up @@ -12,7 +12,7 @@

[package]
name = "hyper"
version = "0.12.27"
version = "0.12.28"
authors = ["Sean McArthur <sean@seanmonstar.com>"]
include = ["Cargo.toml", "LICENSE", "src/**/*"]
description = "A fast and correct HTTP library."
Expand Down
@@ -1,6 +1,6 @@
[package]
name = "hyper"
version = "0.12.27" # don't forget to update html_root_url
version = "0.12.28" # don't forget to update html_root_url
description = "A fast and correct HTTP library."
readme = "README.md"
homepage = "https://hyper.rs"
Expand Down
Expand Up @@ -3,7 +3,7 @@ use std::fmt;

use bytes::Bytes;
use futures::sync::{mpsc, oneshot};
use futures::{Async, Future, Poll, Stream};
use futures::{Async, Future, Poll, Stream, Sink, AsyncSink, StartSend};
use h2;
use http::HeaderMap;

Expand Down Expand Up @@ -381,6 +381,25 @@ impl Sender {
}
}

impl Sink for Sender {
type SinkItem = Chunk;
type SinkError = ::Error;

fn poll_complete(&mut self) -> Poll<(), Self::SinkError> {
Ok(Async::Ready(()))
}

fn start_send(&mut self, msg: Chunk) -> StartSend<Self::SinkItem, Self::SinkError> {
match self.poll_ready()? {
Async::Ready(_) => {
self.send_data(msg).map_err(|_| ::Error::new_closed())?;
Ok(AsyncSink::Ready)
}
Async::NotReady => Ok(AsyncSink::NotReady(msg)),
}
}
}

impl From<Chunk> for Body {
#[inline]
fn from(chunk: Chunk) -> Body {
Expand Down
Expand Up @@ -235,7 +235,7 @@ where
},
Err(_req) => {
debug!("connection was not ready");
let err = ::Error::new_canceled(Some("connection was not ready"));
let err = ::Error::new_canceled().with("connection was not ready");
Either::B(future::err(err))
}
};
Expand All @@ -262,7 +262,7 @@ where
},
Err(req) => {
debug!("connection was not ready");
let err = ::Error::new_canceled(Some("connection was not ready"));
let err = ::Error::new_canceled().with("connection was not ready");
Either::B(future::err((err, Some(req))))
}
}
Expand Down Expand Up @@ -322,7 +322,7 @@ where
},
Err(req) => {
debug!("connection was not ready");
let err = ::Error::new_canceled(Some("connection was not ready"));
let err = ::Error::new_canceled().with("connection was not ready");
Either::B(future::err((err, Some(req))))
}
}
Expand Down
Expand Up @@ -167,7 +167,7 @@ struct Envelope<T, U>(Option<(T, Callback<T, U>)>);
impl<T, U> Drop for Envelope<T, U> {
fn drop(&mut self) {
if let Some((val, cb)) = self.0.take() {
let _ = cb.send(Err((::Error::new_canceled(None::<::Error>), Some(val))));
let _ = cb.send(Err((::Error::new_canceled().with("connection closed"), Some(val))));
}
}
}
Expand Down
Expand Up @@ -498,7 +498,7 @@ where C: Connect + Sync + 'static,
let connecting = match pool.connecting(&pool_key, ver) {
Some(lock) => lock,
None => {
let canceled = ::Error::new_canceled(Some("HTTP/2 connection in progress"));
let canceled = ::Error::new_canceled().with("HTTP/2 connection in progress");
return Either::B(future::err(canceled));
}
};
Expand All @@ -517,7 +517,7 @@ where C: Connect + Sync + 'static,
None => {
// Another connection has already upgraded,
// the pool checkout should finish up for us.
let canceled = ::Error::new_canceled(Some("ALPN upgraded to HTTP/2"));
let canceled = ::Error::new_canceled().with("ALPN upgraded to HTTP/2");
return Either::B(future::err(canceled));
}
}
Expand Down

0 comments on commit 5ea0c45

Please sign in to comment.