diff --git a/test_suite/tests/run-pass/untagged-and-borrow.rs b/test_suite/tests/run-pass/untagged-and-borrow.rs new file mode 100644 index 00000000..9cc1027a --- /dev/null +++ b/test_suite/tests/run-pass/untagged-and-borrow.rs @@ -0,0 +1,25 @@ +// Copyright 2017 Serde Developers +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[macro_use] +extern crate serde_derive; + +#[derive(Deserialize)] +#[serde(untagged)] +enum RelData<'a> { + Single(#[serde(borrow)] RelObject<'a>), + Many(#[serde(borrow)] Vec>), +} + +#[derive(Deserialize)] +struct RelObject<'a> { + ty: &'a str, + id: String, +} + +fn main() {}