Skip to content

LuaUserData can't be used with generics #48

Description

@Shatur

The following code:

use std::marker::PhantomData;
use luars::LuaUserData;


#[derive(LuaUserData)]
struct Test<T> {
    a: u8,
    marker: PhantomData<T>,
}

Results in

error[E0107]: missing generics for struct `lua::Test`
 --> tests/luars.rs:8:12
  |
8 |     struct Test<T> {
  |            ^^^^ expected 1 generic argument
  |
note: struct defined here, with 1 generic parameter: `T`
 --> tests/luars.rs:8:12
  |
8 |     struct Test<T> {
  |            ^^^^ -
help: add missing generic argument
  |
8 |     struct Test<T><T> {
  |                +++

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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