[go: up one dir, main page]

ghost 0.1.19

Define your own PhantomData
Documentation
error[E0277]: `*const u8` cannot be sent between threads safely
  --> tests/ui/autotraits.rs:15:20
   |
15 |     require_send::<MyPhantom<*const u8>>();
   |                    ^^^^^^^^^^^^^^^^^^^^ `*const u8` cannot be sent between threads safely
   |
   = help: the trait `Send` is not implemented for `*const u8`
note: required for `TypeParam<*const u8>` to implement `Send`
  --> tests/ui/autotraits.rs:3:1
   |
3  | #[phantom]
   | ^^^^^^^^^^
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`
   = note: this error originates in the attribute macro `phantom` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: `*const u8` cannot be shared between threads safely
  --> tests/ui/autotraits.rs:16:20
   |
16 |     require_sync::<MyPhantom<*const u8>>();
   |                    ^^^^^^^^^^^^^^^^^^^^ `*const u8` cannot be shared between threads safely
   |
   = help: the trait `Sync` is not implemented for `*const u8`
note: required for `TypeParam<*const u8>` to implement `Sync`
  --> tests/ui/autotraits.rs:3:1
   |
3  | #[phantom]
   | ^^^^^^^^^^
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`
   = note: this error originates in the attribute macro `phantom` (in Nightly builds, run with -Z macro-backtrace for more info)