about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-06-22 07:37:52 +0900
committerGitHub <noreply@github.com>2021-06-22 07:37:52 +0900
commit4d73300f8ace436a9151b67b0f1e4af0d21647e7 (patch)
tree40a01f54e857f4d30b549d766c0e565b6936ea0b
parent8389cd3a1a085a95e1d65de1bd3b11dedd85e8ed (diff)
parent503abc77d27618779556be79a6214e6b4445045a (diff)
downloadrust-4d73300f8ace436a9151b67b0f1e4af0d21647e7.tar.gz
rust-4d73300f8ace436a9151b67b0f1e4af0d21647e7.zip
Rollup merge of #86381 - yerke:add-test-for-issue-39161, r=JohnTitor
Add regression test for issue #39161

Closes #39161

Based on feedback from ``@JohnTitor`` in https://github.com/rust-lang/rust/pull/71333

r? ``@JohnTitor``
-rw-r--r--src/test/ui/consts/issue-39161-bogus-error.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/consts/issue-39161-bogus-error.rs b/src/test/ui/consts/issue-39161-bogus-error.rs
new file mode 100644
index 00000000000..a954385da41
--- /dev/null
+++ b/src/test/ui/consts/issue-39161-bogus-error.rs
@@ -0,0 +1,13 @@
+// check-pass
+
+pub struct X {
+    pub a: i32,
+    pub b: i32,
+}
+
+fn main() {
+    const DX: X = X { a: 0, b: 0 };
+    const _X1: X = X { a: 1, ..DX };
+    let _x2 = X { a: 1, b: 2, ..DX };
+    const _X3: X = X { a: 1, b: 2, ..DX };
+}