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

maud_macros does not work under older Rust nightly versions #132

Closed
mbilker opened this issue Jun 1, 2018 · 4 comments
Closed

maud_macros does not work under older Rust nightly versions #132

mbilker opened this issue Jun 1, 2018 · 4 comments
Labels

Comments

@mbilker
Copy link

mbilker commented Jun 1, 2018

When trying to compile Maud under rustc 1.27.0-nightly (ac5c0848d 2018-05-14) (not using the current version because of Diesel 1.3 compilation errors and rust-lang/rust#50825 and rust-lang/rust#51042), Maud fails to compile because TokenTree and Ident have been removed from the proc_macro crate in the most recent version.

error[E0432]: unresolved import `proc_macro::Ident`                                               
 --> maud_macros/src/generate.rs:8:5                                                                        
  |                                                                                               
8 |     Ident,                                                                                        
  |     ^^^^^ no `Ident` in the root                                                                              
                                                            
error[E0432]: unresolved import `proc_macro::Ident`                                                
  --> maud_macros/src/lib.rs:19:33                                                                          
   |                                                                                                                            
19 | use proc_macro::{Literal, Span, Ident, TokenStream, TokenTree};                            
   |                                 ^^^^^ no `Ident` in the root                                           
                                                                            
error[E0599]: no variant named `Ident` found for type `proc_macro::TokenTree` in the current scope       
  --> maud_macros/src/lib.rs:37:24                                    
   |                                                                                              
37 |     let output_ident = TokenTree::Ident(Ident::new("__maud_output", Span::def_site()));    
   |                        ^^^^^^^^^^^^^^^^ variant not found in `proc_macro::TokenTree`                   
                                                  
error[E0599]: no variant named `Ident` found for type `proc_macro::TokenTree` in the current scope
   --> maud_macros/src/generate.rs:185:33                                             
    |                                                                                              
185 |         name: TokenStream::from(TokenTree::Ident(Ident::new(attr_name, Span::call_site()))),
    |                                 ^^^^^^^^^^^^^^^^ variant not found in `proc_macro::TokenTree`
..snipped for brevity...

If possible, maud_macros should move to proc_macro2 to avoid this issue.

I see Ident is available through the proc_macro crate in newer Rust nightly versions, but unfortunately Ident is not available through proc_macro in the 2018-05-14.

@mbilker
Copy link
Author

mbilker commented Jun 1, 2018

The above compilation errors are from overriding the nightly version using rustup override set nightly-2018-05-15 and running cargo test from the master branch of Maud.

@mbilker mbilker changed the title maud_macros does not specify the proc_macro version it uses maud_macros does not work under older Rust nightly versions Jun 1, 2018
@mbilker
Copy link
Author

mbilker commented Jun 1, 2018

This issue may not be relevant as Rust nightly is the unstable version, which implies older versions of it are not supported and I should downgrade the Maud version I am using.

@lambda-fairy
Copy link
Owner

You're correct in that Maud does not support older versions of Nightly.

That said, either 0.17.4 or 0.17.3 should work with your setup. I haven't introduced any user-facing changes lately so it should be safe to downgrade.

@mbilker
Copy link
Author

mbilker commented Jun 2, 2018

Using a forced version on maud_macros to version =0.17.4, my program compiles. Thank you anyway.

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

No branches or pull requests

2 participants