diff --git a/Cargo.lock b/Cargo.lock index 4490ef3505b..625905a7e70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -874,12 +874,12 @@ dependencies = [ [[package]] name = "ctor" -version = "0.2.8" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" +checksum = "914a755b7c2d4af2bdcff7ce1739e2db9a1b81a9b07123d8015786ae03c0980d" dependencies = [ - "quote", - "syn 2.0.106", + "link-section", + "linktime-proc-macro", ] [[package]] @@ -2457,12 +2457,24 @@ dependencies = [ "cc", ] +[[package]] +name = "link-section" +version = "0.19.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39c29a617ce3df32c08497bdc1ab6e2376e0b17948ac166a2fbe5977c5954cd9" + [[package]] name = "linked-hash-map" version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +[[package]] +name = "linktime-proc-macro" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e57c38c1e860fd37c604281cdfb1dd2216977fd76a50f85ba2f388ef3219616" + [[package]] name = "linux-raw-sys" version = "0.1.4" @@ -3090,7 +3102,7 @@ dependencies = [ "serde", "serde_derive", "thiserror 2.0.3", - "toml 0.5.9", + "toml 0.9.6", ] [[package]] diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 005430c89c9..f534e067ee1 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -577,7 +577,6 @@ The following text applies to code linked from these dependencies: [thiserror-impl](https://github.com/dtolnay/thiserror), [thiserror](https://github.com/dtolnay/thiserror), [thread_local](https://github.com/Amanieu/thread_local-rs), -[toml](https://github.com/alexcrichton/toml-rs), [toml](https://github.com/toml-rs/toml), [toml_datetime](https://github.com/toml-rs/toml), [toml_parser](https://github.com/toml-rs/toml), diff --git a/components/example/src/error.rs b/components/example/src/error.rs index f9227345cf5..709ce886aae 100644 --- a/components/example/src/error.rs +++ b/components/example/src/error.rs @@ -14,7 +14,7 @@ use error_support::{ErrorHandling, GetErrorHandling}; /// reexport helpers for logging. -pub use error_support::{error, trace}; +pub use error_support::trace; /// Result type for internal errors. Since most code uses internal errors, we just call this one /// `Result`. diff --git a/components/logins/src/encryption.rs b/components/logins/src/encryption.rs index c1b48121a97..e009c26ed15 100644 --- a/components/logins/src/encryption.rs +++ b/components/logins/src/encryption.rs @@ -48,6 +48,9 @@ // change at runtime and is already present when the LoginsStore is initialized. In this case, it // makes sense to use the provided StaticKeyManager. +// work around not yet having https://github.com/mozilla/uniffi-rs/pull/2963. +#![allow(const_evaluatable_unchecked)] + use crate::error::*; use std::sync::Arc; diff --git a/components/nimbus/Cargo.toml b/components/nimbus/Cargo.toml index e53ab14f05d..22fe683b84b 100644 --- a/components/nimbus/Cargo.toml +++ b/components/nimbus/Cargo.toml @@ -48,4 +48,4 @@ uniffi = { version = "0.31", features = ["build"] } error-support = { path = "../support/error", features = ["testing"] } clap = { version = "4.2", default-features = false, features = ["std", "derive"] } tempfile = "3" -ctor = "0.2.2" +ctor = "1" diff --git a/components/nimbus/src/tests/helpers.rs b/components/nimbus/src/tests/helpers.rs index c2065c0f077..41db485398c 100644 --- a/components/nimbus/src/tests/helpers.rs +++ b/components/nimbus/src/tests/helpers.rs @@ -37,7 +37,7 @@ use crate::{ TargetingAttributes, }; -#[ctor::ctor] +#[ctor::ctor(unsafe)] fn init() { error_support::init_for_tests_with_level(error_support::Level::Info); } diff --git a/components/places/src/storage/history_metadata.rs b/components/places/src/storage/history_metadata.rs index 45339b9e827..a89db967097 100644 --- a/components/places/src/storage/history_metadata.rs +++ b/components/places/src/storage/history_metadata.rs @@ -134,10 +134,7 @@ impl HistoryMetadata { // encountering it. // See `apply_metadata_observation` for where we guard against observing invalid view times. let total_view_time: i64 = row.get("total_view_time")?; - let total_view_time = match i32::try_from(total_view_time) { - Ok(tvt) => tvt, - Err(_) => i32::MAX, - }; + let total_view_time = i32::try_from(total_view_time).unwrap_or(i32::MAX); Ok(Self { url: row.get("url")?, diff --git a/components/support/error/tests/macro_arguments.stderr b/components/support/error/tests/macro_arguments.stderr index 14d3bfd074f..24488fe1bef 100644 --- a/components/support/error/tests/macro_arguments.stderr +++ b/components/support/error/tests/macro_arguments.stderr @@ -60,9 +60,14 @@ error[E0277]: the trait bound `String: GetErrorHandling` is not satisfied 112 | #[handle_error(String)] // Must implement `std::error::Error` | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `GetErrorHandling` is not implemented for `String` | - = help: the following other types implement trait `GetErrorHandling`: - Error - Error2 +help: the following other types implement trait `GetErrorHandling` + --> macro_arguments.rs:29:2 + | + 29 | impl GetErrorHandling for Error { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Error` +... + 85 | impl GetErrorHandling for Error2 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Error2` note: required by a bound in `convert_log_report_error` --> $WORKSPACE/components/support/error/src/handling.rs | diff --git a/components/support/rc_crypto/src/agreement.rs b/components/support/rc_crypto/src/agreement.rs index fefd6c77314..7edc41ac9bc 100644 --- a/components/support/rc_crypto/src/agreement.rs +++ b/components/support/rc_crypto/src/agreement.rs @@ -394,11 +394,10 @@ mod tests { .agree_static(&UnparsedPublicKey::new(&ECDH_P256, &invalid_pub_key)) .is_err()); - let mut invalid_pub_key = [0u8; 65]; + let invalid_pub_key = [0u8; 65]; assert!(prv_key .agree_static(&UnparsedPublicKey::new(&ECDH_P256, &invalid_pub_key)) .is_err()); - invalid_pub_key[0] = 0x04; let mut invalid_pub_key = URL_SAFE_NO_PAD.decode(PUB_KEY_1_B64).unwrap().to_vec(); invalid_pub_key = invalid_pub_key[0..64].to_vec(); diff --git a/components/sync15/src/client/request.rs b/components/sync15/src/client/request.rs index e21629fe775..1ae3f5ba614 100644 --- a/components/sync15/src/client/request.rs +++ b/components/sync15/src/client/request.rs @@ -601,7 +601,12 @@ mod test { } }; - if self.cur_batch.is_none() { + if let Some(cur_batch) = &self.cur_batch { + assert_eq!( + batch, cur_batch.id, + "We're in a batch but got the wrong batch id" + ); + } else { assert!( batch.is_none() || batch == Some("true".into()), "We shouldn't be in a batch now" @@ -612,12 +617,6 @@ mod test { records: 0, bytes: 0, }); - } else { - assert_eq!( - batch, - self.cur_batch.as_ref().unwrap().id, - "We're in a batch but got the wrong batch id" - ); } { diff --git a/components/viaduct/src/backend.rs b/components/viaduct/src/backend.rs index 60ff9650cfe..933da22ca6c 100644 --- a/components/viaduct/src/backend.rs +++ b/components/viaduct/src/backend.rs @@ -3,6 +3,9 @@ * * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +// work around not yet having https://github.com/mozilla/uniffi-rs/pull/2963. +#![allow(const_evaluatable_unchecked)] + use std::sync::{Arc, OnceLock}; use crate::{ClientSettings, Request, Response, Result, ViaductError}; diff --git a/megazords/full/DEPENDENCIES.md b/megazords/full/DEPENDENCIES.md index b569717c485..1054bc1de91 100644 --- a/megazords/full/DEPENDENCIES.md +++ b/megazords/full/DEPENDENCIES.md @@ -541,7 +541,6 @@ The following text applies to code linked from these dependencies: [thiserror-impl](https://github.com/dtolnay/thiserror), [thiserror](https://github.com/dtolnay/thiserror), [thread_local](https://github.com/Amanieu/thread_local-rs), -[toml](https://github.com/alexcrichton/toml-rs), [toml](https://github.com/toml-rs/toml), [toml_datetime](https://github.com/toml-rs/toml), [toml_parser](https://github.com/toml-rs/toml), diff --git a/megazords/full/android/dependency-licenses.xml b/megazords/full/android/dependency-licenses.xml index 6dc0de05db4..afb007df119 100644 --- a/megazords/full/android/dependency-licenses.xml +++ b/megazords/full/android/dependency-licenses.xml @@ -484,10 +484,6 @@ the details of which are reproduced below. Apache License 2.0: thread_local https://github.com/Amanieu/thread_local-rs/blob/master/LICENSE-APACHE - - Apache License 2.0: toml - https://github.com/alexcrichton/toml-rs/blob/master/LICENSE-APACHE - Apache License 2.0: toml https://github.com/toml-rs/toml/blob/main/LICENSE-APACHE diff --git a/megazords/ios-rust/DEPENDENCIES.md b/megazords/ios-rust/DEPENDENCIES.md index 8fac43660a6..f115d320a79 100644 --- a/megazords/ios-rust/DEPENDENCIES.md +++ b/megazords/ios-rust/DEPENDENCIES.md @@ -563,7 +563,6 @@ The following text applies to code linked from these dependencies: [thiserror-impl](https://github.com/dtolnay/thiserror), [thiserror](https://github.com/dtolnay/thiserror), [thread_local](https://github.com/Amanieu/thread_local-rs), -[toml](https://github.com/alexcrichton/toml-rs), [toml](https://github.com/toml-rs/toml), [toml_datetime](https://github.com/toml-rs/toml), [toml_parser](https://github.com/toml-rs/toml), diff --git a/megazords/ios-rust/focus/DEPENDENCIES.md b/megazords/ios-rust/focus/DEPENDENCIES.md index e493fd77c51..e298dd8cb5e 100644 --- a/megazords/ios-rust/focus/DEPENDENCIES.md +++ b/megazords/ios-rust/focus/DEPENDENCIES.md @@ -499,7 +499,6 @@ The following text applies to code linked from these dependencies: [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs), [libc](https://github.com/rust-lang/libc), [libm](https://github.com/rust-lang/libm), -[linux-raw-sys](https://github.com/sunfishcode/linux-raw-sys), [lock_api](https://github.com/Amanieu/parking_lot), [log](https://github.com/rust-lang/log), [minimal-lexical](https://github.com/Alexhuszagh/minimal-lexical), @@ -546,7 +545,6 @@ The following text applies to code linked from these dependencies: [thiserror-impl](https://github.com/dtolnay/thiserror), [thiserror](https://github.com/dtolnay/thiserror), [thread_local](https://github.com/Amanieu/thread_local-rs), -[toml](https://github.com/alexcrichton/toml-rs), [toml](https://github.com/toml-rs/toml), [toml_datetime](https://github.com/toml-rs/toml), [toml_parser](https://github.com/toml-rs/toml), diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 82d044c3f3d..7fb801d3d77 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -7,7 +7,7 @@ # supported and used in CI. [toolchain] -channel = "1.91.0" +channel = "1.94.0" targets = [ "aarch64-linux-android", "armv7-linux-androideabi",