diff options
author | Haibo Huang <hhb@google.com> | 2020-11-10 14:59:44 -0800 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2020-11-10 14:59:44 -0800 |
commit | 280ada00d1b6b6d9cf413bd6924e546f766d0c85 (patch) | |
tree | c29a4ef1cd9f2c53cc8730608ac2a9b7fdce9126 /tests | |
parent | ece47a2b47a15d4d23b394f513be4e93e2a617ec (diff) | |
download | paste-280ada00d1b6b6d9cf413bd6924e546f766d0c85.tar.gz |
Upgrade rust/crates/paste to 1.0.3
Test: make
Change-Id: I41d7f8b48bc045364c961850e91f1f6d84de7210
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_attr.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_attr.rs b/tests/test_attr.rs new file mode 100644 index 0000000..fd67e2a --- /dev/null +++ b/tests/test_attr.rs @@ -0,0 +1,22 @@ +use paste::paste; + +#[test] +fn test_paste_cfg() { + macro_rules! m { + ($ret:ident, $width:expr) => { + paste! { + #[cfg(any(feature = "protocol_feature_" $ret:snake, target_pointer_width = "" $width))] + fn new() -> $ret { todo!() } + } + }; + } + + struct Paste; + + #[cfg(target_pointer_width = "64")] + m!(Paste, 64); + #[cfg(target_pointer_width = "32")] + m!(Paste, 32); + + let _ = new; +} |