`::from` is not a const fn, so applying the suggestion of `cast_lossless` would fail to compile. The fix is to skip the lint if the cast is found inside a const fn.
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498