rust-lang/rust-clippy

[lint idea] dangerous transmutes

Open

#546 aperta il 13 gen 2016

Vedi su GitHub
 (11 commenti) (0 reazioni) (0 assegnatari)Rust (1391 fork)batch import
A-lintT-middlegood first issue

Metriche repository

Star
 (10.406 star)
Metriche merge PR
 (Merge medio 19g 22h) (113 PR mergiate in 30 g)

Descrizione

Along the lines of useless_transmute, it seems plausible to warn on transmute::<X, Y>(x) where X and Y aren't both primitive types or marked #[repr(C)], since as @ubsan keeps reminding us this is likely to cause UB.

Guida contributor