summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/issue-39161-bogus-error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/consts/issue-39161-bogus-error.rs')
-rw-r--r--tests/ui/consts/issue-39161-bogus-error.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/consts/issue-39161-bogus-error.rs b/tests/ui/consts/issue-39161-bogus-error.rs
new file mode 100644
index 000000000..a954385da
--- /dev/null
+++ b/tests/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 };
+}