diff options
Diffstat (limited to 'tests/ui/issues/issue-5718.rs')
-rw-r--r-- | tests/ui/issues/issue-5718.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-5718.rs b/tests/ui/issues/issue-5718.rs new file mode 100644 index 000000000..f29a1e2a0 --- /dev/null +++ b/tests/ui/issues/issue-5718.rs @@ -0,0 +1,24 @@ +// run-pass +// pretty-expanded FIXME #23616 + +struct Element; + +macro_rules! foo { + ($tag: expr, $string: expr) => { + if $tag == $string { + let element: Box<_> = Box::new(Element); + unsafe { + return std::mem::transmute::<_, usize>(element); + } + } + } +} + +fn bar() -> usize { + foo!("a", "b"); + 0 +} + +fn main() { + bar(); +} |