Merge pull request #1831 from taiki-e/borrow-macro

Collect lifetimes inside macro invocations
This commit is contained in:
David Tolnay authored and GitHub committed 2021-01-24 19:08:20 -08:00
commit aeee73fe92
2 files changed
+37 -2

No files matched your search

+12
View File
@@ -723,6 +723,18 @@ fn test_gen() {
}
deriving!(&'a str);
macro_rules! mac {
($($tt:tt)*) => {
$($tt)*
};
}
#[derive(Deserialize)]
struct BorrowLifetimeInsideMacro<'a> {
#[serde(borrow = "'a")]
f: mac!(Cow<'a, str>),
}
}
//////////////////////////////////////////////////////////////////////////