Skip to content

Function-like procedural macros in expression position as seen in 1.30 announcement are not stable yet #285

Closed
@dtolnay

Description

@dtolnay

Only macros in statement position are stable in 1.30.

error[E0658]: procedural macros cannot be expanded to expressions (see issue #38356)                                           
 --> src/main.rs:5:15                                                                                                          
  |                                                                                                                            
5 |     let sql = sql!(SELECT * FROM posts WHERE id=1);                                                                        
  |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The stabilization hasn't landed in nightly yet either.

error[E0658]: procedural macros cannot be expanded to expressions (see issue #54727)                                           
 --> src/main.rs:5:15                                                                                                          
  |                                                                                                                            
5 |     let sql = sql!(SELECT * FROM posts WHERE id=1);                                                                        
  |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                         
  |                                                                                                                            
  = help: add #![feature(proc_macro_hygiene)] to the crate attributes to enable

Mentioning @steveklabnik.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions