Allow borrow attribute on newtype variants

This commit is contained in:
David Tolnay
2017-11-05 11:21:39 -08:00
parent ab68132b1f
commit 40db31691a
5 changed files with 81 additions and 11 deletions
+6
View File
@@ -357,6 +357,12 @@ fn test_gen() {
s: Str<'a>,
}
#[derive(Serialize, Deserialize)]
enum BorrowVariant<'a> {
#[serde(borrow, with = "StrDef")]
S(Str<'a>),
}
mod vis {
pub struct S;