#[solved]expands to `impl X { fn x() }` but says "implementation is not supported in `impl`s"... Why?

5 messages · Page 1 of 1 (latest)

lunar kindle
#

Oh nvm

#

nvm it was very simple

#
#[cfg(false)]
macro_rules! x {
  ($($tt:tt)*) => { $($tt)* }
}
#[cfg(true)]
macro_rules! x {
  ($($tt:tt)*) => { impl X { $($tt)* } }
}

macro_rules! b {
    ($ident:ident) => {
        #[cfg(false)]
        impl X {
            fn $ident() {}
        }
        #[cfg(true)]
        fn $ident() {}
    };
}

x! {
  b! {
    ident
  }
}
#

I asked why does it say "impl is not supported in impl" but I see that it doesn't care about the fact that cfg is always false

#

[solved]expands to impl X { fn x() } but says "implementation is not supported in impls"... Why?