summaryrefslogtreecommitdiffstats
path: root/tests/ui-fulldeps/session-diagnostic/invalid-variable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui-fulldeps/session-diagnostic/invalid-variable.rs')
-rw-r--r--tests/ui-fulldeps/session-diagnostic/invalid-variable.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui-fulldeps/session-diagnostic/invalid-variable.rs b/tests/ui-fulldeps/session-diagnostic/invalid-variable.rs
new file mode 100644
index 000000000..57798dda3
--- /dev/null
+++ b/tests/ui-fulldeps/session-diagnostic/invalid-variable.rs
@@ -0,0 +1,21 @@
+// run-fail
+// compile-flags: --test
+// test that messages referencing non-existent fields cause test failures
+
+#![feature(rustc_private)]
+#![crate_type = "lib"]
+
+extern crate rustc_driver;
+extern crate rustc_fluent_macro;
+extern crate rustc_macros;
+extern crate rustc_errors;
+use rustc_fluent_macro::fluent_messages;
+use rustc_macros::Diagnostic;
+use rustc_errors::{SubdiagnosticMessage, DiagnosticMessage};
+extern crate rustc_session;
+
+fluent_messages! { "./example.ftl" }
+
+#[derive(Diagnostic)]
+#[diag(no_crate_bad_reference)]
+struct BadRef;