We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06c46d5 commit be062dbCopy full SHA for be062db
src/test/compile-fail/unsafe-fn-autoderef.rs
@@ -9,9 +9,11 @@
9
// option. This file may not be copied, modified, or distributed
10
// except according to those terms.
11
12
-// xfail-test
13
-type rec = {f: int};
14
-fn f(p: *rec) -> int {
+struct Rec {
+ f: int
+}
15
+
16
+fn f(p: *Rec) -> int {
17
18
// Test that * ptrs do not autoderef. There is a deeper reason for
19
// prohibiting this, beyond making unsafe things annoying (which doesn't
@@ -25,7 +27,7 @@ fn f(p: *rec) -> int {
25
27
// are prohibited by various checks, such as that the enum is
26
28
// instantiable and so forth).
29
- return p.f; //~ ERROR attempted access of field `f` on type `*rec`
30
+ return p.f; //~ ERROR attempted access of field `f` on type `*Rec`
31
}
32
33
fn main() {
0 commit comments