about summary refs log tree commit diff
path: root/tests/ui/structs/default-field-values/non-exhaustive-ctor-not-found.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/structs/default-field-values/non-exhaustive-ctor-not-found.rs')
-rw-r--r--tests/ui/structs/default-field-values/non-exhaustive-ctor-not-found.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/structs/default-field-values/non-exhaustive-ctor-not-found.rs b/tests/ui/structs/default-field-values/non-exhaustive-ctor-not-found.rs
new file mode 100644
index 00000000000..4c5926a91ea
--- /dev/null
+++ b/tests/ui/structs/default-field-values/non-exhaustive-ctor-not-found.rs
@@ -0,0 +1,8 @@
+// Regression test for https://github.com/rust-lang/rust/issues/145367
+mod m {
+    struct Priv2;
+}
+fn main() {
+    WithUse { one: m::Priv2 } //~ ERROR: cannot find struct, variant or union type `WithUse` in this scope
+    //~^ ERROR: unit struct `Priv2` is private
+}