Add test of qpath interpolations
This commit is contained in:
parent
dd549dcab4
commit
01800caddf
1 changed files with 8 additions and 1 deletions
|
|
@ -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)
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue