Replace unused variable in struct with others

Hi @0xSamWitch, thanks for those details. The plugin does not support rename/retype annotations within structs at the moment, due to a limitation of solidity: https://github.com/ethereum/solidity/issues/12295. But you can use a retype annotation on the actual variable where you use the struct.

For example:

contract Lock is UUPSUpgradeable, OwnableUpgradeable {
    struct S {
        uint64 a;
        uint8 bFails;
        uint8 cRenameFails;
    }

    S s;
    ...
contract LockV2 is UUPSUpgradeable, OwnableUpgradeable {
    struct S {
        uint64 a;
        bool bFails;
        uint8 cChangedName;
    }

    /// @custom:oz-retyped-from Lock.S
    S s;
    ...

Note that by doing this, it does not perform storage layout comparisons within the struct, so you should manually ensure that they are compatible.

I've also opened an issue here to track this.