Skip to content

Commit

Permalink
Add test of qpath interpolations
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 25, 2021
1 parent dd549dc commit 01800ca
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/test/ui/macros/macro-interpolation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}

0 comments on commit 01800ca

Please sign in to comment.