[go: up one dir, main page]

ghost 0.1.3

Define your own PhantomData
Documentation
error[E0277]: `*const u8` cannot be sent between threads safely
  --> tests/ui/autotraits.rs:15:5
   |
15 |     require_send::<MyPhantom<*const u8>>();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const u8` cannot be sent between threads safely
   |
   = help: within `MyPhantom<*const u8>`, the trait `Send` is not implemented for `*const u8`
   = note: required because it appears within the type `PhantomData<*const u8>`
note: required because it appears within the type `__void_MyPhantom::MyPhantom<*const u8>`
  --> tests/ui/autotraits.rs:4:8
   |
4  | struct MyPhantom<T: ?Sized>;
   |        ^^^^^^^^^
note: required because it appears within the type `MyPhantom<*const u8>`
  --> tests/ui/autotraits.rs:4:8
   |
4  | struct MyPhantom<T: ?Sized>;
   |        ^^^^^^^^^
note: required by a bound in `require_send`
  --> tests/ui/autotraits.rs:6:20
   |
6  | fn require_send<T: Send>() {}
   |                    ^^^^ required by this bound in `require_send`

error[E0277]: `*const u8` cannot be shared between threads safely
  --> tests/ui/autotraits.rs:16:5
   |
16 |     require_sync::<MyPhantom<*const u8>>();
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const u8` cannot be shared between threads safely
   |
   = help: within `MyPhantom<*const u8>`, the trait `Sync` is not implemented for `*const u8`
   = note: required because it appears within the type `PhantomData<*const u8>`
note: required because it appears within the type `__void_MyPhantom::MyPhantom<*const u8>`
  --> tests/ui/autotraits.rs:4:8
   |
4  | struct MyPhantom<T: ?Sized>;
   |        ^^^^^^^^^
note: required because it appears within the type `MyPhantom<*const u8>`
  --> tests/ui/autotraits.rs:4:8
   |
4  | struct MyPhantom<T: ?Sized>;
   |        ^^^^^^^^^
note: required by a bound in `require_sync`
  --> tests/ui/autotraits.rs:7:20
   |
7  | fn require_sync<T: Sync>() {}
   |                    ^^^^ required by this bound in `require_sync`