We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried to use the generics support in foreign_types like this:
foreign_types
foreign_type! { pub unsafe type Feature<'a> { type CType = libc::c_void; type PhantomData = 'a; fn drop = feature_dtor; } }
The compiler error I get is:
error: at least one trait is required for an object type --> src/foo/bar.rs:21:28 | 21 | type PhantomData = 'a; | ^^
Is there some other way of doing this using the macro? Or maybe I'm using it incorrectly?
The text was updated successfully, but these errors were encountered:
'a is a lifetime, not a type. See here for example of using &'a (): https://docs.rs/foreign-types/latest/foreign_types/macro.foreign_type.html#examples
'a
&'a ()
Sorry, something went wrong.
@sfackler Perfect! Apologies for missing that example. Much appreciated.
No branches or pull requests
I tried to use the generics support in
foreign_types
like this:The compiler error I get is:
Is there some other way of doing this using the macro? Or maybe I'm using it incorrectly?
The text was updated successfully, but these errors were encountered: