]> git.lizzy.rs Git - rust.git/commitdiff
Address some comments
authormejrs <>
Mon, 24 Oct 2022 18:52:51 +0000 (20:52 +0200)
committermejrs <>
Mon, 24 Oct 2022 18:52:51 +0000 (20:52 +0200)
tests/ui/track-diagnostics.rs [new file with mode: 0644]
tests/ui/track-diagnostics.stderr [new file with mode: 0644]

diff --git a/tests/ui/track-diagnostics.rs b/tests/ui/track-diagnostics.rs
new file mode 100644 (file)
index 0000000..8c96f46
--- /dev/null
@@ -0,0 +1,8 @@
+// compile-flags: -Z track-diagnostics
+// error-pattern: created at
+
+struct A;
+struct B;
+const S: A = B;
+
+fn main() {}
diff --git a/tests/ui/track-diagnostics.stderr b/tests/ui/track-diagnostics.stderr
new file mode 100644 (file)
index 0000000..76453cf
--- /dev/null
@@ -0,0 +1,10 @@
+error[E0308]: mismatched types
+  --> $DIR/track-diagnostics.rs:6:14
+   |
+LL | const S: A = B;
+   |              ^ expected struct `A`, found struct `B`
+-Ztrack-diagnostics: created at compiler/rustc_infer/src/infer/error_reporting/mod.rs:2275:31
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.