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

Collect lifetimes inside macro invocations
This commit is contained in:
David Tolnay
2021-01-24 19:08:20 -08:00
committed by GitHub
2 changed files with 37 additions and 2 deletions
+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>),
}
}
//////////////////////////////////////////////////////////////////////////