summaryrefslogtreecommitdiffstats
path: root/tests/ui/confuse-field-and-method/issue-18343.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/confuse-field-and-method/issue-18343.rs')
-rw-r--r--tests/ui/confuse-field-and-method/issue-18343.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/confuse-field-and-method/issue-18343.rs b/tests/ui/confuse-field-and-method/issue-18343.rs
new file mode 100644
index 000000000..bc2d73fae
--- /dev/null
+++ b/tests/ui/confuse-field-and-method/issue-18343.rs
@@ -0,0 +1,9 @@
+struct Obj<F> where F: FnMut() -> u32 {
+ closure: F,
+}
+
+fn main() {
+ let o = Obj { closure: || 42 };
+ o.closure();
+ //~^ ERROR no method named `closure` found
+}