Skip to content
New issue

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

Bug: use of undeclared type or module inventory #3

Open
SiebenCorgie opened this issue Mar 21, 2020 · 1 comment
Open

Bug: use of undeclared type or module inventory #3

SiebenCorgie opened this issue Mar 21, 2020 · 1 comment

Comments

@SiebenCorgie
Copy link

Hi,

I tried to used the crate like this:

extern crate traitcast;
use traitcast::{TraitcastFrom, Traitcast};

pub trait Widget: TraitcastFrom{
    fn print(&self){
	println!("Yay from the trait!");
    }
}

struct One(u32);
impl One{
    fn print_one(&self){
	println!("From within one: {}", self.0);
    }
}
impl Widget for One{}


struct Two(f32);
impl Two{
    fn print_two(&self){
	println!("From within two: {}", self.0);
    }
}
impl Widget for Two{}


traitcast::traitcast!(struct One: Widget);
traitcast::traitcast!(struct Two: Widget);

However, the compiler notes for the traitcast! lines:

error[E0433]: failed to resolve: use of undeclared type or module `inventory`
   --> neith-synth/src/main.rs:100:1
    |
100 | traitcast::traitcast!(struct Two: Widget);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared type or module `inventory`
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

Any idea why this might happen?
I also tried version 0.2.1, but it does not work as well.

@dynaxis
Copy link

dynaxis commented Apr 3, 2020

This crate doesn't seem to be in active maintenance. If it's ok to switch to another similar crate, I wrote a new crate called intertrait basically motivated by traitcast. Since I have a main project to use it, it will be actively maintained (actually planning to enhance).

https://github.com/codechain-io/intertrait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants