Skip to content

Commit

Permalink
Update rand to 0.7 (fixes #24448)
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Oct 22, 2019
1 parent bf587f2 commit df14c5d
Show file tree
Hide file tree
Showing 43 changed files with 200 additions and 246 deletions.
258 changes: 109 additions & 149 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions Cargo.toml
Expand Up @@ -27,8 +27,6 @@ opt-level = 3

# Those are here to dedupe winapi since mio is still using winapi 0.2.
mio = { git = "https://github.com/servo/mio.git", branch = "servo" }
rand_os = { git = "https://github.com/servo/rand", branch = "servo-rand_os-0.1.3-uwp" }
rand_core = { git = "https://github.com/servo/rand", branch = "servo-rand_os-0.1.3-uwp" }
# https://github.com/cuviper/autocfg/pull/10
autocfg = { git = "https://github.com/servo/autocfg", branch = "rustflags2" }
# https://github.com/retep998/winapi-rs/pull/816
Expand Down
4 changes: 2 additions & 2 deletions components/atoms/Cargo.toml
Expand Up @@ -11,7 +11,7 @@ build = "build.rs"
path = "lib.rs"

[dependencies]
string_cache = {version = "0.7"}
string_cache = "0.8"

[build-dependencies]
string_cache_codegen = "0.4"
string_cache_codegen = "0.5"
2 changes: 1 addition & 1 deletion components/bluetooth/Cargo.toml
Expand Up @@ -19,7 +19,7 @@ ipc-channel = "0.12"
log = "0.4"
servo_config = {path = "../config"}
servo_rand = {path = "../rand"}
uuid = {version = "0.7", features = ["v4"]}
uuid = {version = "0.8", features = ["v4"]}

[features]
native-bluetooth = ["device/bluetooth"]
2 changes: 1 addition & 1 deletion components/canvas/Cargo.toml
Expand Up @@ -20,7 +20,7 @@ no_wgl = ["offscreen_gl_context/no_wgl"]
azure = {git = "https://github.com/servo/rust-azure", optional = true}
byteorder = "1"
canvas_traits = {path = "../canvas_traits"}
cssparser = "0.25"
cssparser = "0.27.1"
embedder_traits = {path = "../embedder_traits"}
euclid = "0.20"
fnv = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion components/canvas_traits/Cargo.toml
Expand Up @@ -14,7 +14,7 @@ path = "lib.rs"
webgl_backtrace = []

[dependencies]
cssparser = "0.25"
cssparser = "0.27.1"
euclid = "0.20"
ipc-channel = "0.12"
lazy_static = "1"
Expand Down
2 changes: 1 addition & 1 deletion components/constellation/Cargo.toml
Expand Up @@ -53,4 +53,4 @@ webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
webxr-api = {git = "https://github.com/servo/webxr", features = ["ipc"]}

[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os="android"), not(target_arch="arm"), not(target_arch="aarch64")))'.dependencies]
gaol = {git = "https://github.com/servo/gaol"}
gaol = "0.2.1"
2 changes: 1 addition & 1 deletion components/devtools/Cargo.toml
Expand Up @@ -22,4 +22,4 @@ msg = {path = "../msg"}
serde = "1.0"
serde_json = "1.0"
time = "0.1"
uuid = {version = "0.7", features = ["v4"]}
uuid = {version = "0.8", features = ["v4"]}
2 changes: 1 addition & 1 deletion components/gfx/Cargo.toml
Expand Up @@ -56,7 +56,7 @@ servo_allocator = {path = "../allocator"}
servo-fontconfig = "0.4"

[target.'cfg(target_os = "android")'.dependencies]
xml5ever = {version = "0.15"}
xml5ever = "0.16"

[target.'cfg(target_os = "windows")'.dependencies]
dwrote = "0.9"
Expand Down
2 changes: 1 addition & 1 deletion components/hashglobe/Cargo.toml
Expand Up @@ -13,4 +13,4 @@ readme = "README.md"
libc = "0.2"

[dev-dependencies]
rand = "0.6"
rand = "0.7"
2 changes: 1 addition & 1 deletion components/layout/Cargo.toml
Expand Up @@ -24,7 +24,7 @@ fnv = "1.0"
fxhash = "0.2"
gfx = {path = "../gfx"}
gfx_traits = {path = "../gfx_traits"}
html5ever = "0.24"
html5ever = "0.25"
ipc-channel = "0.12"
lazy_static = "1"
libc = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion components/layout_thread/Cargo.toml
Expand Up @@ -21,7 +21,7 @@ fxhash = "0.2"
gfx = {path = "../gfx"}
gfx_traits = {path = "../gfx_traits"}
histogram = "0.6.8"
html5ever = "0.24"
html5ever = "0.25"
ipc-channel = "0.12"
layout = {path = "../layout", package = "layout_2013"}
layout_traits = {path = "../layout_traits"}
Expand Down
2 changes: 1 addition & 1 deletion components/layout_thread_2020/Cargo.toml
Expand Up @@ -20,7 +20,7 @@ fnv = "1.0"
fxhash = "0.2"
gfx = {path = "../gfx"}
gfx_traits = {path = "../gfx_traits"}
html5ever = "0.24"
html5ever = "0.25"
ipc-channel = "0.12"
layout = {path = "../layout_2020", package = "layout_2020"}
layout_traits = {path = "../layout_traits"}
Expand Down
6 changes: 3 additions & 3 deletions components/malloc_size_of/Cargo.toml
Expand Up @@ -28,7 +28,7 @@ servo = [
app_units = "0.7"
content-security-policy = {version = "0.3.0", features = ["serde"], optional = true}
crossbeam-channel = { version = "0.3", optional = true }
cssparser = "0.25"
cssparser = "0.27.1"
euclid = "0.20"
hashglobe = { path = "../hashglobe" }
hyper = { version = "0.12", optional = true }
Expand All @@ -40,10 +40,10 @@ serde_bytes = { version = "0.10", optional = true }
servo_arc = { path = "../servo_arc" }
smallbitvec = "2.3.0"
smallvec = "0.6"
string_cache = { version = "0.7", optional = true }
string_cache = { version = "0.8", optional = true }
thin-slice = "0.1.0"
time = { version = "0.1.17", optional = true }
url = { version = "2.0", optional = true }
webrender_api = { git = "https://github.com/servo/webrender", features = ["ipc"], optional = true }
xml5ever = { version = "0.15", optional = true }
xml5ever = { version = "0.16", optional = true }
void = "1.0.2"
2 changes: 1 addition & 1 deletion components/net/Cargo.toml
Expand Up @@ -55,7 +55,7 @@ servo_url = {path = "../url"}
tokio = "0.1"
time = "0.1.17"
url = "2.0"
uuid = {version = "0.7", features = ["v4"]}
uuid = {version = "0.8", features = ["v4"]}
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
ws = { version = "0.9", features = ["ssl"] }

Expand Down
2 changes: 1 addition & 1 deletion components/net_traits/Cargo.toml
Expand Up @@ -36,7 +36,7 @@ servo_arc = {path = "../servo_arc"}
servo_url = {path = "../url"}
time = "0.1"
url = "2.0"
uuid = {version = "0.7", features = ["v4", "serde"]}
uuid = {version = "0.8", features = ["v4", "serde"]}
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}

[dev-dependencies]
Expand Down
8 changes: 4 additions & 4 deletions components/rand/Cargo.toml
Expand Up @@ -13,7 +13,7 @@ path = "lib.rs"
[dependencies]
lazy_static = "1"
log = "0.4"
rand = "0.6"
rand_core = "0.4"
rand_isaac = "0.1"
uuid = "0.7"
rand = "0.7"
rand_core = "0.5"
rand_isaac = "0.2"
uuid = "0.8"
5 changes: 1 addition & 4 deletions components/rand/lib.rs
Expand Up @@ -31,10 +31,7 @@ use uuid::{Builder, Uuid, Variant, Version};

// The shared RNG which may hold on to a file descriptor
lazy_static! {
static ref OS_RNG: Mutex<OsRng> = match OsRng::new() {
Ok(r) => Mutex::new(r),
Err(e) => panic!("Failed to seed OsRng: {}", e),
};
static ref OS_RNG: Mutex<OsRng> = Mutex::new(OsRng);
}

// Generate 32K of data between reseedings
Expand Down
14 changes: 7 additions & 7 deletions components/script/Cargo.toml
Expand Up @@ -23,8 +23,8 @@ uwp = ["js/uwp"]
vslatestinstalled = ["js/vslatestinstalled"]

[build-dependencies]
phf_codegen = "0.7"
phf_shared = "0.7"
phf_codegen = "0.8"
phf_shared = "0.8"
serde_json = "1.0"

[target.'cfg(target_os = "linux")'.dependencies]
Expand All @@ -43,7 +43,7 @@ content-security-policy = {version = "0.3.0", features = ["serde"]}
cookie = "0.11"
chrono = "0.4"
crossbeam-channel = "0.3"
cssparser = "0.25"
cssparser = "0.27.1"
deny_public_fields = {path = "../deny_public_fields"}
devtools_traits = {path = "../devtools_traits"}
dom_struct = {path = "../dom_struct"}
Expand All @@ -54,7 +54,7 @@ enum-iterator = "0.3"
euclid = "0.20"
fnv = "1.0"
headers = "0.2"
html5ever = "0.24"
html5ever = "0.25"
http = "0.1"
hyper = "0.12"
hyper_serde = "0.11"
Expand All @@ -80,7 +80,7 @@ net_traits = {path = "../net_traits"}
num-traits = "0.2"
parking_lot = "0.9"
percent-encoding = "2.0"
phf = "0.7"
phf = "0.8"
pixels = {path = "../pixels"}
profile_traits = {path = "../profile_traits"}
ref_filter_map = "1.0.1"
Expand Down Expand Up @@ -109,8 +109,8 @@ time = "0.1.12"
unicode-segmentation = "1.1.0"
url = "2.0"
utf-8 = "0.7"
uuid = {version = "0.7", features = ["v4"]}
xml5ever = {version = "0.15"}
uuid = {version = "0.8", features = ["v4"]}
xml5ever = "0.16"
webdriver = "0.40"
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
webvr_traits = {path = "../webvr_traits"}
Expand Down
11 changes: 5 additions & 6 deletions components/script/build.rs
Expand Up @@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

use phf_shared;
use phf_shared::{self, FmtConst};
use serde_json::{self, Value};
use std::env;
use std::fmt;
Expand Down Expand Up @@ -40,18 +40,17 @@ fn main() {
let mut phf = File::create(&phf).unwrap();
write!(
&mut phf,
"pub static MAP: phf::Map<&'static [u8], fn(JSContext, HandleObject)> = "
"pub static MAP: phf::Map<&'static [u8], fn(JSContext, HandleObject)> = {};\n",
map.build(),
)
.unwrap();
map.build(&mut phf).unwrap();
write!(&mut phf, ";\n").unwrap();
}

#[derive(Eq, Hash, PartialEq)]
struct Bytes<'a>(&'a str);

impl<'a> fmt::Debug for Bytes<'a> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
impl<'a> FmtConst for Bytes<'a> {
fn fmt_const(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
// https://github.com/rust-lang/rust/issues/55223
// should technically be just `write!(formatter, "b\"{}\"", self.0)
// but the referenced issue breaks promotion in the surrounding code
Expand Down
12 changes: 6 additions & 6 deletions components/script/dom/servoparser/prefetch.rs
Expand Up @@ -97,7 +97,7 @@ impl TokenSink for PrefetchSink {
_ => return TokenSinkResult::Continue,
};
match (tag.kind, &tag.name) {
(TagKind::StartTag, local_name!("script")) if self.prefetching => {
(TagKind::StartTag, &local_name!("script")) if self.prefetching => {
if let Some(url) = self.get_url(tag, local_name!("src")) {
debug!("Prefetch script {}", url);
let cors_setting = self.get_cors_settings(tag, local_name!("crossorigin"));
Expand All @@ -120,7 +120,7 @@ impl TokenSink for PrefetchSink {
}
TokenSinkResult::RawData(RawKind::ScriptData)
},
(TagKind::StartTag, local_name!("img")) if self.prefetching => {
(TagKind::StartTag, &local_name!("img")) if self.prefetching => {
if let Some(url) = self.get_url(tag, local_name!("src")) {
debug!("Prefetch {} {}", tag.name, url);
let request = image_fetch_request(
Expand All @@ -137,7 +137,7 @@ impl TokenSink for PrefetchSink {
}
TokenSinkResult::Continue
},
(TagKind::StartTag, local_name!("link")) if self.prefetching => {
(TagKind::StartTag, &local_name!("link")) if self.prefetching => {
if let Some(rel) = self.get_attr(tag, local_name!("rel")) {
if rel.value.eq_ignore_ascii_case("stylesheet") {
if let Some(url) = self.get_url(tag, local_name!("href")) {
Expand Down Expand Up @@ -167,15 +167,15 @@ impl TokenSink for PrefetchSink {
}
TokenSinkResult::Continue
},
(TagKind::StartTag, local_name!("script")) => {
(TagKind::StartTag, &local_name!("script")) => {
TokenSinkResult::RawData(RawKind::ScriptData)
},
(TagKind::EndTag, local_name!("script")) => {
(TagKind::EndTag, &local_name!("script")) => {
// After the first script tag, the main parser is blocked, so it's worth prefetching.
self.prefetching = true;
TokenSinkResult::Script(PrefetchHandle)
},
(TagKind::StartTag, local_name!("base")) => {
(TagKind::StartTag, &local_name!("base")) => {
if let Some(url) = self.get_url(tag, local_name!("href")) {
if self.base_url.is_none() {
debug!("Setting base {}", url);
Expand Down
2 changes: 1 addition & 1 deletion components/script_layout_interface/Cargo.toml
Expand Up @@ -17,7 +17,7 @@ canvas_traits = {path = "../canvas_traits"}
crossbeam-channel = "0.3"
euclid = "0.20"
gfx_traits = {path = "../gfx_traits"}
html5ever = "0.24"
html5ever = "0.25"
ipc-channel = "0.12"
libc = "0.2"
malloc_size_of = { path = "../malloc_size_of" }
Expand Down
6 changes: 3 additions & 3 deletions components/selectors/Cargo.toml
Expand Up @@ -22,11 +22,11 @@ bench = []
[dependencies]
bitflags = "1.0"
matches = "0.1"
cssparser = "0.25"
cssparser = "0.27.1"
derive_more = "0.13"
log = "0.4"
fxhash = "0.2"
phf = "0.7"
phf = "0.8"
precomputed-hash = "0.1"
servo_arc = { version = "0.1", path = "../servo_arc" }
smallvec = "0.6"
Expand All @@ -35,4 +35,4 @@ to_shmem = { path = "../to_shmem" }
to_shmem_derive = { path = "../to_shmem_derive" }

[build-dependencies]
phf_codegen = "0.7"
phf_codegen = "0.8"
9 changes: 6 additions & 3 deletions components/selectors/build.rs
Expand Up @@ -14,13 +14,16 @@ fn main() {
.join("ascii_case_insensitive_html_attributes.rs");
let mut file = BufWriter::new(File::create(&path).unwrap());

write!(&mut file, "{{ static SET: ::phf::Set<&'static str> = ").unwrap();
let mut set = phf_codegen::Set::new();
for name in ASCII_CASE_INSENSITIVE_HTML_ATTRIBUTES.split_whitespace() {
set.entry(name);
}
set.build(&mut file).unwrap();
write!(&mut file, "; &SET }}").unwrap();
write!(
&mut file,
"{{ static SET: ::phf::Set<&'static str> = {}; &SET }}",
set.build(),
)
.unwrap();
}

/// <https://html.spec.whatwg.org/multipage/#selectors>
Expand Down
2 changes: 1 addition & 1 deletion components/servo/Cargo.toml
Expand Up @@ -85,7 +85,7 @@ webvr_traits = {path = "../webvr_traits"}
webxr-api = {git = "https://github.com/servo/webxr"}

[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios"), not(target_os="android"), not(target_arch="arm"), not(target_arch="aarch64")))'.dependencies]
gaol = {git = "https://github.com/servo/gaol"}
gaol = "0.2.1"

[target.'cfg(any(target_os = "android", target_arch = "x86_64", target_os = "windows"))'.dependencies]
gstreamer = "0.14.5"
Expand Down
6 changes: 3 additions & 3 deletions components/style/Cargo.toml
Expand Up @@ -33,7 +33,7 @@ arrayvec = "0.4.6"
atomic_refcell = "0.1"
bitflags = "1.0"
byteorder = "1.0"
cssparser = "0.25"
cssparser = "0.27.1"
crossbeam-channel = { version = "0.3", optional = true }
derive_more = "0.13"
new_debug_unreachable = "1.0"
Expand All @@ -42,7 +42,7 @@ euclid = "0.20"
fallible = { path = "../fallible" }
fxhash = "0.2"
hashglobe = { path = "../hashglobe" }
html5ever = {version = "0.24", optional = true}
html5ever = {version = "0.25", optional = true}
indexmap = "1.0"
itertools = "0.8"
itoa = "0.4"
Expand All @@ -67,7 +67,7 @@ servo_atoms = {path = "../atoms", optional = true}
servo_config = {path = "../config", optional = true}
smallbitvec = "2.3.0"
smallvec = "0.6.6"
string_cache = { version = "0.7", optional = true }
string_cache = { version = "0.8", optional = true }
style_derive = {path = "../style_derive"}
style_traits = {path = "../style_traits"}
servo_url = {path = "../url", optional = true}
Expand Down

0 comments on commit df14c5d

Please sign in to comment.