mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-07 14:13:47 +00:00
testsuite: Update and un-xfail unsafe-fn-autoderef
This commit is contained in:
parent
06c46d5142
commit
be062db808
@ -9,9 +9,11 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// xfail-test
|
||||
type rec = {f: int};
|
||||
fn f(p: *rec) -> int {
|
||||
struct Rec {
|
||||
f: int
|
||||
}
|
||||
|
||||
fn f(p: *Rec) -> int {
|
||||
|
||||
// Test that * ptrs do not autoderef. There is a deeper reason for
|
||||
// prohibiting this, beyond making unsafe things annoying (which doesn't
|
||||
@ -25,7 +27,7 @@ fn f(p: *rec) -> int {
|
||||
// are prohibited by various checks, such as that the enum is
|
||||
// instantiable and so forth).
|
||||
|
||||
return p.f; //~ ERROR attempted access of field `f` on type `*rec`
|
||||
return p.f; //~ ERROR attempted access of field `f` on type `*Rec`
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Loading…
Reference in New Issue
Block a user