Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[verifier] Migrate id_immutable tests #2015

Merged
merged 1 commit into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
processed 1 task

task 0 'publish'. lines 4-18:
Error: Failed to verify the Move module, reason: "In function foo: ID field of struct Foo cannot be mut borrowed because ID is immutable.".
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

//# publish
module 0x0.M {
import 0x2.ID;

struct Foo<T> has key {
id: ID.VersionedID,
}

foo(f: Self.Foo<u64>) {
label l0:
_ = &mut (&mut f).Foo<u64>::id;
abort 0;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
processed 1 task

task 0 'publish'. lines 4-18:
Error: Failed to verify the Move module, reason: "In function foo: ID field of struct Foo cannot be mut borrowed because ID is immutable.".
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

//# publish
module 0x0.M {
import 0x2.ID;

struct Foo has key {
id: ID.VersionedID,
}

foo(f: Self.Foo) {
label l0:
_ = &mut (&mut f).Foo::id;
abort 0;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
processed 1 task

task 0 'publish'. lines 4-19:
created: object(103)
written: object(102)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

//# publish
module 0x0.M {
import 0x2.ID;

struct Foo has key {
id: ID.VersionedID,
other: ID.VersionedID,
}

foo(f: Self.Foo) {
label l0:
_ = &mut (&mut f).Foo::other;
abort 0;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
processed 1 task

task 0 'publish'. lines 4-18:
created: object(103)
written: object(102)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

//# publish
module 0x0.M {
import 0x2.ID;

struct Foo {
id: ID.VersionedID,
}

foo(f: Self.Foo) {
label l0:
_ = &mut (&mut f).Foo::id;
abort 0;
}

}
158 changes: 0 additions & 158 deletions crates/sui-verifier/tests/id_immutable_verification_test.rs

This file was deleted.