Test never_type

This commit is contained in:
David Tolnay
2018-06-03 00:15:05 -07:00
parent fd6178cad6
commit 22b1af7eb3
2 changed files with 37 additions and 0 deletions
+12
View File
@@ -6,6 +6,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![cfg_attr(feature = "unstable", feature(never_type))]
#[macro_use]
extern crate serde_derive;
@@ -548,6 +550,16 @@ declare_tests! {
}
}
#[cfg(feature = "unstable")]
declare_tests! {
test_never_result {
Ok::<u8, !>(0) => &[
Token::NewtypeVariant { name: "Result", variant: "Ok" },
Token::U8(0),
],
}
}
#[test]
#[cfg(unix)]
fn test_cannot_serialize_paths() {