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

Compile error: error[E0432]: unresolved import `` #315

Closed
Johnson-A opened this issue Nov 21, 2016 · 2 comments
Closed

Compile error: error[E0432]: unresolved import `` #315

Johnson-A opened this issue Nov 21, 2016 · 2 comments

Comments

@Johnson-A
Copy link

piston2d-gfx_graphics v0.33.1 fails to compile with rustc 1.15.0-nightly (ba872f270 2016-11-17) giving the following error message compiler_error.txt

There are two additional warnings: $crate may not be imported on each error. Is this a problem with the way the crate has been implemented? I say this because there was a compile error on the previous version that seemed very similar #308

@lucklove
Copy link

lucklove commented Nov 27, 2016

It seems that newest rust nightly don't support use $crate in macros, but unfortunately, gfx v0.12.0, which piston2d-gfx_graphics v0.33.1 depends on, do so. In src/macros/pso.rs:

205 #[macro_export]
206 macro_rules! gfx_pipeline_base {
207     ($module:ident {
208         $( $field:ident: $ty:ty, )*
209     }) => {
210         pub mod $module {
211             use $crate;
212             #[allow(unused_imports)]
213             use super::*;
214             gfx_pipeline_inner!{ $(
215                 $field: $ty,
216             )*}
217         }
218     }
219 }

To workaround, simply delete the line use $crate in.
Of course, we should fix it permanently, but the difficulty is, the newest gfx's structure is never like 0.12.x at all, it doesn't even expose these macros now(these macros is now at a sub directory of gfx as a sub crate). We should work out a better way to get out of it.

@lucklove
Copy link

lucklove commented Nov 27, 2016

Thanks for this issue, going to close this in favour of tracking at #313.

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

No branches or pull requests

2 participants