diff options
| author | David Tolnay <dtolnay@gmail.com> | 2021-11-22 19:57:08 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2021-11-25 15:03:59 -0800 |
| commit | 01800caddf74375e17bbdedb9606139704fc3aed (patch) | |
| tree | 9af734977e6e06aee0d4df494f821aaca3cca11a | |
| parent | dd549dcab404ec4c7d07b5a83aca5bdd7171138f (diff) | |
| download | rust-01800caddf74375e17bbdedb9606139704fc3aed.tar.gz rust-01800caddf74375e17bbdedb9606139704fc3aed.zip | |
Add test of qpath interpolations
| -rw-r--r-- | src/test/ui/macros/macro-interpolation.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/ui/macros/macro-interpolation.rs b/src/test/ui/macros/macro-interpolation.rs index abe1f2aaf15..2dee804fb31 100644 --- a/src/test/ui/macros/macro-interpolation.rs +++ b/src/test/ui/macros/macro-interpolation.rs @@ -14,8 +14,15 @@ macro_rules! overly_complicated { } +macro_rules! qpath { + (<$type:ty as $trait:path>::$name:ident) => { + <$type as $trait>::$name + }; +} + pub fn main() { + let _: qpath!(<str as ToOwned>::Owned); + assert!(overly_complicated!(f, x, Option<usize>, { return Some(x); }, Some(8), Some(y), y) == 8) - } |
