Add test of NtTy in a qpath
Currently fails: error: expected identifier, found `ToOwned` --> src/test/ui/macros/macro-interpolation.rs:23:19 | LL | <$type as $trait>::$name | ^^^^^^ expected identifier ... LL | let _: qpath!(ty, <str as ToOwned>::Owned); | ----------------------------------- | | | this macro call doesn't expand to a type | in this macro invocation
This commit is contained in:
parent
01800caddf
commit
558ddee2ce
@ -15,13 +15,18 @@ fn $fnname($arg: $ty) -> Option<$ty> $body
|
||||
}
|
||||
|
||||
macro_rules! qpath {
|
||||
(<$type:ty as $trait:path>::$name:ident) => {
|
||||
(path, <$type:ty as $trait:path>::$name:ident) => {
|
||||
<$type as $trait>::$name
|
||||
};
|
||||
|
||||
(ty, <$type:ty as $trait:ty>::$name:ident) => {
|
||||
<$type as $trait>::$name
|
||||
};
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let _: qpath!(<str as ToOwned>::Owned);
|
||||
let _: qpath!(path, <str as ToOwned>::Owned);
|
||||
let _: qpath!(ty, <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