Skip to content

Commit 8b58968

Browse files
[chore] Update invalid handle test golden files
1 parent 1459b30 commit 8b58968

File tree

3 files changed

+77
-9
lines changed

3 files changed

+77
-9
lines changed

ffi/tests/invalid-handle-code/mut-clone-handle.stderr

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,30 @@ error[E0599]: the method `clone_as_arc` exists for struct `Handle<MutFoo>`, but
22
--> tests/invalid-handle-code/mut-clone-handle.rs:13:15
33
|
44
8 | pub struct MutFoo;
5-
| ----------------- doesn't satisfy `<MutFoo as HandleDescriptor>::Mutable = False`
5+
| ----------------- doesn't satisfy 5 bounds
66
...
77
13 | let r = h.clone_as_arc();
88
| ^^^^^^^^^^^^ method cannot be called on `Handle<MutFoo>` due to unsatisfied trait bounds
99
|
1010
= note: the following trait bounds were not satisfied:
1111
`<MutFoo as HandleDescriptor>::Mutable = False`
12+
`<MutFoo as handle::private::HandleOps<_, False, _>>::From = Arc<_>`
13+
`MutFoo: handle::private::SharedHandleOps<_, _>`
14+
`MutFoo: handle::private::SharedHandle`
15+
which is required by `MutFoo: handle::private::SharedHandleOps<_, _>`
16+
`MutFoo: handle::private::HandleOps<_, False, _>`
17+
which is required by `MutFoo: handle::private::SharedHandleOps<_, _>`
18+
note: the traits `handle::private::SharedHandle`, `handle::private::HandleOps`, and `handle::private::SharedHandleOps` must be implemented
19+
--> src/handle.rs
20+
|
21+
| pub trait SharedHandle {}
22+
| ^^^^^^^^^^^^^^^^^^^^^^
23+
...
24+
| pub trait HandleOps<T: ?Sized, M, S> {
25+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26+
...
27+
| pub trait SharedHandleOps<T: ?Sized, S>: HandleOps<T, False, S> + SharedHandle {
28+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1229

1330
error[E0271]: type mismatch resolving `<MutFoo as HandleDescriptor>::Mutable == False`
1431
--> tests/invalid-handle-code/mut-clone-handle.rs:12:41
@@ -23,10 +40,27 @@ error[E0599]: the method `clone_handle` exists for struct `Handle<MutFoo>`, but
2340
--> tests/invalid-handle-code/mut-clone-handle.rs:14:15
2441
|
2542
8 | pub struct MutFoo;
26-
| ----------------- doesn't satisfy `<MutFoo as HandleDescriptor>::Mutable = False`
43+
| ----------------- doesn't satisfy 5 bounds
2744
...
2845
14 | let h = h.clone_handle();
2946
| ^^^^^^^^^^^^
3047
|
3148
= note: the following trait bounds were not satisfied:
3249
`<MutFoo as HandleDescriptor>::Mutable = False`
50+
`<MutFoo as handle::private::HandleOps<_, False, _>>::From = Arc<_>`
51+
`MutFoo: handle::private::SharedHandleOps<_, _>`
52+
`MutFoo: handle::private::SharedHandle`
53+
which is required by `MutFoo: handle::private::SharedHandleOps<_, _>`
54+
`MutFoo: handle::private::HandleOps<_, False, _>`
55+
which is required by `MutFoo: handle::private::SharedHandleOps<_, _>`
56+
note: the traits `handle::private::SharedHandle`, `handle::private::HandleOps`, and `handle::private::SharedHandleOps` must be implemented
57+
--> src/handle.rs
58+
|
59+
| pub trait SharedHandle {}
60+
| ^^^^^^^^^^^^^^^^^^^^^^
61+
...
62+
| pub trait HandleOps<T: ?Sized, M, S> {
63+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
64+
...
65+
| pub trait SharedHandleOps<T: ?Sized, S>: HandleOps<T, False, S> + SharedHandle {
66+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ffi/tests/invalid-handle-code/shared-as-mut.stderr

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,29 @@ error[E0599]: the method `as_mut` exists for struct `Handle<SharedFoo>`, but its
22
--> tests/invalid-handle-code/shared-as-mut.rs:12:15
33
|
44
7 | pub struct SharedFoo;
5-
| -------------------- doesn't satisfy `<SharedFoo as HandleDescriptor>::Mutable = True`
5+
| -------------------- doesn't satisfy `<SharedFoo as HandleDescriptor>::Mutable = True`, `SharedFoo: handle::private::HandleOps<_, True, _>`, `SharedFoo: handle::private::MutableHandleOps<_, _>` or `SharedFoo: handle::private::MutableHandle`
66
...
77
12 | let r = h.as_mut();
88
| ^^^^^^ method cannot be called on `Handle<SharedFoo>` due to unsatisfied trait bounds
99
|
1010
= note: the following trait bounds were not satisfied:
1111
`<SharedFoo as HandleDescriptor>::Mutable = True`
12+
`SharedFoo: handle::private::MutableHandleOps<_, _>`
13+
`SharedFoo: handle::private::MutableHandle`
14+
which is required by `SharedFoo: handle::private::MutableHandleOps<_, _>`
15+
`SharedFoo: handle::private::HandleOps<_, True, _>`
16+
which is required by `SharedFoo: handle::private::MutableHandleOps<_, _>`
17+
note: the traits `handle::private::MutableHandle`, `handle::private::HandleOps`, and `handle::private::MutableHandleOps` must be implemented
18+
--> src/handle.rs
19+
|
20+
| pub trait MutableHandle {}
21+
| ^^^^^^^^^^^^^^^^^^^^^^^
22+
...
23+
| pub trait HandleOps<T: ?Sized, M, S> {
24+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25+
...
26+
| pub trait MutableHandleOps<T: ?Sized, S>: HandleOps<T, True, S> + MutableHandle {
27+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1228

1329
error[E0271]: type mismatch resolving `<SharedFoo as HandleDescriptor>::Mutable == True`
1430
--> tests/invalid-handle-code/shared-as-mut.rs:11:44

ffi/tests/invalid-handle-code/shared-not-sync.stderr

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@ error[E0599]: the method `clone_as_arc` exists for struct `Handle<SharedNotSync>
22
--> tests/invalid-handle-code/shared-not-sync.rs:15:15
33
|
44
10 | pub struct SharedNotSync;
5-
| ------------------------ doesn't satisfy `_: SharedHandleOps<NotSync, True>`
5+
| ------------------------ doesn't satisfy `SharedNotSync: handle::private::SharedHandle` or `_: SharedHandleOps<_, _>`
66
...
77
15 | let r = h.clone_as_arc();
88
| ^^^^^^^^^^^^ method cannot be called on `Handle<SharedNotSync>` due to unsatisfied trait bounds
99
|
1010
= note: the following trait bounds were not satisfied:
11-
`*mut u32: Sync`
12-
which is required by `SharedNotSync: handle::private::SharedHandleOps<NotSync, True>`
11+
`SharedNotSync: handle::private::SharedHandleOps<_, _>`
12+
`SharedNotSync: handle::private::SharedHandle`
13+
which is required by `SharedNotSync: handle::private::SharedHandleOps<_, _>`
14+
note: the traits `handle::private::SharedHandle` and `handle::private::SharedHandleOps` must be implemented
15+
--> src/handle.rs
16+
|
17+
| pub trait SharedHandle {}
18+
| ^^^^^^^^^^^^^^^^^^^^^^
19+
...
20+
| pub trait SharedHandleOps<T: ?Sized, S>: HandleOps<T, False, S> + SharedHandle {
21+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1322

1423
error[E0277]: `*mut u32` cannot be shared between threads safely
1524
--> tests/invalid-handle-code/shared-not-sync.rs:14:48
@@ -31,11 +40,20 @@ error[E0599]: the method `clone_handle` exists for struct `Handle<SharedNotSync>
3140
--> tests/invalid-handle-code/shared-not-sync.rs:16:15
3241
|
3342
10 | pub struct SharedNotSync;
34-
| ------------------------ doesn't satisfy `_: SharedHandleOps<NotSync, True>`
43+
| ------------------------ doesn't satisfy `SharedNotSync: handle::private::SharedHandle` or `_: SharedHandleOps<_, _>`
3544
...
3645
16 | let h = h.clone_handle();
3746
| ^^^^^^^^^^^^
3847
|
3948
= note: the following trait bounds were not satisfied:
40-
`*mut u32: Sync`
41-
which is required by `SharedNotSync: handle::private::SharedHandleOps<NotSync, True>`
49+
`SharedNotSync: handle::private::SharedHandleOps<_, _>`
50+
`SharedNotSync: handle::private::SharedHandle`
51+
which is required by `SharedNotSync: handle::private::SharedHandleOps<_, _>`
52+
note: the traits `handle::private::SharedHandle` and `handle::private::SharedHandleOps` must be implemented
53+
--> src/handle.rs
54+
|
55+
| pub trait SharedHandle {}
56+
| ^^^^^^^^^^^^^^^^^^^^^^
57+
...
58+
| pub trait SharedHandleOps<T: ?Sized, S>: HandleOps<T, False, S> + SharedHandle {
59+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)