mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
Add test of qpath interpolations
This commit is contained in:
parent
dd549dcab4
commit
01800caddf
@ -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…
Reference in New Issue
Block a user