Cargo doesn't expand macros properly when generating docs


#1

I have defined a macro to bind constants:

#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct Const(pub i32);

macro_rules! bind_constant {
    ($NAME:ident, $value:expr) => {
        pub const $NAME: Const = Const($value);
    }
}

bind_constant!(A, 10i32);
bind_constant!(B, 20i32);

#[test]
#[should_panic]
fn test_consts() {
    assert_eq!(A, B);
}

When I use Cargo to generate docs, it fails to expand the macro properly:

pub const A: Const = Const($value)