Skip to content

maud_macros does not work under older Rust nightly versions #132

Closed
@mbilker

Description

@mbilker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions