Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 56c5435

Browse files
committedMar 31, 2024·
Put the RFC behind a feature gate result_ffi_guarantees
1 parent f4989a1 commit 56c5435

File tree

8 files changed

+501
-29
lines changed

8 files changed

+501
-29
lines changed
 

‎compiler/rustc_feature/src/unstable.rs

+3
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,9 @@ declare_features! (
573573
(incomplete, repr128, "1.16.0", Some(56071)),
574574
/// Allows `repr(simd)` and importing the various simd intrinsics.
575575
(unstable, repr_simd, "1.4.0", Some(27731)),
576+
/// Allows enums like Result<T, E> to be used across FFI, if T's niche value can
577+
/// be used to describe E or vise-versa.
578+
(unstable, result_ffi_guarantees, "CURRENT_RUSTC_VERSION", Some(110503)),
576579
/// Allows bounding the return type of AFIT/RPITIT.
577580
(incomplete, return_type_notation, "1.70.0", Some(109417)),
578581
/// Allows `extern "rust-cold"`.

‎compiler/rustc_lint/src/types.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,10 @@ pub(crate) fn repr_nullable_ptr<'tcx>(
11421142
[var_one, var_two] => match (&var_one.fields.raw[..], &var_two.fields.raw[..]) {
11431143
([], [field]) | ([field], []) => field.ty(tcx, args),
11441144
([field1], [field2]) => {
1145+
if !tcx.features().result_ffi_guarantees {
1146+
return None;
1147+
}
1148+
11451149
let ty1 = field1.ty(tcx, args);
11461150
let ty2 = field2.ty(tcx, args);
11471151

‎compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1489,6 +1489,7 @@ symbols! {
14891489
require,
14901490
residual,
14911491
result,
1492+
result_ffi_guarantees,
14921493
resume,
14931494
return_position_impl_trait_in_trait,
14941495
return_type_notation,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# `result_ffi_guarantees`
2+
3+
The tracking issue for this feature is: [#110503]
4+
5+
[#110503]: https://github.com/rust-lang/rust/issues/110503
6+
7+
------------------------
8+
9+
This feature adds the possibility of using `Result<T, E>` in FFI if T's niche
10+
value can be used to describe E or vise-versa.
11+
12+
See [RFC 3391] for more information.
13+
14+
[RFC 3391]: https://github.com/rust-lang/rfcs/blob/master/text/3391-result_ffi_guarantees.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#![allow(dead_code)]
2+
#![deny(improper_ctypes)]
3+
#![feature(generic_nonzero)]
4+
#![feature(ptr_internals)]
5+
6+
use std::num;
7+
8+
enum Z {}
9+
10+
#[repr(transparent)]
11+
struct TransparentStruct<T>(T, std::marker::PhantomData<Z>);
12+
13+
#[repr(transparent)]
14+
enum TransparentEnum<T> {
15+
Variant(T, std::marker::PhantomData<Z>),
16+
}
17+
18+
struct NoField;
19+
20+
extern "C" {
21+
fn result_ref_t(x: Result<&'static u8, ()>);
22+
//~^ ERROR `extern` block uses type `Result
23+
fn result_fn_t(x: Result<extern "C" fn(), ()>);
24+
//~^ ERROR `extern` block uses type `Result
25+
fn result_nonnull_t(x: Result<std::ptr::NonNull<u8>, ()>);
26+
//~^ ERROR `extern` block uses type `Result
27+
fn result_unique_t(x: Result<std::ptr::Unique<u8>, ()>);
28+
//~^ ERROR `extern` block uses type `Result
29+
fn result_nonzero_u8_t(x: Result<num::NonZero<u8>, ()>);
30+
//~^ ERROR `extern` block uses type `Result
31+
fn result_nonzero_u16_t(x: Result<num::NonZero<u16>, ()>);
32+
//~^ ERROR `extern` block uses type `Result
33+
fn result_nonzero_u32_t(x: Result<num::NonZero<u32>, ()>);
34+
//~^ ERROR `extern` block uses type `Result
35+
fn result_nonzero_u64_t(x: Result<num::NonZero<u64>, ()>);
36+
//~^ ERROR `extern` block uses type `Result
37+
fn result_nonzero_usize_t(x: Result<num::NonZero<usize>, ()>);
38+
//~^ ERROR `extern` block uses type `Result
39+
fn result_nonzero_i8_t(x: Result<num::NonZero<i8>, ()>);
40+
//~^ ERROR `extern` block uses type `Result
41+
fn result_nonzero_i16_t(x: Result<num::NonZero<i16>, ()>);
42+
//~^ ERROR `extern` block uses type `Result
43+
fn result_nonzero_i32_t(x: Result<num::NonZero<i32>, ()>);
44+
//~^ ERROR `extern` block uses type `Result
45+
fn result_nonzero_i64_t(x: Result<num::NonZero<i64>, ()>);
46+
//~^ ERROR `extern` block uses type `Result
47+
fn result_nonzero_isize_t(x: Result<num::NonZero<isize>, ()>);
48+
//~^ ERROR `extern` block uses type `Result
49+
fn result_transparent_struct_t(x: Result<TransparentStruct<num::NonZero<u8>>, ()>);
50+
//~^ ERROR `extern` block uses type `Result
51+
fn result_transparent_enum_t(x: Result<TransparentEnum<num::NonZero<u8>>, ()>);
52+
//~^ ERROR `extern` block uses type `Result
53+
fn result_phantom_t(x: Result<num::NonZero<u8>, std::marker::PhantomData<()>>);
54+
//~^ ERROR `extern` block uses type `Result
55+
fn result_1zst_exhaustive_no_variant_t(x: Result<num::NonZero<u8>, Z>);
56+
//~^ ERROR `extern` block uses type `Result
57+
fn result_1zst_exhaustive_no_field_t(x: Result<num::NonZero<u8>, NoField>);
58+
//~^ ERROR `extern` block uses type `Result
59+
60+
fn result_ref_e(x: Result<(), &'static u8>);
61+
//~^ ERROR `extern` block uses type `Result
62+
fn result_fn_e(x: Result<(), extern "C" fn()>);
63+
//~^ ERROR `extern` block uses type `Result
64+
fn result_nonnull_e(x: Result<(), std::ptr::NonNull<u8>>);
65+
//~^ ERROR `extern` block uses type `Result
66+
fn result_unique_e(x: Result<(), std::ptr::Unique<u8>>);
67+
//~^ ERROR `extern` block uses type `Result
68+
fn result_nonzero_u8_e(x: Result<(), num::NonZero<u8>>);
69+
//~^ ERROR `extern` block uses type `Result
70+
fn result_nonzero_u16_e(x: Result<(), num::NonZero<u16>>);
71+
//~^ ERROR `extern` block uses type `Result
72+
fn result_nonzero_u32_e(x: Result<(), num::NonZero<u32>>);
73+
//~^ ERROR `extern` block uses type `Result
74+
fn result_nonzero_u64_e(x: Result<(), num::NonZero<u64>>);
75+
//~^ ERROR `extern` block uses type `Result
76+
fn result_nonzero_usize_e(x: Result<(), num::NonZero<usize>>);
77+
//~^ ERROR `extern` block uses type `Result
78+
fn result_nonzero_i8_e(x: Result<(), num::NonZero<i8>>);
79+
//~^ ERROR `extern` block uses type `Result
80+
fn result_nonzero_i16_e(x: Result<(), num::NonZero<i16>>);
81+
//~^ ERROR `extern` block uses type `Result
82+
fn result_nonzero_i32_e(x: Result<(), num::NonZero<i32>>);
83+
//~^ ERROR `extern` block uses type `Result
84+
fn result_nonzero_i64_e(x: Result<(), num::NonZero<i64>>);
85+
//~^ ERROR `extern` block uses type `Result
86+
fn result_nonzero_isize_e(x: Result<(), num::NonZero<isize>>);
87+
//~^ ERROR `extern` block uses type `Result
88+
fn result_transparent_struct_e(x: Result<(), TransparentStruct<num::NonZero<u8>>>);
89+
//~^ ERROR `extern` block uses type `Result
90+
fn result_transparent_enum_e(x: Result<(), TransparentEnum<num::NonZero<u8>>>);
91+
//~^ ERROR `extern` block uses type `Result
92+
fn result_phantom_e(x: Result<num::NonZero<u8>, std::marker::PhantomData<()>>);
93+
//~^ ERROR `extern` block uses type `Result
94+
fn result_1zst_exhaustive_no_variant_e(x: Result<Z, num::NonZero<u8>>);
95+
//~^ ERROR `extern` block uses type `Result
96+
fn result_1zst_exhaustive_no_field_e(x: Result<NoField, num::NonZero<u8>>);
97+
//~^ ERROR `extern` block uses type `Result
98+
}
99+
100+
pub fn main() {}

‎tests/ui/feature-gates/feature-gate-result_ffi_guarantees.stderr

+349
Large diffs are not rendered by default.

‎tests/ui/lint/lint-ctypes-enum.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#![feature(generic_nonzero)]
44
#![feature(ptr_internals)]
55
#![feature(transparent_unions)]
6+
#![feature(result_ffi_guarantees)]
67

78
use std::num;
89

‎tests/ui/lint/lint-ctypes-enum.stderr

+29-29
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: `extern` block uses type `U`, which is not FFI-safe
2-
--> $DIR/lint-ctypes-enum.rs:69:14
2+
--> $DIR/lint-ctypes-enum.rs:70:14
33
|
44
LL | fn uf(x: U);
55
| ^ not FFI-safe
66
|
77
= help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
88
= note: enum has no representation hint
99
note: the type is defined here
10-
--> $DIR/lint-ctypes-enum.rs:10:1
10+
--> $DIR/lint-ctypes-enum.rs:11:1
1111
|
1212
LL | enum U {
1313
| ^^^^^^
@@ -18,51 +18,51 @@ LL | #![deny(improper_ctypes)]
1818
| ^^^^^^^^^^^^^^^
1919

2020
error: `extern` block uses type `B`, which is not FFI-safe
21-
--> $DIR/lint-ctypes-enum.rs:70:14
21+
--> $DIR/lint-ctypes-enum.rs:71:14
2222
|
2323
LL | fn bf(x: B);
2424
| ^ not FFI-safe
2525
|
2626
= help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
2727
= note: enum has no representation hint
2828
note: the type is defined here
29-
--> $DIR/lint-ctypes-enum.rs:13:1
29+
--> $DIR/lint-ctypes-enum.rs:14:1
3030
|
3131
LL | enum B {
3232
| ^^^^^^
3333

3434
error: `extern` block uses type `T`, which is not FFI-safe
35-
--> $DIR/lint-ctypes-enum.rs:71:14
35+
--> $DIR/lint-ctypes-enum.rs:72:14
3636
|
3737
LL | fn tf(x: T);
3838
| ^ not FFI-safe
3939
|
4040
= help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
4141
= note: enum has no representation hint
4242
note: the type is defined here
43-
--> $DIR/lint-ctypes-enum.rs:17:1
43+
--> $DIR/lint-ctypes-enum.rs:18:1
4444
|
4545
LL | enum T {
4646
| ^^^^^^
4747

4848
error: `extern` block uses type `u128`, which is not FFI-safe
49-
--> $DIR/lint-ctypes-enum.rs:83:31
49+
--> $DIR/lint-ctypes-enum.rs:84:31
5050
|
5151
LL | fn option_nonzero_u128(x: Option<num::NonZero<u128>>);
5252
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
5353
|
5454
= note: 128-bit integers don't currently have a known stable ABI
5555

5656
error: `extern` block uses type `i128`, which is not FFI-safe
57-
--> $DIR/lint-ctypes-enum.rs:90:31
57+
--> $DIR/lint-ctypes-enum.rs:91:31
5858
|
5959
LL | fn option_nonzero_i128(x: Option<num::NonZero<i128>>);
6060
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
6161
|
6262
= note: 128-bit integers don't currently have a known stable ABI
6363

6464
error: `extern` block uses type `Option<TransparentUnion<NonZero<u8>>>`, which is not FFI-safe
65-
--> $DIR/lint-ctypes-enum.rs:95:36
65+
--> $DIR/lint-ctypes-enum.rs:96:36
6666
|
6767
LL | fn option_transparent_union(x: Option<TransparentUnion<num::NonZero<u8>>>);
6868
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -71,7 +71,7 @@ LL | fn option_transparent_union(x: Option<TransparentUnion<num::NonZero<u8>
7171
= note: enum has no representation hint
7272

7373
error: `extern` block uses type `Option<Rust<NonZero<u8>>>`, which is not FFI-safe
74-
--> $DIR/lint-ctypes-enum.rs:97:28
74+
--> $DIR/lint-ctypes-enum.rs:98:28
7575
|
7676
LL | fn option_repr_rust(x: Option<Rust<num::NonZero<u8>>>);
7777
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -80,23 +80,23 @@ LL | fn option_repr_rust(x: Option<Rust<num::NonZero<u8>>>);
8080
= note: enum has no representation hint
8181

8282
error: `extern` block uses type `u128`, which is not FFI-safe
83-
--> $DIR/lint-ctypes-enum.rs:107:33
83+
--> $DIR/lint-ctypes-enum.rs:108:33
8484
|
8585
LL | fn result_nonzero_u128_t(x: Result<num::NonZero<u128>, ()>);
8686
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
8787
|
8888
= note: 128-bit integers don't currently have a known stable ABI
8989

9090
error: `extern` block uses type `i128`, which is not FFI-safe
91-
--> $DIR/lint-ctypes-enum.rs:114:33
91+
--> $DIR/lint-ctypes-enum.rs:115:33
9292
|
9393
LL | fn result_nonzero_i128_t(x: Result<num::NonZero<i128>, ()>);
9494
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
9595
|
9696
= note: 128-bit integers don't currently have a known stable ABI
9797

9898
error: `extern` block uses type `Result<TransparentUnion<NonZero<u8>>, ()>`, which is not FFI-safe
99-
--> $DIR/lint-ctypes-enum.rs:119:38
99+
--> $DIR/lint-ctypes-enum.rs:120:38
100100
|
101101
LL | fn result_transparent_union_t(x: Result<TransparentUnion<num::NonZero<u8>>, ()>);
102102
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -105,7 +105,7 @@ LL | fn result_transparent_union_t(x: Result<TransparentUnion<num::NonZero<u
105105
= note: enum has no representation hint
106106

107107
error: `extern` block uses type `Result<Rust<NonZero<u8>>, ()>`, which is not FFI-safe
108-
--> $DIR/lint-ctypes-enum.rs:121:30
108+
--> $DIR/lint-ctypes-enum.rs:122:30
109109
|
110110
LL | fn result_repr_rust_t(x: Result<Rust<num::NonZero<u8>>, ()>);
111111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -114,7 +114,7 @@ LL | fn result_repr_rust_t(x: Result<Rust<num::NonZero<u8>>, ()>);
114114
= note: enum has no representation hint
115115

116116
error: `extern` block uses type `Result<NonZero<u8>, U>`, which is not FFI-safe
117-
--> $DIR/lint-ctypes-enum.rs:125:51
117+
--> $DIR/lint-ctypes-enum.rs:126:51
118118
|
119119
LL | fn result_1zst_exhaustive_single_variant_t(x: Result<num::NonZero<u8>, U>);
120120
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -123,7 +123,7 @@ LL | fn result_1zst_exhaustive_single_variant_t(x: Result<num::NonZero<u8>,
123123
= note: enum has no representation hint
124124

125125
error: `extern` block uses type `Result<NonZero<u8>, B>`, which is not FFI-safe
126-
--> $DIR/lint-ctypes-enum.rs:127:53
126+
--> $DIR/lint-ctypes-enum.rs:128:53
127127
|
128128
LL | fn result_1zst_exhaustive_multiple_variant_t(x: Result<num::NonZero<u8>, B>);
129129
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -132,7 +132,7 @@ LL | fn result_1zst_exhaustive_multiple_variant_t(x: Result<num::NonZero<u8>
132132
= note: enum has no representation hint
133133

134134
error: `extern` block uses type `Result<NonZero<u8>, NonExhaustive>`, which is not FFI-safe
135-
--> $DIR/lint-ctypes-enum.rs:129:51
135+
--> $DIR/lint-ctypes-enum.rs:130:51
136136
|
137137
LL | fn result_1zst_non_exhaustive_no_variant_t(x: Result<num::NonZero<u8>, NonExhaustive>);
138138
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -141,7 +141,7 @@ LL | fn result_1zst_non_exhaustive_no_variant_t(x: Result<num::NonZero<u8>,
141141
= note: enum has no representation hint
142142

143143
error: `extern` block uses type `Result<NonZero<u8>, Field>`, which is not FFI-safe
144-
--> $DIR/lint-ctypes-enum.rs:132:49
144+
--> $DIR/lint-ctypes-enum.rs:133:49
145145
|
146146
LL | fn result_1zst_exhaustive_single_field_t(x: Result<num::NonZero<u8>, Field>);
147147
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -150,7 +150,7 @@ LL | fn result_1zst_exhaustive_single_field_t(x: Result<num::NonZero<u8>, Fi
150150
= note: enum has no representation hint
151151

152152
error: `extern` block uses type `Result<Result<(), NonZero<u8>>, ()>`, which is not FFI-safe
153-
--> $DIR/lint-ctypes-enum.rs:134:30
153+
--> $DIR/lint-ctypes-enum.rs:135:30
154154
|
155155
LL | fn result_cascading_t(x: Result<Result<(), num::NonZero<u8>>, ()>);
156156
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -159,23 +159,23 @@ LL | fn result_cascading_t(x: Result<Result<(), num::NonZero<u8>>, ()>);
159159
= note: enum has no representation hint
160160

161161
error: `extern` block uses type `u128`, which is not FFI-safe
162-
--> $DIR/lint-ctypes-enum.rs:145:33
162+
--> $DIR/lint-ctypes-enum.rs:146:33
163163
|
164164
LL | fn result_nonzero_u128_e(x: Result<(), num::NonZero<u128>>);
165165
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
166166
|
167167
= note: 128-bit integers don't currently have a known stable ABI
168168

169169
error: `extern` block uses type `i128`, which is not FFI-safe
170-
--> $DIR/lint-ctypes-enum.rs:152:33
170+
--> $DIR/lint-ctypes-enum.rs:153:33
171171
|
172172
LL | fn result_nonzero_i128_e(x: Result<(), num::NonZero<i128>>);
173173
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
174174
|
175175
= note: 128-bit integers don't currently have a known stable ABI
176176

177177
error: `extern` block uses type `Result<(), TransparentUnion<NonZero<u8>>>`, which is not FFI-safe
178-
--> $DIR/lint-ctypes-enum.rs:157:38
178+
--> $DIR/lint-ctypes-enum.rs:158:38
179179
|
180180
LL | fn result_transparent_union_e(x: Result<(), TransparentUnion<num::NonZero<u8>>>);
181181
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -184,7 +184,7 @@ LL | fn result_transparent_union_e(x: Result<(), TransparentUnion<num::NonZe
184184
= note: enum has no representation hint
185185

186186
error: `extern` block uses type `Result<(), Rust<NonZero<u8>>>`, which is not FFI-safe
187-
--> $DIR/lint-ctypes-enum.rs:159:30
187+
--> $DIR/lint-ctypes-enum.rs:160:30
188188
|
189189
LL | fn result_repr_rust_e(x: Result<(), Rust<num::NonZero<u8>>>);
190190
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -193,7 +193,7 @@ LL | fn result_repr_rust_e(x: Result<(), Rust<num::NonZero<u8>>>);
193193
= note: enum has no representation hint
194194

195195
error: `extern` block uses type `Result<U, NonZero<u8>>`, which is not FFI-safe
196-
--> $DIR/lint-ctypes-enum.rs:163:51
196+
--> $DIR/lint-ctypes-enum.rs:164:51
197197
|
198198
LL | fn result_1zst_exhaustive_single_variant_e(x: Result<U, num::NonZero<u8>>);
199199
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -202,7 +202,7 @@ LL | fn result_1zst_exhaustive_single_variant_e(x: Result<U, num::NonZero<u8
202202
= note: enum has no representation hint
203203

204204
error: `extern` block uses type `Result<B, NonZero<u8>>`, which is not FFI-safe
205-
--> $DIR/lint-ctypes-enum.rs:165:53
205+
--> $DIR/lint-ctypes-enum.rs:166:53
206206
|
207207
LL | fn result_1zst_exhaustive_multiple_variant_e(x: Result<B, num::NonZero<u8>>);
208208
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -211,7 +211,7 @@ LL | fn result_1zst_exhaustive_multiple_variant_e(x: Result<B, num::NonZero<
211211
= note: enum has no representation hint
212212

213213
error: `extern` block uses type `Result<NonExhaustive, NonZero<u8>>`, which is not FFI-safe
214-
--> $DIR/lint-ctypes-enum.rs:167:51
214+
--> $DIR/lint-ctypes-enum.rs:168:51
215215
|
216216
LL | fn result_1zst_non_exhaustive_no_variant_e(x: Result<NonExhaustive, num::NonZero<u8>>);
217217
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -220,7 +220,7 @@ LL | fn result_1zst_non_exhaustive_no_variant_e(x: Result<NonExhaustive, num
220220
= note: enum has no representation hint
221221

222222
error: `extern` block uses type `Result<Field, NonZero<u8>>`, which is not FFI-safe
223-
--> $DIR/lint-ctypes-enum.rs:170:49
223+
--> $DIR/lint-ctypes-enum.rs:171:49
224224
|
225225
LL | fn result_1zst_exhaustive_single_field_e(x: Result<Field, num::NonZero<u8>>);
226226
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -229,7 +229,7 @@ LL | fn result_1zst_exhaustive_single_field_e(x: Result<Field, num::NonZero<
229229
= note: enum has no representation hint
230230

231231
error: `extern` block uses type `Result<(), Result<(), NonZero<u8>>>`, which is not FFI-safe
232-
--> $DIR/lint-ctypes-enum.rs:172:30
232+
--> $DIR/lint-ctypes-enum.rs:173:30
233233
|
234234
LL | fn result_cascading_e(x: Result<(), Result<(), num::NonZero<u8>>>);
235235
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -238,7 +238,7 @@ LL | fn result_cascading_e(x: Result<(), Result<(), num::NonZero<u8>>>);
238238
= note: enum has no representation hint
239239

240240
error: `extern` block uses type `Result<(), ()>`, which is not FFI-safe
241-
--> $DIR/lint-ctypes-enum.rs:174:27
241+
--> $DIR/lint-ctypes-enum.rs:175:27
242242
|
243243
LL | fn result_unit_t_e(x: Result<(), ()>);
244244
| ^^^^^^^^^^^^^^ not FFI-safe

0 commit comments

Comments
 (0)
Please sign in to comment.