summaryrefslogtreecommitdiffstats
path: root/src/test/ui/typeck/issue-91210-ptr-method.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/typeck/issue-91210-ptr-method.fixed')
-rw-r--r--src/test/ui/typeck/issue-91210-ptr-method.fixed15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/typeck/issue-91210-ptr-method.fixed b/src/test/ui/typeck/issue-91210-ptr-method.fixed
new file mode 100644
index 000000000..94200cce7
--- /dev/null
+++ b/src/test/ui/typeck/issue-91210-ptr-method.fixed
@@ -0,0 +1,15 @@
+// Regression test for issue #91210.
+
+// run-rustfix
+
+#![allow(unused)]
+
+struct Foo { read: i32 }
+
+unsafe fn blah(x: *mut Foo) {
+ (*x).read = 4;
+ //~^ ERROR: attempted to take value of method
+ //~| HELP: to access the field, dereference first
+}
+
+fn main() {}