Skip to content

dec!() procedural macro doesn't work on rust stable (1.30.0) #151

@zazabe

Description

@zazabe

It seems that dec!() is not working on the latest rust release.

extern crate rust_decimal;
extern crate rust_decimal_macros;
use rust_decimal_macros::*;
fn main() {
    let num = dec!(3.14);
}

produces this error:

error[E0658]: procedural macros cannot be expanded to expressions (see issue #38356)
 --> examples/decimal.rs:5:15
  |
5 |     let num = dec!(3.14);
  |               ^^^^^^^^^^

error: aborting due to previous error
  • rustc 1.30.0 (da5f414c2 2018-10-24)
  • rust_decimal = "0.10.2"
  • rust_decimal_macros = "0.10.2"

Btw, I tried with #![feature(proc_macro)] with no luck...

Am i missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions