Skip to content

Examples do not build on nightly #3

@ghost

Description

If this crate is still being actively developed, I am interested helping out because I have a use case for it. I think the examples have gotten quite out of sync with the package. Any pointers as to where to start bringing them back in line with the library?

krzysztof@p1:~/Work/third-party/kay/examples/simple_common (master)$ cargo build
    Updating crates.io index
warning: use of deprecated item 'std::mem::uninitialized': use `mem::MaybeUninit` instead
  --> /home/krzysztof/Work/third-party/kay/src/lib.rs:47:34
   |
47 |         let mut items: [_; $n] = ::std::mem::uninitialized();
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: /home/krzysztof/Work/third-party/kay/src/actor_system.rs:47:42
   |
47 |             trait_implementors: unsafe { make_array!(MAX_RECIPIENT_TYPES, |_| None) },
   |                                          ------------------------------------------ in this macro invocation
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated item 'std::mem::uninitialized': use `mem::MaybeUninit` instead
  --> /home/krzysztof/Work/third-party/kay/src/lib.rs:47:34
   |
47 |         let mut items: [_; $n] = ::std::mem::uninitialized();
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: /home/krzysztof/Work/third-party/kay/src/actor_system.rs:50:31
   |
50 |             classes: unsafe { make_array!(MAX_RECIPIENT_TYPES, |_| None) },
   |                               ------------------------------------------ in this macro invocation

warning: use of deprecated item 'std::mem::uninitialized': use `mem::MaybeUninit` instead
  --> /home/krzysztof/Work/third-party/kay/src/lib.rs:47:34
   |
47 |         let mut items: [_; $n] = ::std::mem::uninitialized();
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
  ::: /home/krzysztof/Work/third-party/kay/src/class/mod.rs:42:40
   |
42 |             message_handlers: unsafe { make_array!(MAX_MESSAGE_TYPES, |_| MessageHandler::Unassigned) },
   |                                        -------------------------------------------------------------- in this macro invocation

warning: unnecessary `unsafe` block
  --> /home/krzysztof/Work/third-party/kay/src/class/mod.rs:40:26
   |
40 |         let actor_name = unsafe { ::std::intrinsics::type_name::<A>() };
   |                          ^^^^^^ unnecessary `unsafe` block
   |
   = note: `#[warn(unused_unsafe)]` on by default

warning: unnecessary `unsafe` block
  --> /home/krzysztof/Work/third-party/kay/src/type_registry.rs:50:23
   |
50 |         let long_id = unsafe { type_id::<T>() };
   |                       ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
  --> /home/krzysztof/Work/third-party/kay/src/type_registry.rs:54:31
   |
54 |             .insert(short_id, unsafe { type_name::<T>() }.into());
   |                               ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
  --> /home/krzysztof/Work/third-party/kay/src/type_registry.rs:60:62
   |
60 |         if let Some(&short_id) = self.long_to_short_ids.get(&unsafe { type_id::<T>() }) {
   |                                                              ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
  --> /home/krzysztof/Work/third-party/kay/src/type_registry.rs:63:40
   |
63 |             panic!("{:?} not known.", &unsafe { type_name::<T>() })
   |                                        ^^^^^^ unnecessary `unsafe` block

warning: unnecessary `unsafe` block
  --> /home/krzysztof/Work/third-party/kay/src/type_registry.rs:69:19
   |
69 |             .get(&unsafe { type_id::<T>() })
   |                   ^^^^^^ unnecessary `unsafe` block

   Compiling kay_simple_example_common v0.1.0 (/home/krzysztof/Work/third-party/kay/examples/simple_common)
error[E0053]: method `from_raw` has an incompatible type for trait
  --> src/counter/kay_auto.rs:11:5
   |
11 |     unsafe fn from_raw(id: RawID) -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected normal fn, found unsafe fn
   |
   = note: expected fn pointer `fn(kay::RawID) -> counter::kay_auto::CounterListenerID`
              found fn pointer `unsafe fn(kay::RawID) -> counter::kay_auto::CounterListenerID`

error[E0046]: not all trait items implemented, missing: `Target`
  --> src/counter/kay_auto.rs:10:1
   |
10 | impl TypedID for CounterListenerID {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Target` in implementation
   |
   = help: implement the missing item: `type Target = Type;`

error[E0053]: method `from_raw` has an incompatible type for trait
  --> src/counter/kay_auto.rs:54:5
   |
54 |     unsafe fn from_raw(id: RawID) -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected normal fn, found unsafe fn
   |
   = note: expected fn pointer `fn(kay::RawID) -> counter::kay_auto::CounterID`
              found fn pointer `unsafe fn(kay::RawID) -> counter::kay_auto::CounterID`

error[E0046]: not all trait items implemented, missing: `Target`
  --> src/counter/kay_auto.rs:53:1
   |
53 | impl TypedID for CounterID {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Target` in implementation
   |
   = help: implement the missing item: `type Target = Type;`

error[E0053]: method `from_raw` has an incompatible type for trait
  --> src/counter/kay_auto.rs:75:5
   |
75 |     unsafe fn from_raw(id: RawID) -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected normal fn, found unsafe fn
   |
   = note: expected fn pointer `fn(kay::RawID) -> counter::kay_auto::ServerLoggerID`
              found fn pointer `unsafe fn(kay::RawID) -> counter::kay_auto::ServerLoggerID`

error[E0046]: not all trait items implemented, missing: `Target`
  --> src/counter/kay_auto.rs:74:1
   |
74 | impl TypedID for ServerLoggerID {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Target` in implementation
   |
   = help: implement the missing item: `type Target = Type;`

error[E0053]: method `from_raw` has an incompatible type for trait
  --> src/counter/kay_auto.rs:96:5
   |
96 |     unsafe fn from_raw(id: RawID) -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected normal fn, found unsafe fn
   |
   = note: expected fn pointer `fn(kay::RawID) -> counter::kay_auto::BrowserLoggerID`
              found fn pointer `unsafe fn(kay::RawID) -> counter::kay_auto::BrowserLoggerID`

error[E0046]: not all trait items implemented, missing: `Target`
  --> src/counter/kay_auto.rs:95:1
   |
95 | impl TypedID for BrowserLoggerID {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Target` in implementation
   |
   = help: implement the missing item: `type Target = Type;`

error: aborting due to 8 previous errors

Some errors have detailed explanations: E0046, E0053.
For more information about an error, try `rustc --explain E0046`.
error: could not compile `kay_simple_example_common`.

To learn more, run the command again with --verbose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions