Remove unneeded Unpin import

Unpin is always available via the std prelude.
This commit is contained in:
David Tolnay 2020-12-16 10:18:26 -08:00
parent 83cbe894dc
commit b03d41d5d4
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
4 changed files with 12 additions and 16 deletions

View File

@ -1,5 +1,3 @@
use std::marker::Unpin;
#[cxx::bridge]
mod ffi {
extern "C++" {

View File

@ -1,10 +1,10 @@
error[E0277]: `*const u8` cannot be sent between threads safely
--> $DIR/opaque_autotraits.rs:15:5
--> $DIR/opaque_autotraits.rs:13:5
|
10 | fn assert_send<T: Send>() {}
8 | fn assert_send<T: Send>() {}
| ---- required by this bound in `assert_send`
...
15 | assert_send::<ffi::Opaque>();
13 | assert_send::<ffi::Opaque>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const u8` cannot be sent between threads safely
|
= help: within `ffi::Opaque`, the trait `Send` is not implemented for `*const u8`
@ -13,12 +13,12 @@ error[E0277]: `*const u8` cannot be sent between threads safely
= note: required because it appears within the type `ffi::Opaque`
error[E0277]: `*const u8` cannot be shared between threads safely
--> $DIR/opaque_autotraits.rs:16:5
--> $DIR/opaque_autotraits.rs:14:5
|
11 | fn assert_sync<T: Sync>() {}
9 | fn assert_sync<T: Sync>() {}
| ---- required by this bound in `assert_sync`
...
16 | assert_sync::<ffi::Opaque>();
14 | assert_sync::<ffi::Opaque>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const u8` cannot be shared between threads safely
|
= help: within `ffi::Opaque`, the trait `Sync` is not implemented for `*const u8`
@ -27,12 +27,12 @@ error[E0277]: `*const u8` cannot be shared between threads safely
= note: required because it appears within the type `ffi::Opaque`
error[E0277]: `PhantomPinned` cannot be unpinned
--> $DIR/opaque_autotraits.rs:17:5
--> $DIR/opaque_autotraits.rs:15:5
|
12 | fn assert_unpin<T: Unpin>() {}
10 | fn assert_unpin<T: Unpin>() {}
| ----- required by this bound in `assert_unpin`
...
17 | assert_unpin::<ffi::Opaque>();
15 | assert_unpin::<ffi::Opaque>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ffi::Opaque`, the trait `Unpin` is not implemented for `PhantomPinned`
|
= note: required because it appears within the type `PhantomData<PhantomPinned>`

View File

@ -1,5 +1,3 @@
use std::marker::Unpin;
#[cxx::bridge]
mod ffi {
extern "C++" {

View File

@ -1,8 +1,8 @@
error[E0282]: type annotations needed for `fn()`
--> $DIR/unpin_impl.rs:6:14
--> $DIR/unpin_impl.rs:4:14
|
3 | #[cxx::bridge]
1 | #[cxx::bridge]
| -------------- consider giving this pattern the explicit type `fn()`, with the type parameters specified
...
6 | type Opaque;
4 | type Opaque;
| ^^^^^^ cannot infer type