summaryrefslogtreecommitdiffstats
path: root/tests/ui/privacy/private-in-public-expr-pat.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/privacy/private-in-public-expr-pat.rs')
-rw-r--r--tests/ui/privacy/private-in-public-expr-pat.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ui/privacy/private-in-public-expr-pat.rs b/tests/ui/privacy/private-in-public-expr-pat.rs
new file mode 100644
index 000000000..5c9ecd13b
--- /dev/null
+++ b/tests/ui/privacy/private-in-public-expr-pat.rs
@@ -0,0 +1,13 @@
+// Patterns and expressions are not interface parts and don't produce private-in-public errors.
+
+// build-pass (FIXME(62277): could be check-pass?)
+
+struct Priv1(usize);
+struct Priv2;
+
+pub struct Pub(Priv2);
+
+pub fn public_expr(_: [u8; Priv1(0).0]) {} // OK
+pub fn public_pat(Pub(Priv2): Pub) {} // OK
+
+fn main() {}