You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IIRC there was a compilation error about the usize to u8 cast a while ago, the release was yanked at the time, and it was fixed. Clippy still errors because of it though:
main.rs:
use parity_scale_codec::{Decode,Encode,};#[derive(Encode,Decode)]pubenumFoo{Bar,}fnmain(){}
Cargo.toml:
[package]
name = "foobar"edition = "2024"
[dependencies]
parity-scale-codec = { version = "=3.7.4", features = ["derive"] }
[workspace]
The following errors appear for clippy:
$ cargo +1.85 clippy -- -Dclippy::cast_possible_truncation
Checking foobar v0.0.0 (/tmp/foobar)
error: casting `usize` to `u8` may truncate the value
--> src/main.rs:8:5
|
8 | Bar,
| ^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
= note: requested on the command line with `-D clippy::cast-possible-truncation`
help: ... or use `try_from` and handle the error accordingly
|
8 | Bar::try_from(Encode),
|~~~~~~~~~~~~~~~~~~~~~
error: casting `usize` to `u8` may truncate the value
--> src/main.rs:8:5
|
8 | Bar,
| ^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use `try_from` and handle the error accordingly
|
8 | Bar::try_from(Encode),
|~~~~~~~~~~~~~~~~~~~~~
error: casting `usize` to `u8` may truncate the value
--> src/main.rs:8:5
|
8 | Bar,
| ^^^
|
= help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ...
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation
help: ... or use `try_from` and handle the error accordingly
|
8 | Bar::try_from(Decode),
|~~~~~~~~~~~~~~~~~~~~~
The text was updated successfully, but these errors were encountered:
IIRC there was a compilation error about the
usize
tou8
cast a while ago, the release was yanked at the time, and it was fixed. Clippy still errors because of it though:main.rs
:Cargo.toml
:The following errors appear for
clippy
:The text was updated successfully, but these errors were encountered: