about summary refs log tree commit diff
path: root/tests/ui/suggestions/private-field.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/suggestions/private-field.rs')
-rw-r--r--tests/ui/suggestions/private-field.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/suggestions/private-field.rs b/tests/ui/suggestions/private-field.rs
new file mode 100644
index 00000000000..1cc4d2a4d06
--- /dev/null
+++ b/tests/ui/suggestions/private-field.rs
@@ -0,0 +1,19 @@
+// compile-flags: --crate-type lib
+pub struct S {
+    pub val: string::MyString,
+}
+
+pub fn test(s: S) {
+    dbg!(s.cap) //~ ERROR: no field `cap` on type `S` [E0609]
+}
+
+pub(crate) mod string {
+
+    pub struct MyString {
+        buf: MyVec,
+    }
+
+    struct MyVec {
+        cap: usize,
+    }
+}