summaryrefslogtreecommitdiffstats
path: root/src/test/ui/confuse-field-and-method/issue-32128.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/confuse-field-and-method/issue-32128.rs')
-rw-r--r--src/test/ui/confuse-field-and-method/issue-32128.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/confuse-field-and-method/issue-32128.rs b/src/test/ui/confuse-field-and-method/issue-32128.rs
new file mode 100644
index 000000000..5a024aa4b
--- /dev/null
+++ b/src/test/ui/confuse-field-and-method/issue-32128.rs
@@ -0,0 +1,15 @@
+struct Example {
+ example: Box<dyn Fn(i32) -> i32>
+}
+
+fn main() {
+ let demo = Example {
+ example: Box::new(|x| {
+ x + 1
+ })
+ };
+
+ demo.example(1);
+ //~^ ERROR no method named `example`
+ // (demo.example)(1);
+}