Skip to content

Commit

Permalink
Bump the Rust version to 1.84.0, but MSR remains the same. (#2422)
Browse files Browse the repository at this point in the history
In line with our Rust version policy, this matches a current mozilla-central.
  • Loading branch information
mhammond authored Feb 5, 2025
1 parent fb539bb commit 5b8fa52
Show file tree
Hide file tree
Showing 32 changed files with 346 additions and 106 deletions.
1 change: 1 addition & 0 deletions fixtures/callbacks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ impl Default for RustGetters {
#[allow(clippy::wrong_self_convention)]
trait StoredForeignStringifier: Send + Sync + std::fmt::Debug {
fn from_simple_type(&self, value: i32) -> String;
#[allow(dead_code)]
fn from_complex_type(&self, values: Option<Vec<Option<f64>>>) -> String;
}

Expand Down
2 changes: 2 additions & 0 deletions fixtures/keywords/kotlin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* 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/. */

#![allow(dead_code)]

use std::{collections::HashMap, sync::Arc};

pub fn r#if(_object: u8) {}
Expand Down
2 changes: 1 addition & 1 deletion fixtures/uitests/src/lib.rs
Original file line number Diff line number Diff line change
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 http://mozilla.org/MPL/2.0/. */

/// This crate only exists for its tests.
//! This crate only exists for its tests.
#[cfg(test)]
mod test {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
error[E0533]: expected value, found struct variant `Self::DivisionByZero`
--> $OUT_DIR[uniffi_uitests]/errors.uniffi.rs
|
| #[::uniffi::udl_derive(Error)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a value
|
= note: this error originates in the attribute macro `::uniffi::udl_derive` (in Nightly builds, run with -Z macro-backtrace for more info)
--> $OUT_DIR[uniffi_uitests]/errors.uniffi.rs
|
| #[::uniffi::udl_derive(Error)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a value
|
= note: this error originates in the attribute macro `::uniffi::udl_derive` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to create a new value of the struct
|
29 | #[::uniffi::udl_derive(Error)] { numerator: /* value */ }
| ++++++++++++++++++++++++++
52 changes: 48 additions & 4 deletions fixtures/uitests/tests/ui/interface_not_sync_and_send.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0277]: `Cell<u32>` cannot be shared between threads safely
| struct r#Counter { }
| ^^^^^^^^^ `Cell<u32>` cannot be shared between threads safely
|
= help: within `Counter`, the trait `Sync` is not implemented for `Cell<u32>`, which is required by `Counter: Sync`
= help: within `Counter`, the trait `Sync` is not implemented for `Cell<u32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicU32` instead
note: required because it appears within the type `Counter`
--> tests/ui/interface_not_sync_and_send.rs:9:12
Expand All @@ -24,7 +24,7 @@ error[E0277]: `Cell<u32>` cannot be shared between threads safely
| struct r#Counter { }
| ^^^^^^^^^ `Cell<u32>` cannot be shared between threads safely
|
= help: within `Counter`, the trait `Sync` is not implemented for `Cell<u32>`, which is required by `Counter: Sync`
= help: within `Counter`, the trait `Sync` is not implemented for `Cell<u32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicU32` instead
note: required because it appears within the type `Counter`
--> tests/ui/interface_not_sync_and_send.rs:9:12
Expand All @@ -43,7 +43,7 @@ error[E0277]: `Cell<u32>` cannot be shared between threads safely
27 | pub struct ProcMacroCounter {
| ^^^^^^^^^^^^^^^^ `Cell<u32>` cannot be shared between threads safely
|
= help: within `ProcMacroCounter`, the trait `Sync` is not implemented for `Cell<u32>`, which is required by `ProcMacroCounter: Sync`
= help: within `ProcMacroCounter`, the trait `Sync` is not implemented for `Cell<u32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicU32` instead
note: required because it appears within the type `ProcMacroCounter`
--> tests/ui/interface_not_sync_and_send.rs:27:12
Expand All @@ -63,7 +63,7 @@ error[E0277]: `Cell<u32>` cannot be shared between threads safely
27 | pub struct ProcMacroCounter {
| ^^^^^^^^^^^^^^^^ `Cell<u32>` cannot be shared between threads safely
|
= help: within `ProcMacroCounter`, the trait `Sync` is not implemented for `Cell<u32>`, which is required by `ProcMacroCounter: Sync`
= help: within `ProcMacroCounter`, the trait `Sync` is not implemented for `Cell<u32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicU32` instead
note: required because it appears within the type `ProcMacroCounter`
--> tests/ui/interface_not_sync_and_send.rs:27:12
Expand All @@ -75,3 +75,47 @@ note: required by a bound in `FfiConverterArc`
|
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
| ^^^^ required by this bound in `FfiConverterArc`

error[E0277]: `Cell<u32>` cannot be shared between threads safely
--> $OUT_DIR[uniffi_uitests]/counter.uniffi.rs
|
| #[::uniffi::udl_derive(Object)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Cell<u32>` cannot be shared between threads safely
|
= help: within `Counter`, the trait `Sync` is not implemented for `Cell<u32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicU32` instead
note: required because it appears within the type `Counter`
--> tests/ui/interface_not_sync_and_send.rs:9:12
|
9 | pub struct Counter {
| ^^^^^^^
note: required by a bound in `uniffi::FfiConverterArc::FfiType`
--> $WORKSPACE/uniffi_core/src/ffi_converter_traits.rs
|
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
| ^^^^ required by this bound in `FfiConverterArc::FfiType`
| type FfiType: FfiDefault;
| ------- required by a bound in this associated type
= note: this error originates in the attribute macro `::uniffi::udl_derive` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `Cell<u32>` cannot be shared between threads safely
--> tests/ui/interface_not_sync_and_send.rs:26:10
|
26 | #[derive(uniffi::Object)]
| ^^^^^^^^^^^^^^ `Cell<u32>` cannot be shared between threads safely
|
= help: within `ProcMacroCounter`, the trait `Sync` is not implemented for `Cell<u32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicU32` instead
note: required because it appears within the type `ProcMacroCounter`
--> tests/ui/interface_not_sync_and_send.rs:27:12
|
27 | pub struct ProcMacroCounter {
| ^^^^^^^^^^^^^^^^
note: required by a bound in `uniffi::FfiConverterArc::FfiType`
--> $WORKSPACE/uniffi_core/src/ffi_converter_traits.rs
|
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
| ^^^^ required by this bound in `FfiConverterArc::FfiType`
| type FfiType: FfiDefault;
| ------- required by a bound in this associated type
= note: this error originates in the derive macro `uniffi::Object` (in Nightly builds, run with -Z macro-backtrace for more info)
64 changes: 64 additions & 0 deletions fixtures/uitests/tests/ui/interface_trait_not_sync_and_send.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,67 @@ note: required by a bound in `FfiConverterArc`
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
| ^^^^ required by this bound in `FfiConverterArc`
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `(dyn Trait + 'static)` cannot be sent between threads safely
--> $OUT_DIR[uniffi_uitests]/trait.uniffi.rs
|
| #[::uniffi::export_for_udl]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Trait + 'static)` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `(dyn Trait + 'static)`
note: required by a bound in `uniffi::FfiConverterArc::FfiType`
--> $WORKSPACE/uniffi_core/src/ffi_converter_traits.rs
|
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
| ^^^^ required by this bound in `FfiConverterArc::FfiType`
| type FfiType: FfiDefault;
| ------- required by a bound in this associated type
= note: this error originates in the attribute macro `::uniffi::export_for_udl` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `(dyn Trait + 'static)` cannot be shared between threads safely
--> $OUT_DIR[uniffi_uitests]/trait.uniffi.rs
|
| #[::uniffi::export_for_udl]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Trait + 'static)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn Trait + 'static)`
note: required by a bound in `uniffi::FfiConverterArc::FfiType`
--> $WORKSPACE/uniffi_core/src/ffi_converter_traits.rs
|
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
| ^^^^ required by this bound in `FfiConverterArc::FfiType`
| type FfiType: FfiDefault;
| ------- required by a bound in this associated type
= note: this error originates in the attribute macro `::uniffi::export_for_udl` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `(dyn ProcMacroTrait + 'static)` cannot be sent between threads safely
--> tests/ui/interface_trait_not_sync_and_send.rs:11:1
|
11 | #[uniffi::export]
| ^^^^^^^^^^^^^^^^^ `(dyn ProcMacroTrait + 'static)` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `(dyn ProcMacroTrait + 'static)`
note: required by a bound in `uniffi::FfiConverterArc::FfiType`
--> $WORKSPACE/uniffi_core/src/ffi_converter_traits.rs
|
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
| ^^^^ required by this bound in `FfiConverterArc::FfiType`
| type FfiType: FfiDefault;
| ------- required by a bound in this associated type
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `(dyn ProcMacroTrait + 'static)` cannot be shared between threads safely
--> tests/ui/interface_trait_not_sync_and_send.rs:11:1
|
11 | #[uniffi::export]
| ^^^^^^^^^^^^^^^^^ `(dyn ProcMacroTrait + 'static)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn ProcMacroTrait + 'static)`
note: required by a bound in `uniffi::FfiConverterArc::FfiType`
--> $WORKSPACE/uniffi_core/src/ffi_converter_traits.rs
|
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
| ^^^^ required by this bound in `FfiConverterArc::FfiType`
| type FfiType: FfiDefault;
| ------- required by a bound in this associated type
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info)
87 changes: 70 additions & 17 deletions fixtures/uitests/tests/ui/invalid_types_in_signatures.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,86 @@ error[E0277]: the trait bound `Result<(), ErrorType>: Lift<UniFfiTag>` is not sa
| ^^^^^^^^^^^^^^^^^ the trait `Lift<UniFfiTag>` is not implemented for `Result<(), ErrorType>`
|
= help: the following other types implement trait `Lift<UT>`:
bool
i8
i16
i32
i64
u8
u16
u32
Arc<T>
Duration
ErrorType
HashMap<K, V>
Option<T>
String
SystemTime
Vec<T>
and $N others
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Result<(), ErrorType>: Lower<UniFfiTag>` is not satisfied
--> tests/ui/invalid_types_in_signatures.rs:20:1
|
20 | #[uniffi::export]
| ^^^^^^^^^^^^^^^^^ the trait `Lower<UniFfiTag>` is not implemented for `Result<(), ErrorType>`, which is required by `Option<Result<(), ErrorType>>: LowerReturn<UniFfiTag>`
| ^^^^^^^^^^^^^^^^^ the trait `Lower<UniFfiTag>` is not implemented for `Result<(), ErrorType>`
|
= help: the following other types implement trait `Lower<UT>`:
bool
i8
i16
i32
i64
u8
u16
u32
Arc<T>
Duration
ErrorType
HashMap<K, V>
Option<T>
String
SystemTime
Vec<T>
and $N others
= note: required for `Option<Result<(), ErrorType>>` to implement `Lower<UniFfiTag>`
= note: required for `Option<Result<(), ErrorType>>` to implement `LowerReturn<UniFfiTag>`
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Result<(), ErrorType>: Lift<UniFfiTag>` is not satisfied
--> tests/ui/invalid_types_in_signatures.rs:18:25
|
18 | pub fn input_result(_r: Result<(), ErrorType>) { }
| ^^^^^^^^^^^^^^^^^^^^^ the trait `Lift<UniFfiTag>` is not implemented for `Result<(), ErrorType>`
|
= help: the following other types implement trait `Lift<UT>`:
Arc<T>
Duration
ErrorType
HashMap<K, V>
Option<T>
String
SystemTime
Vec<T>
and $N others

error[E0277]: the trait bound `Result<(), ErrorType>: Lift<UniFfiTag>` is not satisfied
--> tests/ui/invalid_types_in_signatures.rs:18:21
|
18 | pub fn input_result(_r: Result<(), ErrorType>) { }
| ^^ the trait `Lift<UniFfiTag>` is not implemented for `Result<(), ErrorType>`
|
= help: the following other types implement trait `Lift<UT>`:
Arc<T>
Duration
ErrorType
HashMap<K, V>
Option<T>
String
SystemTime
Vec<T>
and $N others

error[E0277]: the trait bound `Result<(), ErrorType>: Lower<UniFfiTag>` is not satisfied
--> tests/ui/invalid_types_in_signatures.rs:20:1
|
20 | #[uniffi::export]
| ^^^^^^^^^^^^^^^^^ the trait `Lower<UniFfiTag>` is not implemented for `Result<(), ErrorType>`
|
= help: the following other types implement trait `Lower<UT>`:
Arc<T>
Duration
ErrorType
HashMap<K, V>
Option<T>
String
SystemTime
Vec<T>
and $N others
= note: required for `Option<Result<(), ErrorType>>` to implement `Lower<UniFfiTag>`
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info)
Loading

0 comments on commit 5b8fa52

Please sign in to comment.