From 503abc77d27618779556be79a6214e6b4445045a Mon Sep 17 00:00:00 2001 From: Yerkebulan Tulibergenov Date: Wed, 16 Jun 2021 14:05:36 -0700 Subject: [PATCH] add regression test for issue #39161 --- src/test/ui/consts/issue-39161-bogus-error.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/test/ui/consts/issue-39161-bogus-error.rs 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 0000000000000..a954385da41a4 --- /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 }; +}