Skip to content

Commit 5b8fa52

Browse files
authored
Bump the Rust version to 1.84.0, but MSR remains the same. (#2422)
In line with our Rust version policy, this matches a current mozilla-central.
1 parent fb539bb commit 5b8fa52

32 files changed

+346
-106
lines changed

fixtures/callbacks/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ impl Default for RustGetters {
103103
#[allow(clippy::wrong_self_convention)]
104104
trait StoredForeignStringifier: Send + Sync + std::fmt::Debug {
105105
fn from_simple_type(&self, value: i32) -> String;
106+
#[allow(dead_code)]
106107
fn from_complex_type(&self, values: Option<Vec<Option<f64>>>) -> String;
107108
}
108109

fixtures/keywords/kotlin/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
#![allow(dead_code)]
6+
57
use std::{collections::HashMap, sync::Arc};
68

79
pub fn r#if(_object: u8) {}

fixtures/uitests/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
/// This crate only exists for its tests.
5+
//! This crate only exists for its tests.
66
77
#[cfg(test)]
88
mod test {
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
error[E0533]: expected value, found struct variant `Self::DivisionByZero`
2-
--> $OUT_DIR[uniffi_uitests]/errors.uniffi.rs
3-
|
4-
| #[::uniffi::udl_derive(Error)]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a value
6-
|
7-
= note: this error originates in the attribute macro `::uniffi::udl_derive` (in Nightly builds, run with -Z macro-backtrace for more info)
2+
--> $OUT_DIR[uniffi_uitests]/errors.uniffi.rs
3+
|
4+
| #[::uniffi::udl_derive(Error)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a value
6+
|
7+
= note: this error originates in the attribute macro `::uniffi::udl_derive` (in Nightly builds, run with -Z macro-backtrace for more info)
8+
help: you might have meant to create a new value of the struct
9+
|
10+
29 | #[::uniffi::udl_derive(Error)] { numerator: /* value */ }
11+
| ++++++++++++++++++++++++++

fixtures/uitests/tests/ui/interface_not_sync_and_send.stderr

+48-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0277]: `Cell<u32>` cannot be shared between threads safely
44
| struct r#Counter { }
55
| ^^^^^^^^^ `Cell<u32>` cannot be shared between threads safely
66
|
7-
= help: within `Counter`, the trait `Sync` is not implemented for `Cell<u32>`, which is required by `Counter: Sync`
7+
= help: within `Counter`, the trait `Sync` is not implemented for `Cell<u32>`
88
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicU32` instead
99
note: required because it appears within the type `Counter`
1010
--> tests/ui/interface_not_sync_and_send.rs:9:12
@@ -24,7 +24,7 @@ error[E0277]: `Cell<u32>` cannot be shared between threads safely
2424
| struct r#Counter { }
2525
| ^^^^^^^^^ `Cell<u32>` cannot be shared between threads safely
2626
|
27-
= help: within `Counter`, the trait `Sync` is not implemented for `Cell<u32>`, which is required by `Counter: Sync`
27+
= help: within `Counter`, the trait `Sync` is not implemented for `Cell<u32>`
2828
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicU32` instead
2929
note: required because it appears within the type `Counter`
3030
--> tests/ui/interface_not_sync_and_send.rs:9:12
@@ -43,7 +43,7 @@ error[E0277]: `Cell<u32>` cannot be shared between threads safely
4343
27 | pub struct ProcMacroCounter {
4444
| ^^^^^^^^^^^^^^^^ `Cell<u32>` cannot be shared between threads safely
4545
|
46-
= help: within `ProcMacroCounter`, the trait `Sync` is not implemented for `Cell<u32>`, which is required by `ProcMacroCounter: Sync`
46+
= help: within `ProcMacroCounter`, the trait `Sync` is not implemented for `Cell<u32>`
4747
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicU32` instead
4848
note: required because it appears within the type `ProcMacroCounter`
4949
--> tests/ui/interface_not_sync_and_send.rs:27:12
@@ -63,7 +63,7 @@ error[E0277]: `Cell<u32>` cannot be shared between threads safely
6363
27 | pub struct ProcMacroCounter {
6464
| ^^^^^^^^^^^^^^^^ `Cell<u32>` cannot be shared between threads safely
6565
|
66-
= help: within `ProcMacroCounter`, the trait `Sync` is not implemented for `Cell<u32>`, which is required by `ProcMacroCounter: Sync`
66+
= help: within `ProcMacroCounter`, the trait `Sync` is not implemented for `Cell<u32>`
6767
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicU32` instead
6868
note: required because it appears within the type `ProcMacroCounter`
6969
--> tests/ui/interface_not_sync_and_send.rs:27:12
@@ -75,3 +75,47 @@ note: required by a bound in `FfiConverterArc`
7575
|
7676
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
7777
| ^^^^ required by this bound in `FfiConverterArc`
78+
79+
error[E0277]: `Cell<u32>` cannot be shared between threads safely
80+
--> $OUT_DIR[uniffi_uitests]/counter.uniffi.rs
81+
|
82+
| #[::uniffi::udl_derive(Object)]
83+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Cell<u32>` cannot be shared between threads safely
84+
|
85+
= help: within `Counter`, the trait `Sync` is not implemented for `Cell<u32>`
86+
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicU32` instead
87+
note: required because it appears within the type `Counter`
88+
--> tests/ui/interface_not_sync_and_send.rs:9:12
89+
|
90+
9 | pub struct Counter {
91+
| ^^^^^^^
92+
note: required by a bound in `uniffi::FfiConverterArc::FfiType`
93+
--> $WORKSPACE/uniffi_core/src/ffi_converter_traits.rs
94+
|
95+
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
96+
| ^^^^ required by this bound in `FfiConverterArc::FfiType`
97+
| type FfiType: FfiDefault;
98+
| ------- required by a bound in this associated type
99+
= note: this error originates in the attribute macro `::uniffi::udl_derive` (in Nightly builds, run with -Z macro-backtrace for more info)
100+
101+
error[E0277]: `Cell<u32>` cannot be shared between threads safely
102+
--> tests/ui/interface_not_sync_and_send.rs:26:10
103+
|
104+
26 | #[derive(uniffi::Object)]
105+
| ^^^^^^^^^^^^^^ `Cell<u32>` cannot be shared between threads safely
106+
|
107+
= help: within `ProcMacroCounter`, the trait `Sync` is not implemented for `Cell<u32>`
108+
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicU32` instead
109+
note: required because it appears within the type `ProcMacroCounter`
110+
--> tests/ui/interface_not_sync_and_send.rs:27:12
111+
|
112+
27 | pub struct ProcMacroCounter {
113+
| ^^^^^^^^^^^^^^^^
114+
note: required by a bound in `uniffi::FfiConverterArc::FfiType`
115+
--> $WORKSPACE/uniffi_core/src/ffi_converter_traits.rs
116+
|
117+
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
118+
| ^^^^ required by this bound in `FfiConverterArc::FfiType`
119+
| type FfiType: FfiDefault;
120+
| ------- required by a bound in this associated type
121+
= note: this error originates in the derive macro `uniffi::Object` (in Nightly builds, run with -Z macro-backtrace for more info)

fixtures/uitests/tests/ui/interface_trait_not_sync_and_send.stderr

+64
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,67 @@ note: required by a bound in `FfiConverterArc`
109109
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
110110
| ^^^^ required by this bound in `FfiConverterArc`
111111
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info)
112+
113+
error[E0277]: `(dyn Trait + 'static)` cannot be sent between threads safely
114+
--> $OUT_DIR[uniffi_uitests]/trait.uniffi.rs
115+
|
116+
| #[::uniffi::export_for_udl]
117+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Trait + 'static)` cannot be sent between threads safely
118+
|
119+
= help: the trait `Send` is not implemented for `(dyn Trait + 'static)`
120+
note: required by a bound in `uniffi::FfiConverterArc::FfiType`
121+
--> $WORKSPACE/uniffi_core/src/ffi_converter_traits.rs
122+
|
123+
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
124+
| ^^^^ required by this bound in `FfiConverterArc::FfiType`
125+
| type FfiType: FfiDefault;
126+
| ------- required by a bound in this associated type
127+
= note: this error originates in the attribute macro `::uniffi::export_for_udl` (in Nightly builds, run with -Z macro-backtrace for more info)
128+
129+
error[E0277]: `(dyn Trait + 'static)` cannot be shared between threads safely
130+
--> $OUT_DIR[uniffi_uitests]/trait.uniffi.rs
131+
|
132+
| #[::uniffi::export_for_udl]
133+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Trait + 'static)` cannot be shared between threads safely
134+
|
135+
= help: the trait `Sync` is not implemented for `(dyn Trait + 'static)`
136+
note: required by a bound in `uniffi::FfiConverterArc::FfiType`
137+
--> $WORKSPACE/uniffi_core/src/ffi_converter_traits.rs
138+
|
139+
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
140+
| ^^^^ required by this bound in `FfiConverterArc::FfiType`
141+
| type FfiType: FfiDefault;
142+
| ------- required by a bound in this associated type
143+
= note: this error originates in the attribute macro `::uniffi::export_for_udl` (in Nightly builds, run with -Z macro-backtrace for more info)
144+
145+
error[E0277]: `(dyn ProcMacroTrait + 'static)` cannot be sent between threads safely
146+
--> tests/ui/interface_trait_not_sync_and_send.rs:11:1
147+
|
148+
11 | #[uniffi::export]
149+
| ^^^^^^^^^^^^^^^^^ `(dyn ProcMacroTrait + 'static)` cannot be sent between threads safely
150+
|
151+
= help: the trait `Send` is not implemented for `(dyn ProcMacroTrait + 'static)`
152+
note: required by a bound in `uniffi::FfiConverterArc::FfiType`
153+
--> $WORKSPACE/uniffi_core/src/ffi_converter_traits.rs
154+
|
155+
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
156+
| ^^^^ required by this bound in `FfiConverterArc::FfiType`
157+
| type FfiType: FfiDefault;
158+
| ------- required by a bound in this associated type
159+
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info)
160+
161+
error[E0277]: `(dyn ProcMacroTrait + 'static)` cannot be shared between threads safely
162+
--> tests/ui/interface_trait_not_sync_and_send.rs:11:1
163+
|
164+
11 | #[uniffi::export]
165+
| ^^^^^^^^^^^^^^^^^ `(dyn ProcMacroTrait + 'static)` cannot be shared between threads safely
166+
|
167+
= help: the trait `Sync` is not implemented for `(dyn ProcMacroTrait + 'static)`
168+
note: required by a bound in `uniffi::FfiConverterArc::FfiType`
169+
--> $WORKSPACE/uniffi_core/src/ffi_converter_traits.rs
170+
|
171+
| pub unsafe trait FfiConverterArc<UT>: Send + Sync {
172+
| ^^^^ required by this bound in `FfiConverterArc::FfiType`
173+
| type FfiType: FfiDefault;
174+
| ------- required by a bound in this associated type
175+
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info)

fixtures/uitests/tests/ui/invalid_types_in_signatures.stderr

+70-17
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,86 @@ error[E0277]: the trait bound `Result<(), ErrorType>: Lift<UniFfiTag>` is not sa
55
| ^^^^^^^^^^^^^^^^^ the trait `Lift<UniFfiTag>` is not implemented for `Result<(), ErrorType>`
66
|
77
= help: the following other types implement trait `Lift<UT>`:
8-
bool
9-
i8
10-
i16
11-
i32
12-
i64
13-
u8
14-
u16
15-
u32
8+
Arc<T>
9+
Duration
10+
ErrorType
11+
HashMap<K, V>
12+
Option<T>
13+
String
14+
SystemTime
15+
Vec<T>
1616
and $N others
1717
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info)
1818

1919
error[E0277]: the trait bound `Result<(), ErrorType>: Lower<UniFfiTag>` is not satisfied
2020
--> tests/ui/invalid_types_in_signatures.rs:20:1
2121
|
2222
20 | #[uniffi::export]
23-
| ^^^^^^^^^^^^^^^^^ the trait `Lower<UniFfiTag>` is not implemented for `Result<(), ErrorType>`, which is required by `Option<Result<(), ErrorType>>: LowerReturn<UniFfiTag>`
23+
| ^^^^^^^^^^^^^^^^^ the trait `Lower<UniFfiTag>` is not implemented for `Result<(), ErrorType>`
2424
|
2525
= help: the following other types implement trait `Lower<UT>`:
26-
bool
27-
i8
28-
i16
29-
i32
30-
i64
31-
u8
32-
u16
33-
u32
26+
Arc<T>
27+
Duration
28+
ErrorType
29+
HashMap<K, V>
30+
Option<T>
31+
String
32+
SystemTime
33+
Vec<T>
3434
and $N others
3535
= note: required for `Option<Result<(), ErrorType>>` to implement `Lower<UniFfiTag>`
3636
= note: required for `Option<Result<(), ErrorType>>` to implement `LowerReturn<UniFfiTag>`
3737
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info)
38+
39+
error[E0277]: the trait bound `Result<(), ErrorType>: Lift<UniFfiTag>` is not satisfied
40+
--> tests/ui/invalid_types_in_signatures.rs:18:25
41+
|
42+
18 | pub fn input_result(_r: Result<(), ErrorType>) { }
43+
| ^^^^^^^^^^^^^^^^^^^^^ the trait `Lift<UniFfiTag>` is not implemented for `Result<(), ErrorType>`
44+
|
45+
= help: the following other types implement trait `Lift<UT>`:
46+
Arc<T>
47+
Duration
48+
ErrorType
49+
HashMap<K, V>
50+
Option<T>
51+
String
52+
SystemTime
53+
Vec<T>
54+
and $N others
55+
56+
error[E0277]: the trait bound `Result<(), ErrorType>: Lift<UniFfiTag>` is not satisfied
57+
--> tests/ui/invalid_types_in_signatures.rs:18:21
58+
|
59+
18 | pub fn input_result(_r: Result<(), ErrorType>) { }
60+
| ^^ the trait `Lift<UniFfiTag>` is not implemented for `Result<(), ErrorType>`
61+
|
62+
= help: the following other types implement trait `Lift<UT>`:
63+
Arc<T>
64+
Duration
65+
ErrorType
66+
HashMap<K, V>
67+
Option<T>
68+
String
69+
SystemTime
70+
Vec<T>
71+
and $N others
72+
73+
error[E0277]: the trait bound `Result<(), ErrorType>: Lower<UniFfiTag>` is not satisfied
74+
--> tests/ui/invalid_types_in_signatures.rs:20:1
75+
|
76+
20 | #[uniffi::export]
77+
| ^^^^^^^^^^^^^^^^^ the trait `Lower<UniFfiTag>` is not implemented for `Result<(), ErrorType>`
78+
|
79+
= help: the following other types implement trait `Lower<UT>`:
80+
Arc<T>
81+
Duration
82+
ErrorType
83+
HashMap<K, V>
84+
Option<T>
85+
String
86+
SystemTime
87+
Vec<T>
88+
and $N others
89+
= note: required for `Option<Result<(), ErrorType>>` to implement `Lower<UniFfiTag>`
90+
= note: this error originates in the attribute macro `uniffi::export` (in Nightly builds, run with -Z macro-backtrace for more info)

0 commit comments

Comments
 (0)