Closed
Description
The following program with paste = "0.1.12"
compiles on stable (rustc 1.46.0 (04488afe3 2020-08-24)
), but doesn't on Nightly (rustc 1.48.0-nightly (0e2c1281e 2020-09-07)
).
This is minimized from Firefox source code, which doesn't build anymore with Rust Nightly.
To be fair, I'm surprised it built in the first place...
#[macro_use] extern crate paste;
#[derive(Clone, Copy)]
struct Bar {
member: i32,
}
impl Bar {
fn get_member(&self, _: i32, _: i32) -> i32 {
self.member
}
}
macro_rules! foo {
($fn_name:ident $(, $arg:ident)*) => {
paste::expr! {
Bar::[<get_ $fn_name>](&self.bar $(, $arg)* ,callback)
}
};
}
struct Foo {
bar: Bar,
}
impl Foo {
fn member(&self, n: i32, callback: i32) -> i32 {
foo!(member, n)
}
}
fn main() {}