diff options
| author | bwmf2 <bwmf2@protonmail.com> | 2023-02-28 06:05:45 +0100 |
|---|---|---|
| committer | bwmf2 <bwmf2@protonmail.com> | 2023-03-02 21:58:57 +0100 |
| commit | 219195fc4c98649785154e2c66075be716bc0c01 (patch) | |
| tree | c07298c986d36adc3f4eca8a60d9f5197e82696e | |
| parent | cdeb0e3e02cc70ca4efb41fa67b55b5722a81121 (diff) | |
| download | rust-219195fc4c98649785154e2c66075be716bc0c01.tar.gz rust-219195fc4c98649785154e2c66075be716bc0c01.zip | |
Add UI test
| -rw-r--r-- | tests/ui/macros/issue-98790.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/macros/issue-98790.rs b/tests/ui/macros/issue-98790.rs new file mode 100644 index 00000000000..8fe6fc41d10 --- /dev/null +++ b/tests/ui/macros/issue-98790.rs @@ -0,0 +1,24 @@ +// run-pass + +macro_rules! stringify_item { + ($item:item) => { + stringify!($item) + }; +} + +macro_rules! repro { + ($expr:expr) => { + stringify_item! { + pub fn repro() -> bool { + $expr + } + } + }; +} + +fn main() { + assert_eq!( + repro!(match () { () => true } | true), + "pub fn repro() -> bool { (match () { () => true, }) | true }" + ); +} |
