Closed
Description
enum Foo {
A { a: int },
B { b: int, bb: int },
}
macro_rules! thingy2(
() => (
match B { b: 10, bb: 10 } {
A { a } => println!("{}", a),
B { b, bb } => println!("{} {}", b, bb),
}
)
)
fn main() {
thingy2!()
}
~ ❯ rustc -Z debug-info test.rs
~ ❯ gdb test
GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb 6 22:51:23 UTC 2013)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .. done
(gdb) r
Starting program: /Users/sfackler/test
Reading symbols for shared libraries ..+................................................................. done
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000001
[Switching to process 59143 thread 0x40b]
0x000000010000171f in main () at <std-macros>:291
291 <std-macros>: No such file or directory.
in <std-macros>
If I change Foo
to
enum Foo {
A(int),
B(int, int)
}
The program works as expected. Manually expanding the macro invocation also causes the program to work correctly.