summaryrefslogtreecommitdiffstats
path: root/third_party/rust/serde_with_macros/tests/compiler-messages.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/serde_with_macros/tests/compiler-messages.rs')
-rw-r--r--third_party/rust/serde_with_macros/tests/compiler-messages.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/third_party/rust/serde_with_macros/tests/compiler-messages.rs b/third_party/rust/serde_with_macros/tests/compiler-messages.rs
new file mode 100644
index 0000000000..01373a3d3b
--- /dev/null
+++ b/third_party/rust/serde_with_macros/tests/compiler-messages.rs
@@ -0,0 +1,15 @@
+extern crate rustversion;
+extern crate trybuild;
+
+// This test fails for older compiler versions since the error messages are different.
+#[rustversion::attr(before(1.35), ignore)]
+#[test]
+fn compile_test() {
+ // This test does not work under tarpaulin, so skip it if detected
+ if std::env::var("TARPAULIN") == Ok("1".to_string()) {
+ return;
+ }
+
+ let t = trybuild::TestCases::new();
+ t.compile_fail("tests/compile-fail/*.rs");
+}