You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mod some_mod;use some_mod::*;pubfnmain(){let foo_animal = Animal::Cat(Cat);println!("{}", foo_animal.shout("BAR"));}
The above minimal example fails to compile and I couldn't figure out how to get it to work using #[macro_use], I fixed it by placing the trait definition above the enum definition in some_mod.rs. So the following does compile:
Relates to #19, it seems the order of definitions matter if inside the same module file?
some_mod.rs
main.rs
The above minimal example fails to compile and I couldn't figure out how to get it to work using
#[macro_use]
, I fixed it by placing the trait definition above the enum definition insome_mod.rs
. So the following does compile:some_mod.rs
The text was updated successfully, but these errors were encountered: