Bug 1961024 - build(rust): shim-upgrade ron 0.9.0 → 0.10.1 r=supply-chain-reviewers,glandium
Differential Revision: https://phabricator.services.mozilla.com/D245811
This commit is contained in:
15
Cargo.lock
generated
15
Cargo.lock
generated
@@ -5603,9 +5603,16 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ron"
|
||||
version = "0.9.0"
|
||||
version = "0.9.999"
|
||||
dependencies = [
|
||||
"ron 0.10.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ron"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "63f3aa105dea217ef30d89581b65a4d527a19afc95ef5750be3890e8d3c5b837"
|
||||
checksum = "beceb6f7bf81c73e73aeef6dd1356d9a1b2b4909e1f0fc3e59b034f9572d7b7f"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"bitflags 2.9.0",
|
||||
@@ -7347,7 +7354,7 @@ dependencies = [
|
||||
"peek-poke",
|
||||
"plane-split",
|
||||
"rayon",
|
||||
"ron",
|
||||
"ron 0.10.1",
|
||||
"serde",
|
||||
"smallvec",
|
||||
"svg_fmt",
|
||||
@@ -7457,7 +7464,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
"ron",
|
||||
"ron 0.9.999",
|
||||
"rustc-hash 1.999.999",
|
||||
"serde",
|
||||
"smallvec",
|
||||
|
||||
@@ -213,6 +213,9 @@ half = { path = "build/rust/half" }
|
||||
# Upgrade `rusqlite` 0.31 to 0.33.
|
||||
rusqlite = { path = "build/rust/rusqlite" }
|
||||
|
||||
# Patch `ron` 0.9.* to 0.10.
|
||||
ron = { path = "build/rust/ron" }
|
||||
|
||||
# Overrides to allow easier use of common internal crates.
|
||||
moz_asserts = { path = "mozglue/static/rust/moz_asserts" }
|
||||
|
||||
|
||||
17
build/rust/ron/Cargo.toml
Normal file
17
build/rust/ron/Cargo.toml
Normal file
@@ -0,0 +1,17 @@
|
||||
[package]
|
||||
name = "ron"
|
||||
version = "0.9.999"
|
||||
edition = "2018"
|
||||
license = "MIT OR Apache-2.0"
|
||||
|
||||
[lib]
|
||||
path = "lib.rs"
|
||||
|
||||
[dependencies.ron]
|
||||
version = "0.10.0"
|
||||
default-features = false
|
||||
|
||||
[features]
|
||||
default = ["ron/default"]
|
||||
indexmap = ["ron/indexmap"]
|
||||
integer128 = ["ron/integer128"]
|
||||
5
build/rust/ron/lib.rs
Normal file
5
build/rust/ron/lib.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
pub use ron::*;
|
||||
4
gfx/wr/Cargo.lock
generated
4
gfx/wr/Cargo.lock
generated
@@ -2333,9 +2333,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ron"
|
||||
version = "0.9.0"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "63f3aa105dea217ef30d89581b65a4d527a19afc95ef5750be3890e8d3c5b837"
|
||||
checksum = "beceb6f7bf81c73e73aeef6dd1356d9a1b2b4909e1f0fc3e59b034f9572d7b7f"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"bitflags 2.4.2",
|
||||
|
||||
@@ -40,7 +40,7 @@ num-traits = "0.2"
|
||||
plane-split = "0.18"
|
||||
png = { optional = true, version = "0.16" }
|
||||
rayon = "1"
|
||||
ron = { optional = true, version = "0.9.0" }
|
||||
ron = { optional = true, version = "0.10.0" }
|
||||
serde = { optional = true, version = "1.0", features = ["serde_derive"] }
|
||||
smallvec = "1"
|
||||
time = "0.1"
|
||||
|
||||
@@ -4533,6 +4533,11 @@ who = "Erich Gubler <erichdongubler@gmail.com>"
|
||||
criteria = "safe-to-deploy"
|
||||
delta = "0.8.1 -> 0.9.0"
|
||||
|
||||
[[audits.ron]]
|
||||
who = "Erich Gubler <erichdongubler@gmail.com>"
|
||||
criteria = "safe-to-deploy"
|
||||
delta = "0.9.0 -> 0.10.1"
|
||||
|
||||
[[audits.rure]]
|
||||
who = "Nika Layzell <nika@thelayzells.com>"
|
||||
criteria = "safe-to-deploy"
|
||||
|
||||
2
third_party/rust/ron/.cargo-checksum.json
vendored
2
third_party/rust/ron/.cargo-checksum.json
vendored
File diff suppressed because one or more lines are too long
7
third_party/rust/ron/CHANGELOG.md
vendored
7
third_party/rust/ron/CHANGELOG.md
vendored
@@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## Unreleased
|
||||
|
||||
## [0.10.1] - 2025-04-08
|
||||
|
||||
### API Changes
|
||||
|
||||
- Add `ron::Options::to_io_writer` and `ron::Options::to_io_writer_pretty` to allow writing into an `io::Writer` ([#561](https://github.com/ron-rs/ron/pull/561))
|
||||
- Breaking: `ron::value::Number` is now non-exhaustive, to avoid breaking `match`es when feature unification enables more of its variants than expected ([#564](https://github.com/ron-rs/ron/pull/564))
|
||||
|
||||
## [0.9.0] - 2025-03-18
|
||||
|
||||
### API Changes
|
||||
|
||||
10
third_party/rust/ron/Cargo.lock
generated
vendored
10
third_party/rust/ron/Cargo.lock
generated
vendored
@@ -56,9 +56,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "2.8.0"
|
||||
version = "2.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058"
|
||||
checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
|
||||
dependencies = [
|
||||
"equivalent",
|
||||
"hashbrown",
|
||||
@@ -88,9 +88,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.21.1"
|
||||
version = "1.21.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc"
|
||||
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
||||
|
||||
[[package]]
|
||||
name = "option_set"
|
||||
@@ -122,7 +122,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ron"
|
||||
version = "0.9.0"
|
||||
version = "0.10.1"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"bitflags",
|
||||
|
||||
6
third_party/rust/ron/Cargo.toml
vendored
6
third_party/rust/ron/Cargo.toml
vendored
@@ -13,7 +13,7 @@
|
||||
edition = "2021"
|
||||
rust-version = "1.64.0"
|
||||
name = "ron"
|
||||
version = "0.9.0"
|
||||
version = "0.10.1"
|
||||
authors = [
|
||||
"Christopher Durham <cad97@cad97.com>",
|
||||
"Dzmitry Malyshau <kvarkus@gmail.com>",
|
||||
@@ -70,6 +70,10 @@ path = "examples/decode_file.rs"
|
||||
name = "encode"
|
||||
path = "examples/encode.rs"
|
||||
|
||||
[[example]]
|
||||
name = "encode_file"
|
||||
path = "examples/encode_file.rs"
|
||||
|
||||
[[example]]
|
||||
name = "transcode"
|
||||
path = "examples/transcode.rs"
|
||||
|
||||
2
third_party/rust/ron/README.md
vendored
2
third_party/rust/ron/README.md
vendored
@@ -176,6 +176,8 @@ fn main() {
|
||||
|
||||
## Limitations
|
||||
|
||||
RON requires struct, enum, and variant names to be valid Rust identifiers and will reject invalid ones created by `#[serde(rename = "...")]` at serialization / deserialization time.
|
||||
|
||||
RON is not designed to be a fully self-describing format (unlike JSON) and is thus not guaranteed to work when [`deserialize_any`](https://docs.rs/serde/latest/serde/trait.Deserializer.html#tymethod.deserialize_any) is used instead of its typed alternatives. In particular, the following Serde attributes only have limited support:
|
||||
|
||||
- `#[serde(tag = "tag")]`, i.e. internally tagged enums [^serde-enum-hack]
|
||||
|
||||
60
third_party/rust/ron/examples/encode_file.rs
vendored
Normal file
60
third_party/rust/ron/examples/encode_file.rs
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use std::{collections::HashMap, fs::File};
|
||||
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
struct Config {
|
||||
boolean: bool,
|
||||
float: f32,
|
||||
map: HashMap<u8, char>,
|
||||
nested: Nested,
|
||||
tuple: (u32, u32),
|
||||
vec: Vec<Nested>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
struct Nested {
|
||||
a: String,
|
||||
b: char,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let config = Config {
|
||||
boolean: true,
|
||||
float: 8.2,
|
||||
map: [(1, '1'), (2, '4'), (3, '9'), (4, '1'), (5, '2'), (6, '3')]
|
||||
.into_iter()
|
||||
.collect(),
|
||||
nested: Nested {
|
||||
a: String::from("Decode me!"),
|
||||
b: 'z',
|
||||
},
|
||||
tuple: (3, 7),
|
||||
vec: vec![
|
||||
Nested {
|
||||
a: String::from("Nested 1"),
|
||||
b: 'x',
|
||||
},
|
||||
Nested {
|
||||
a: String::from("Nested 2"),
|
||||
b: 'y',
|
||||
},
|
||||
Nested {
|
||||
a: String::from("Nested 3"),
|
||||
b: 'z',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
let f = File::options()
|
||||
.create(true)
|
||||
.write(true)
|
||||
.open("example-out.ron")
|
||||
.expect("Failed opening file");
|
||||
|
||||
ron::Options::default()
|
||||
.to_io_writer_pretty(f, &config, ron::ser::PrettyConfig::new())
|
||||
.expect("Failed to write to file");
|
||||
}
|
||||
2
third_party/rust/ron/src/lib.rs
vendored
2
third_party/rust/ron/src/lib.rs
vendored
@@ -13,7 +13,7 @@
|
||||
#![deny(unsafe_code)]
|
||||
#![allow(clippy::missing_errors_doc)] // FIXME
|
||||
#![doc = include_str!("../README.md")]
|
||||
#![doc(html_root_url = "https://docs.rs/ron/0.9.0")]
|
||||
#![doc(html_root_url = "https://docs.rs/ron/0.10.1")]
|
||||
|
||||
pub mod de;
|
||||
pub mod ser;
|
||||
|
||||
57
third_party/rust/ron/src/options.rs
vendored
57
third_party/rust/ron/src/options.rs
vendored
@@ -211,6 +211,45 @@ impl Options {
|
||||
value.serialize(&mut s)
|
||||
}
|
||||
|
||||
/// Serializes `value` into `writer`.
|
||||
///
|
||||
/// This function does not generate any newlines or nice formatting;
|
||||
/// if you want that, you can use
|
||||
/// [`to_io_writer_pretty`][Self::to_io_writer_pretty] instead.
|
||||
pub fn to_io_writer<W, T>(&self, writer: W, value: &T) -> Result<()>
|
||||
where
|
||||
W: io::Write,
|
||||
T: ?Sized + ser::Serialize,
|
||||
{
|
||||
let mut adapter = Adapter {
|
||||
writer,
|
||||
error: Ok(()),
|
||||
};
|
||||
let result = self.to_writer(&mut adapter, value);
|
||||
adapter.error?;
|
||||
result
|
||||
}
|
||||
|
||||
/// Serializes `value` into `writer` in a pretty way.
|
||||
pub fn to_io_writer_pretty<W, T>(
|
||||
&self,
|
||||
writer: W,
|
||||
value: &T,
|
||||
config: PrettyConfig,
|
||||
) -> Result<()>
|
||||
where
|
||||
W: io::Write,
|
||||
T: ?Sized + ser::Serialize,
|
||||
{
|
||||
let mut adapter = Adapter {
|
||||
writer,
|
||||
error: Ok(()),
|
||||
};
|
||||
let result = self.to_writer_pretty(&mut adapter, value, config);
|
||||
adapter.error?;
|
||||
result
|
||||
}
|
||||
|
||||
/// Serializes `value` and returns it as string.
|
||||
///
|
||||
/// This function does not generate any newlines or nice formatting;
|
||||
@@ -237,3 +276,21 @@ impl Options {
|
||||
Ok(output)
|
||||
}
|
||||
}
|
||||
|
||||
// Adapter from io::Write to fmt::Write that keeps the error
|
||||
struct Adapter<W: io::Write> {
|
||||
writer: W,
|
||||
error: io::Result<()>,
|
||||
}
|
||||
|
||||
impl<T: io::Write> fmt::Write for Adapter<T> {
|
||||
fn write_str(&mut self, s: &str) -> fmt::Result {
|
||||
match self.writer.write_all(s.as_bytes()) {
|
||||
Ok(()) => Ok(()),
|
||||
Err(e) => {
|
||||
self.error = Err(e);
|
||||
Err(fmt::Error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
42
third_party/rust/ron/src/value/number.rs
vendored
42
third_party/rust/ron/src/value/number.rs
vendored
@@ -5,8 +5,34 @@ use std::{
|
||||
|
||||
use serde::{de::Visitor, Serialize, Serializer};
|
||||
|
||||
/// A wrapper for any numeric primitive type in Rust
|
||||
/// A wrapper for any numeric primitive type in Rust.
|
||||
///
|
||||
/// Some varints of the `Number` enum are enabled by features:
|
||||
/// - `Number::I128` and `Number::U128` by the `integer128` feature
|
||||
///
|
||||
/// To ensure that feature unification does not break `match`ing over `Number`,
|
||||
/// the `Number` enum is non-exhaustive.
|
||||
///
|
||||
/// <details>
|
||||
/// <summary>Exhaustively matching on <code>Number</code> in tests</summary>
|
||||
///
|
||||
/// If you want to ensure that you exhaustively handle every variant, you can
|
||||
/// match on the hidden `Number::__NonExhaustive` variant.
|
||||
///
|
||||
/// <div class="warning">
|
||||
/// Matching on this variant means that your code may break when RON is
|
||||
/// upgraded or when feature unification enables further variants in the
|
||||
/// <code>Number</code> enum than your code expects.
|
||||
/// </div>
|
||||
///
|
||||
/// It is your responsibility to only *ever* match on `Number::__NonExhaustive`
|
||||
/// inside tests, e.g. by using `#[cfg(test)]` on the particular match arm, to
|
||||
/// ensure that only your tests break (e.g. in CI) when your code is not
|
||||
/// exhaustively matching on every variant, e.g. after a version upgrade or
|
||||
/// feature unification.
|
||||
/// </details>
|
||||
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Hash, Ord)]
|
||||
#[cfg_attr(doc, non_exhaustive)]
|
||||
pub enum Number {
|
||||
I8(i8),
|
||||
I16(i16),
|
||||
@@ -22,6 +48,14 @@ pub enum Number {
|
||||
U128(u128),
|
||||
F32(F32),
|
||||
F64(F64),
|
||||
#[cfg(not(doc))]
|
||||
#[allow(private_interfaces)]
|
||||
__NonExhaustive(private::Never),
|
||||
}
|
||||
|
||||
mod private {
|
||||
#[derive(Copy, Clone, Debug, PartialEq, PartialOrd, Eq, Hash, Ord)]
|
||||
pub enum Never {}
|
||||
}
|
||||
|
||||
impl Serialize for Number {
|
||||
@@ -41,6 +75,8 @@ impl Serialize for Number {
|
||||
Self::U128(v) => serializer.serialize_u128(*v),
|
||||
Self::F32(v) => serializer.serialize_f32(v.get()),
|
||||
Self::F64(v) => serializer.serialize_f64(v.get()),
|
||||
#[cfg(not(doc))]
|
||||
Self::__NonExhaustive(never) => match *never {},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,6 +101,8 @@ impl Number {
|
||||
Self::U128(v) => visitor.visit_u128(*v),
|
||||
Self::F32(v) => visitor.visit_f32(v.get()),
|
||||
Self::F64(v) => visitor.visit_f64(v.get()),
|
||||
#[cfg(not(doc))]
|
||||
Self::__NonExhaustive(never) => match *never {},
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,6 +254,8 @@ impl Number {
|
||||
Number::U128(v) => v as f64,
|
||||
Number::F32(v) => f64::from(v.get()),
|
||||
Number::F64(v) => v.get(),
|
||||
#[cfg(not(doc))]
|
||||
Self::__NonExhaustive(never) => match never {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user