`sui move test` reports unused variable from framework

repro steps,

  1. git clone git@github.com:shinamicorp/account-graph.git,
  2. sui move test

my sui version is sui 1.7.0-362c5c3f2

❯ sui move test
UPDATING GIT DEPENDENCY https://github.com/MystenLabs/sui.git
INCLUDING DEPENDENCY Sui
INCLUDING DEPENDENCY MoveStdlib
BUILDING account-graph
warning[W09009]: unused struct field
    ┌─ /home/shiqi/.move/https___github_com_MystenLabs_sui_git_framework__testnet/crates/sui-framework/packages/sui-framework/tests/kiosk/kiosk_tests.move:131:40
    │
131 │     struct WrongAsset has key, store { id: sui::object::UID }
    │                                        ^^ The 'id' field of the 'WrongAsset' type is unused
    │
    = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct')

warning[W09009]: unused struct field
    ┌─ /home/shiqi/.move/https___github_com_MystenLabs_sui_git_framework__testnet/crates/sui-framework/packages/sui-framework/sources/display.move:208:9
    │
208 │         id: UID,
    │         ^^ The 'id' field of the 'Capy' type is unused
    │
    = This warning can be suppressed with '#[allow(unused_field)]' applied to the 'module' or module member ('const', 'fun', or 'struct')

1 Like

@shiqicao I cloned the repository and ran sui move test, but I do not get any warnings. Everything is green and all tests are passing. Perhaps it’s a Sui version issue, could you try installing the latest version (I know we fixed some of these unused warnings)? My Sui version is 1.9.0-064def2ed6-dirty (built locally from main yesterday)

2 Likes