Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 71dc033

Browse files
committed
Add a test for rust-lang#2919
1 parent 7c1ad96 commit 71dc033

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

tests/source/macro_rules.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,19 @@ macro_rules! impl_as_byte_slice_arrays {
263263
}
264264
};
265265
}
266+
267+
// #2919
268+
fn foo() {
269+
{
270+
macro_rules! touch_value {
271+
($func:ident, $value:expr) => {{
272+
let result = API::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppendMode::paTouch);
273+
let result = API::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppend);
274+
let result = API::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppendM);
275+
let result = APIIIIIIIII::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppendM);
276+
let result = API::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppendMMMMMMMMMM);
277+
debug_assert!(result == 0);
278+
}};
279+
}
280+
}
281+
}

tests/target/macro_rules.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,31 @@ macro_rules! impl_as_byte_slice_arrays {
305305
}
306306
};
307307
}
308+
309+
// #2919
310+
fn foo() {
311+
{
312+
macro_rules! touch_value {
313+
($func:ident, $value:expr) => {{
314+
let result = API::get_cached().$func(
315+
self,
316+
key.as_ptr(),
317+
$value,
318+
ffi::VSPropAppendMode::paTouch,
319+
);
320+
let result = API::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppend);
321+
let result =
322+
API::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppendM);
323+
let result =
324+
APIIIIIIIII::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppendM);
325+
let result = API::get_cached().$func(
326+
self,
327+
key.as_ptr(),
328+
$value,
329+
ffi::VSPropAppendMMMMMMMMMM,
330+
);
331+
debug_assert!(result == 0);
332+
}};
333+
}
334+
}
335+
}

0 commit comments

Comments
 (0)