hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
438 stars 280 forks source link

ci: Bump rust toolchain to nightly-2024-09-09 #5047

Closed BAStos525 closed 1 month ago

BAStos525 commented 1 month ago

Context

Bump rust toolchain to nightly-2024-09-09 in iroha2 CI.

Solution

Closes #5045

Checklist

mversic commented 1 month ago

update wasm_builder/src/lib.rs also

DCNick3 commented 1 month ago

How about we commit a rust-toolchain.toml file so that the developers get the rust version corresponding to what we have in CI right away?

[toolchain]
channel = "nightly-2024-09-09"
mversic commented 1 month ago

How about we commit a rust-toolchain.toml file so that the developers get the rust version corresponding to what we have in CI right away?

[toolchain]
channel = "nightly-2024-09-09"

opened #5051

nxsaken commented 1 month ago

The clippy lint expectation is in the wrong place

mversic commented 1 month ago

The clippy lint expectation is in the wrong place

what's the right place? I tried different places

nxsaken commented 1 month ago

These work, better use the most specific place:

#[expect(unreachable_patterns)]
const fn on_fn() {
    let x = 5;
    match x {
        _y => (),
        5 => (),
    }
}

const fn in_fn() {
    let x = 5;

    #[expect(unreachable_patterns)]
    match x {
        _y => (),
        5 => (), // the unreachable arm fulfills the expectation
    }

    match x {
        _y => (),
        #[expect(unreachable_patterns)]
        5 => (),
    }
}
mversic commented 1 month ago

These work, better use the most specific place:

#[expect(unreachable_patterns)]
const fn on_fn() {
    let x = 5;
    match x {
        _y => (),
        5 => (),
    }
}

const fn in_fn() {
    let x = 5;

    #[expect(unreachable_patterns)]
    match x {
        _y => (),
        5 => (), // the unreachable arm fulfills the expectation
    }

    match x {
        _y => (),
        #[expect(unreachable_patterns)]
        5 => (),
    }
}

sure, but in this case it lint complains on the enum definition, not where it's used