Inherit the visibility of remote struct definition

This commit is contained in:
David Tolnay committed 2017-07-25 23:52:06 -07:00
1 parent e6487cf6fa
commit f36a1e0895
3 files changed
+19 -2

No files matched your search

+15
View File
@@ -358,6 +358,21 @@ fn test_gen() {
#[serde(borrow, with = "StrDef")]
s: Str<'a>,
}
mod vis {
pub struct S;
#[derive(Serialize, Deserialize)]
#[serde(remote = "S")]
pub struct SDef;
}
// This would not work if SDef::serialize / deserialize are private.
#[derive(Serialize, Deserialize)]
struct RemoteVisibility {
#[serde(with = "vis::SDef")]
s: vis::S,
}
}
//////////////////////////////////////////////////////////////////////////