Skip to content

Commit 4e4f90d

Browse files
committed
auto merge of #6482 : catamorphism/rust/unsafe-fn-autoderef, r=catamorphism
2 parents 217f963 + be062db commit 4e4f90d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/test/compile-fail/unsafe-fn-autoderef.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
// option. This file may not be copied, modified, or distributed
1010
// except according to those terms.
1111

12-
// xfail-test
13-
type rec = {f: int};
14-
fn f(p: *rec) -> int {
12+
struct Rec {
13+
f: int
14+
}
15+
16+
fn f(p: *Rec) -> int {
1517

1618
// Test that * ptrs do not autoderef. There is a deeper reason for
1719
// prohibiting this, beyond making unsafe things annoying (which doesn't
@@ -25,7 +27,7 @@ fn f(p: *rec) -> int {
2527
// are prohibited by various checks, such as that the enum is
2628
// instantiable and so forth).
2729

28-
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`
2931
}
3032

3133
fn main() {

0 commit comments

Comments
 (0)