about summary refs log tree commit diff
path: root/src/test/ui/structs
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-04-16 15:50:32 +0900
committerYuki Okushi <huyuumi.dev@gmail.com>2020-05-06 14:02:55 +0900
commite69748ba4f48efdc9a1dfcf8c16bc9aba39a86e3 (patch)
tree33fc77d7a08037da5deeb878068f5af0284aa732 /src/test/ui/structs
parent43271a39adc26d29350d4830b594c6435472815e (diff)
downloadrust-e69748ba4f48efdc9a1dfcf8c16bc9aba39a86e3.tar.gz
rust-e69748ba4f48efdc9a1dfcf8c16bc9aba39a86e3.zip
Move tests from `test/run-fail` to UI
Diffstat (limited to 'src/test/ui/structs')
-rw-r--r--src/test/ui/structs/rhs-type.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/structs/rhs-type.rs b/src/test/ui/structs/rhs-type.rs
new file mode 100644
index 00000000000..dd227a7f0a0
--- /dev/null
+++ b/src/test/ui/structs/rhs-type.rs
@@ -0,0 +1,17 @@
+// Tests that codegen treats the rhs of pth's decl
+// as a _|_-typed thing, not a str-typed thing
+
+// run-fail
+// error-pattern:bye
+
+#![allow(unreachable_code)]
+#![allow(unused_variables)]
+
+struct T {
+    t: String,
+}
+
+fn main() {
+    let pth = panic!("bye");
+    let _rs: T = T { t: pth };
+}